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

Player freezes complete electron application when stopped just after video has been initialized #93

Open
vihar638 opened this issue Nov 29, 2021 · 0 comments

Comments

@vihar638
Copy link

vihar638 commented Nov 29, 2021

var wjs = require("wcjs-player");
var conf = {
wcjs: require('wcjs-prebuilt'),
multiscreen: true,
autoplay: true,
loop: true,
};

var liveViewPlayerHolder = new wjs('#player').addPlayer(conf);

liveViewPlayerHolder.clearPlaylist();
liveViewPlayerHolder.addPlaylist(url);
liveViewPlayerHolder.play();

liveViewPlayerHolder.onBuffering(function(p){

if(p > 0 && p < 1)
{
liveViewPlayerHolder.stop();
setTimeout(() => {
start();
}, 1000);
}
else if(p > 50){
stop();
start();
}
});

function stop()
{
liveViewPlayerHolder.stop();

      setTimeout(() => {
          start();
      }, 1000);
  
  return true;

}

function start()
{
liveViewPlayerHolder.clearPlaylist();
liveViewPlayerHolder.addPlaylist(url);
liveViewPlayerHolder.play();
}

In some condition the player completely stuck the complete electron application and it stuck in file wcjs-player/index.js

wjs.prototype.stop = function() {

wjsButton = this.find(".wcp-pause");

if (wjsButton.length != 0) wjsButton.removeClass("wcp-pause").addClass("wcp-play");

wjsButton = this.find(".wcp-replay");

if (wjsButton.length != 0) wjsButton.removeClass("wcp-replay").addClass("wcp-play");

//player completely works fine till this line
this.vlc.playlist.stop();
//player stucks here

positionChanged.call(this,0);

this.find(".wcp-time-current").text("");

this.find(".wcp-time-total").text("");

return this;

}

@vihar638 vihar638 changed the title Player freezes complete application when stopped just after video has been initialized Player freezes complete electron application when stopped just after video has been initialized Nov 29, 2021
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