mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
More chromecastfeatures
- Click on player pauses/plays video - Receives event on play/pause - Some indentationfixes - Not showing Join Channel modal when chromecast connected
This commit is contained in:
@@ -121,6 +121,18 @@ function chromecastListener(evt, data) {
|
||||
socket.emit("skip", {error: json_parsed.data_code, id: json_parsed.videoId, pass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(!$("#play").hasClass("hide")) {
|
||||
$("#play").addClass("hide");
|
||||
}
|
||||
$("#pause").removeClass("hide");
|
||||
break;
|
||||
case 2:
|
||||
if(!$("#pause").hasClass("hide")) {
|
||||
$("#pause").addClass("hide");
|
||||
}
|
||||
$("#play").removeClass("hide");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -842,7 +842,7 @@ var List = {
|
||||
},
|
||||
|
||||
show: function() {
|
||||
if(!Helper.mobilecheck())
|
||||
if(!Helper.mobilecheck() && !chromecastAvailable)
|
||||
{
|
||||
$("#channel-share-modal").modal("open");
|
||||
}
|
||||
|
||||
@@ -327,6 +327,12 @@ initializeCastApi = function() {
|
||||
}
|
||||
};
|
||||
|
||||
$(document).on("click", "#player_overlay", function(e) {
|
||||
if(chromecastAvailable) {
|
||||
Player.playPauseVideo();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", "#bitcoin-address", function(e) {
|
||||
var copyTextarea = document.querySelector('#bitcoin-address');
|
||||
copyTextarea.select();
|
||||
|
||||
@@ -283,6 +283,12 @@ var Player = {
|
||||
}
|
||||
},
|
||||
|
||||
playPauseVideo: function() {
|
||||
if(chromecastAvailable) {
|
||||
castSession.sendMessage("urn:x-cast:zoff.me", {type: "playPauseVideo"});
|
||||
}
|
||||
}
|
||||
|
||||
playVideo: function(){
|
||||
if(chromecastAvailable){
|
||||
castSession.sendMessage("urn:x-cast:zoff.me", {type: "playVideo"});
|
||||
|
||||
Reference in New Issue
Block a user