mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Receiver
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user