mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-13 21:15:57 +00:00
Fixed pausing on chromecast
This commit is contained in:
@@ -316,6 +316,8 @@ function hide_native(way){
|
||||
$("#player_overlay").css("background-color", "black");
|
||||
$("#player_overlay").css("background-repeat", "no-repeat");
|
||||
$("#player_overlay").css("height", "calc(100% - 32px)");
|
||||
$("#playing_on").css("display", "flex");
|
||||
$("#chromecast_text").html("Playing on<br>" + castSession.La.friendlyName);
|
||||
Player.player.setVolume(100);
|
||||
$("#volume").slider("value", 100);
|
||||
$("#player_overlay_text").toggleClass("hide");
|
||||
@@ -329,6 +331,8 @@ function hide_native(way){
|
||||
$("#volume").slider("value", Crypt.get_volume());
|
||||
$("#player_overlay").addClass("hide");
|
||||
$("#player_overlay_text").toggleClass("hide");
|
||||
$("#chromecast_text").html("");
|
||||
$("#playing_on").css("display", "none");
|
||||
socket.emit('pos', {channel: chan.toLowerCase()});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ var Player = {
|
||||
|
||||
if(!window.MSStream && !chromecastAvailable) $("#player_overlay").toggleClass("hide");
|
||||
try{
|
||||
Player.stopVideo();
|
||||
if(!chromecastAvailable) Player.stopVideo();
|
||||
}catch(e){}
|
||||
//List.importOldList(channel.toLowerCase());
|
||||
} else if(paused){
|
||||
@@ -36,7 +36,7 @@ var Player = {
|
||||
//Player.setBGimage(video_id);
|
||||
if(!Helper.mobilecheck()) Player.notifyUser(obj.np[0].id, obj.np[0].title);
|
||||
console.log("trying to stop");
|
||||
Player.stopVideo();
|
||||
if(!chromecastAvailable) Player.stopVideo();
|
||||
}else if(!paused){
|
||||
//Helper.log("gotten new song");
|
||||
if(previous_video_id === undefined)
|
||||
@@ -72,7 +72,7 @@ var Player = {
|
||||
Player.loadVideoById(video_id);
|
||||
if(!Helper.mobilecheck()) Player.notifyUser(video_id, song_title);
|
||||
Player.seekTo(seekTo);
|
||||
if(paused)
|
||||
if(paused && !chromecastAvailable)
|
||||
Player.pauseVideo();
|
||||
}
|
||||
if(!paused){
|
||||
@@ -160,9 +160,13 @@ var Player = {
|
||||
|
||||
playVideo: function(){
|
||||
if(chromecastAvailable){
|
||||
//castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"});
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"});
|
||||
//socket.emit('pos', {channel: chan.toLowerCase()});
|
||||
Playercontrols.play_pause();
|
||||
if($("#pause").hasClass("hide")){
|
||||
$("#play").toggleClass("hide");
|
||||
$("#pause").toggleClass("hide");
|
||||
}
|
||||
//Playercontrols.play_pause();
|
||||
} else {
|
||||
Player.player.playVideo();
|
||||
}
|
||||
@@ -170,8 +174,12 @@ var Player = {
|
||||
|
||||
pauseVideo: function(){
|
||||
if(chromecastAvailable){
|
||||
//castSession.sendMessage("urn:x-cast:zoff.no", {type: "pauseVideo"});
|
||||
Playercontrols.play_pause();
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "pauseVideo"});
|
||||
if($("#play").hasClass("hide")){
|
||||
$("#play").toggleClass("hide");
|
||||
$("#pause").toggleClass("hide");
|
||||
}
|
||||
//Playercontrols.play_pause();
|
||||
} else {
|
||||
Player.player.pauseVideo();
|
||||
}
|
||||
|
||||
@@ -80,13 +80,9 @@ var Playercontrols = {
|
||||
{
|
||||
if(chromecastAvailable){
|
||||
if($("#play").hasClass("hide")){
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "pauseVideo"});
|
||||
$("#play").toggleClass("hide");
|
||||
$("#pause").toggleClass("hide");
|
||||
Player.pauseVideo();
|
||||
} else if($("#pause").hasClass("hide")){
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"});
|
||||
$("#play").toggleClass("hide");
|
||||
$("#pause").toggleClass("hide");
|
||||
Player.playVideo();
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user