mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed pausing on chromecast
This commit is contained in:
@@ -181,6 +181,11 @@
|
||||
<div id="player" class="ytplayer"></div>
|
||||
<div id="main_components">
|
||||
<div id="player_overlay" class="hide valign-wrapper">
|
||||
<div id="playing_on"><div id="chromecast_icon">
|
||||
<i class="mdi-hardware-cast-connected"></i>
|
||||
</div>
|
||||
<div id="chromecast_text"></div>
|
||||
</div>
|
||||
<div id="player_overlay_text" class="valign center-align">
|
||||
Waiting for Video
|
||||
</div>
|
||||
|
||||
@@ -38,6 +38,25 @@
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#playing_on{
|
||||
display: none;
|
||||
text-align: left;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
padding-left: 10px;
|
||||
align-items: center;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
#playing_on #chromecast_icon{
|
||||
font-size:70px;
|
||||
}
|
||||
|
||||
#playing_on #chromecast_text{
|
||||
font-size: 20px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.prev_page, .next_page, .last_page, .first_page{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
4
static/dist/embed.min.js
vendored
4
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
6
static/dist/main.min.js
vendored
6
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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