Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CallBacks stop working after change from activity page. #27

Open
MasterB0t opened this issue Sep 8, 2023 · 0 comments
Open

CallBacks stop working after change from activity page. #27

MasterB0t opened this issue Sep 8, 2023 · 0 comments

Comments

@MasterB0t
Copy link

The call backs stop working after the player is play in a second or more pages. Let say we start playing a video in index.js the calls back working after the video end/stop and app move to a second page index2.js and a video is play there the call backs stop working. I will paste a sample code.

index.js

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
  
 
   url = "http://videourl.mp4";
    
   
    var vlcSuccess = function(json) { 
        console.log("SUCCESS "+JSON.stringify(json))
    }

    var vlcError = function(err) { 
        console.log("Error "+err);
    }


    window.VideoPlayerVLC.play(
        url,
        vlcSuccess,
        vlcError
    );

    alert('done');

    window.location = 'page2.html';

}

index2.js

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {
  
   
   url = "http://videourl.mp4";
    
    
    var vlcSuccess2 = function(json) { 
        console.log("SUCCESS "+JSON.stringify(json))
    }

    var vlcError2 = function(err) { 
        console.log("Error "+err);
    }


    window.VideoPlayerVLC.play(
        url,
        vlcSuccess2,
        vlcError2
    );

    alert('done');

}

But if I append the code of index2.js to index.js instead of redirect it works..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant