mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Things
This commit is contained in:
@@ -113,19 +113,6 @@ function chromecastListener(evt, data) {
|
|||||||
console.log("error parsing again");
|
console.log("error parsing again");
|
||||||
}
|
}
|
||||||
console.log(json_parsed.type, typeof(json_parsed));
|
console.log(json_parsed.type, typeof(json_parsed));
|
||||||
if(json_parsed.type == 1) {
|
|
||||||
console.log("it is 1");
|
|
||||||
if(!$("#play").hasClass("hide")) {
|
|
||||||
$("#play").addClass("hide");
|
|
||||||
}
|
|
||||||
$("#pause").removeClass("hide");
|
|
||||||
} else if(json_parsed.type == 2) {
|
|
||||||
console.log("it is 1");
|
|
||||||
if(!$("#pause").hasClass("hide")) {
|
|
||||||
$("#pause").addClass("hide");
|
|
||||||
}
|
|
||||||
$("#play").removeClass("hide");
|
|
||||||
}
|
|
||||||
//console.log(JSON.parse(json_parsed), json_parsed.type, json_parsed.type == 1, json_parsed.type == "1");
|
//console.log(JSON.parse(json_parsed), json_parsed.type, json_parsed.type == 1, json_parsed.type == "1");
|
||||||
switch(json_parsed.type){
|
switch(json_parsed.type){
|
||||||
case -1:
|
case -1:
|
||||||
|
|||||||
@@ -238,6 +238,20 @@ initializeCastApi = function() {
|
|||||||
switch (event.sessionState) {
|
switch (event.sessionState) {
|
||||||
case cast.framework.SessionState.SESSION_STARTED:
|
case cast.framework.SessionState.SESSION_STARTED:
|
||||||
castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||||
|
var customData = [
|
||||||
|
{type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title},
|
||||||
|
{type: "loadVideo", start: Player.np.start, end: Player.np.end, videoId: video_id, seekTo: _seekTo, channel: chan.toLowerCase()},
|
||||||
|
];
|
||||||
|
if(Helper.mobilecheck()) {
|
||||||
|
customData.push({type: "mobilespecs", guid: guid, socketid: socket.id, adminpass: adminpass == "" ? "" : Crypt.crypt_pass(adminpass), channel: chan.toLowerCase(), userpass: embed ? '' : Crypt.crypt_pass(Crypt.get_userpass(chan.toLowerCase()))});
|
||||||
|
}
|
||||||
|
var request = new chrome.cast.media.LoadRequest({
|
||||||
|
media: {
|
||||||
|
contentId: video_id,
|
||||||
|
contentType: 'video/*',
|
||||||
|
},
|
||||||
|
customData: customData,
|
||||||
|
});
|
||||||
castSession.addMessageListener("urn:x-cast:zoff.me", chromecastListener)
|
castSession.addMessageListener("urn:x-cast:zoff.me", chromecastListener)
|
||||||
chrome.cast.media.GenericMediaMetadata({metadataType: 0, title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg', images: ['https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg']});
|
chrome.cast.media.GenericMediaMetadata({metadataType: 0, title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg', images: ['https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg']});
|
||||||
//chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
|
//chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
|
||||||
|
|||||||
Reference in New Issue
Block a user