Okay
  Public Ticket #3415443
Problem with Continuous Player when switching between icecast stream and audio file
Closed

Comments

  • Rodrigo started the conversation

    Continuous Player doesn't work properly in the following scenario:

    After playing an audio file source it sets cookies for the file itself, as it should do, but if I try to play an Icecast stream, the player doesn't set the file to Icecast, and when i navigate to other page, it gets the time from Icecast, but it plays the audio file. 


    I recorder the screen so you can see what happens: 


    In the video you can see:

    1) First, I play an Icecast stream and navigate between pages, it works fine;

    2) After that, I play an audio file and navigate between pages, it also works fine;

    3) Lastly, I start to play the Icecast stream again, and try to navigate between pages, but it wrongly plays the audio file again, not Icecast.

    Attached files:  Screenshot 2023-07-15 at 01.40.25.png

  • Rodrigo replied

    Test it out in the URL: https://prod.imprensamadureira.com.br/episodio/

    The first item is an audio file, the second item is an Icecast stream.

    Icecast stream is the default playlist for sticky player, you can also start the Icecast from "play" button in the header.

  • Rodrigo replied

    The problem is in the cookie sonaar_mp3_player_settings


    The first Icecast play set the cookie to this:

    {"playlistID":["52371"],"trackID":0,"elWidgetId":false,"shuffle":false,"mute":false,"isPlaying":true,"minimize":false,"json":false}


    When I play the audio file, it sets the cookie to this:

    {"playlistID":["52246"],"trackID":0,"elWidgetId":false,"shuffle":false,"mute":false,"isPlaying":true,"minimize":false,"json":"https://prod.imprensamadureira.com.br/?load=playlist.json&title=&albums=52246&feed_title=&feed=&feed_img=&el_widget_id=&artwork=&posts_per_pages=-1&all_category=&single_playlist=1&reverse_tracklist=&audio_meta_field=&repeater_meta_field=&import_file=&rss_items=-1&rss_item_title="}


    And when I play the Icecast again, it sets the cookie to this:

    {"playlistID":["52371"],"trackID":0,"elWidgetId":false,"shuffle":false,"mute":false,"isPlaying":true,"minimize":false,"json":"https://prod.imprensamadureira.com.br/?load=playlist.json&title=&albums=52246&feed_title=&feed=&feed_img=&el_widget_id=&artwork=&posts_per_pages=-1&all_category=&single_playlist=1&reverse_tracklist=&audio_meta_field=&repeater_meta_field=&import_file=&rss_items=-1&rss_item_title="}


    As you can see, the player set "playlistID":["52371"] correctly, but it doesn't set "json": false while keeping the old value. When I manually set the value I'm able to play Icecast properly again.

    This problem should be solved by changing the player function that sets the cookie value. I have no time to investigate and change the function by myself, so you guys have to do it.

  • Rodrigo replied

    I could found it is related with the option "Load Sonaar Scripts on Every Pages" from player settings. Deactivating this option makes the player works properly again.

    I wonder why this option exists.

  •  669
    Alexandre replied

    Hi Rodrigo, 
    Sorry for the wait, we dont work during weekend. And thanks for all the investigation you did. The load sonaar scripts on every pages is usefull when we want to call the sticky player with a js code in a page who doesnt have already an audio player.

    Thanks,


    Alexandre from the Sonaar.io Crew