mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Update to get videoId
This commit is contained in:
@@ -3,7 +3,8 @@ 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) {
|
||||
ytMessages[event.message.type](event);
|
||||
|
||||
ytMessages[event.data.type](event);
|
||||
}
|
||||
/**
|
||||
* Application config
|
||||
@@ -64,10 +65,10 @@ window.addEventListener('load', function() {
|
||||
|
||||
ytMessages={
|
||||
"getNextVideo": function(event) {
|
||||
nextVideo=event.message.videoId;
|
||||
nextVideo=event.data.videoId;
|
||||
},
|
||||
"loadVideo": function(event) {
|
||||
player.loadVideoById(event.message.videoId);
|
||||
player.loadVideoById(event.data.videoId);
|
||||
},
|
||||
"stopCasting": function() {
|
||||
endcast();
|
||||
@@ -82,7 +83,7 @@ ytMessages={
|
||||
player.stopVideo();
|
||||
},
|
||||
"seekTo": function(event) {
|
||||
player.seekTo(event.message.seekTo)
|
||||
player.seekTo(event.data.seekTo)
|
||||
},
|
||||
"getStatus": function() {
|
||||
channel.send({'event':'statusCheck','message':player.getPlayerState()});
|
||||
|
||||
2
static/dist/embed.min.js
vendored
2
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -252,6 +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})
|
||||
//cast.framework.CastSession(castSession);
|
||||
$(".castButton").toggleClass("hide");
|
||||
$(".castButton-active").toggleClass("hide");
|
||||
|
||||
Reference in New Issue
Block a user