Soundcloud player freezes when changing pages in jQuery Mobile

I am researching this and trying out tons of different suggestions to get this to work and thought I would seek help as I am still having problems.

I have a site with multiple external jQuery Mobile pages. My music.html page is loading an iFrame for SoundCloud player. The player works fine, but when I switch to another page on the site, it stops. I would like him to keep playing.

If I am on a music page and I update it with a browser refresh, then the player works fine. It plays and I can freely navigate the site without losing sound. So this led me to believe that if I could somehow cause a reload when the music page was loading than the player would work the way I would like, but after trying probably a dozen or more reload / refresh scripts though the results were different, no one allowed the player to continue playing.

Right now, I've added data-ajax = "false" to the menu link that loads the music page. Even though I lost my "slide" transition for the page, it now works at will with one caveat; if the music is playing and I click on the Music link from any other page, it reloads the music page and therefore stops the music.

Here are some of the things I've tried to no avail:

$( ":mobile-pagecontainer" ).pagecontainer( "change", window.location.href, { allowSamePageTransition:true, transition:'none', showLoadMsg:false, reloadPage:true } );

      

also:

window.location.reload();

      

Also:

function refreshPage(page){
    // Page refresh
    page.trigger('pagecreate');
    page.listview('refresh');
}

      

Also:

function refreshPage()
{
    jQuery.mobile.changePage(window.location.href, {
        allowSamePageTransition: true,
        transition: 'none',
        reloadPage: true
    });
}

      

Also:

<div data-role="page" data-cache="false">

      

I don't mind losing page transitions and saving data-ajax = "false" when my music page loads. I'm just wondering if there is a way when the Music button is clicked to save the music.

Sorry for the long post! I really truly appreciate any guidance here.

Thank you very much!

+3


source to share





All Articles