This commit is contained in:
Kasper Rynning-Tønnesen
2016-11-18 13:14:29 +01:00
parent e74e188bd9
commit f4c3a4a321
2 changed files with 7 additions and 2 deletions

View File

@@ -3,7 +3,12 @@ cast.receiver.logger.setLevelValue(cast.receiver.LoggerLevel.DEBUG);
window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
var customMessageBus = castReceiverManager.getCastMessageBus('urn:x-cast:zoff.no');
customMessageBus.onMessage = function(event) {
switch(event.data.type){
case "loadVideoBy":
player.loadVideoById(event.data.videoId);
break;
}
ytMessages[event.data.type](event);
}
/**
@@ -103,7 +108,7 @@ function onYouTubeIframeAPIReady() {
}
function onPlayerReady() {
channel.send({'event':'iframeApiReady','message':'ready'});
//channel.send({'event':'iframeApiReady','message':'ready'});
}
function onPlayerStateChange(event) {

View File

@@ -252,7 +252,7 @@ initializeCastApi = function() {
castSession = cast.framework.CastContext.getInstance().getCurrentSession();
window.castSession = cast.framework.CastContext.getInstance().getCurrentSession();
chromecastAvailable = true;
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id})
//castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id})
//cast.framework.CastSession(castSession);
$(".castButton").toggleClass("hide");
$(".castButton-active").toggleClass("hide");