mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updated a lot
This commit is contained in:
@@ -107,7 +107,7 @@ function onYouTubeIframeAPIReady() {
|
|||||||
player = new YT.Player('player', {
|
player = new YT.Player('player', {
|
||||||
height: 562,
|
height: 562,
|
||||||
width: 1000,
|
width: 1000,
|
||||||
playerVars: { 'autoplay': 0, 'controls': 0 },
|
playerVars: { 'autoplay': 0, 'controls': 0, rel:"0", wmode:"transparent", iv_load_policy: "3" },
|
||||||
events: {
|
events: {
|
||||||
'onReady': onPlayerReady,
|
'onReady': onPlayerReady,
|
||||||
'onStateChange': onPlayerStateChange
|
'onStateChange': onPlayerStateChange
|
||||||
@@ -136,7 +136,7 @@ function onPlayerStateChange(event) {
|
|||||||
//channel.send({'event':'stateChange','message':event.data});
|
//channel.send({'event':'stateChange','message':event.data});
|
||||||
console.log(event);
|
console.log(event);
|
||||||
if (event.data==YT.PlayerState.ENDED) {
|
if (event.data==YT.PlayerState.ENDED) {
|
||||||
customMessageBus.broadcast({type: -1, videoId: videoId})
|
customMessageBus.broadcast("{type: -1, videoId: " + videoId + "}")
|
||||||
customMessageBus.send("urn:x-cast:zoff.no", {type: -1, videoId: videoId})
|
customMessageBus.send("urn:x-cast:zoff.no", {type: -1, videoId: videoId})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
static/dist/main.min.js
vendored
4
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -252,7 +252,7 @@ initializeCastApi = function() {
|
|||||||
castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener)
|
castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener)
|
||||||
chromecastAvailable = true;
|
chromecastAvailable = true;
|
||||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id, seekTo: Player.player.getCurrentTime()})
|
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id, seekTo: Player.player.getCurrentTime()})
|
||||||
|
console.log(full_playlist[0]);
|
||||||
hide_native(1);
|
hide_native(1);
|
||||||
|
|
||||||
$(".castButton").toggleClass("hide");
|
$(".castButton").toggleClass("hide");
|
||||||
@@ -298,11 +298,11 @@ function hide_native(way){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function chromecastListener(event){
|
function chromecastListener(evt,event){
|
||||||
console.log(event);
|
var json_parsed = JSON.parse(event);
|
||||||
switch(event.data.type){
|
switch(json_parsed){
|
||||||
case -1:
|
case -1:
|
||||||
socket.emit("end", {id: event.data.videoId, channel: chan.toLowerCase()});
|
socket.emit("end", {id: json_parsed.videoId, channel: chan.toLowerCase()});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user