Fixed issue on cast image/title

This commit is contained in:
Kasper Rynning-Tønnesen
2017-01-27 19:41:58 +01:00
parent 2fbdf66783
commit 303849ea43
4 changed files with 13 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -293,8 +293,8 @@ initializeCastApi = function() {
case cast.framework.SessionState.SESSION_STARTED: case cast.framework.SessionState.SESSION_STARTED:
castSession = cast.framework.CastContext.getInstance().getCurrentSession(); castSession = cast.framework.CastContext.getInstance().getCurrentSession();
castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener) castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener)
chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+id+'/mqdefault.jpg'}); chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg'});
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg'); chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
chromecastAvailable = true; chromecastAvailable = true;
paused = false; paused = false;
mobile_beginning = false; mobile_beginning = false;
@@ -311,8 +311,8 @@ initializeCastApi = function() {
case cast.framework.SessionState.SESSION_RESUMED: case cast.framework.SessionState.SESSION_RESUMED:
castSession = cast.framework.CastContext.getInstance().getCurrentSession(); castSession = cast.framework.CastContext.getInstance().getCurrentSession();
castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener); castSession.addMessageListener("urn:x-cast:zoff.no", chromecastListener);
chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+id+'/mqdefault.jpg'}); chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg'});
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg'); chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
chromecastAvailable = true; chromecastAvailable = true;
paused = false; paused = false;
mobile_beginning = false; mobile_beginning = false;

View File

@@ -191,8 +191,8 @@ var Player = {
if(chromecastAvailable){ if(chromecastAvailable){
castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"}); castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"});
//socket.emit('pos', {channel: chan.toLowerCase()}); //socket.emit('pos', {channel: chan.toLowerCase()});
chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+id+'/mqdefault.jpg'}); chrome.cast.media.GenericMediaMetadata({metadataType: "GENERIC", title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg'});
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg'); chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
if($("#pause").hasClass("hide")){ if($("#pause").hasClass("hide")){
$("#play").toggleClass("hide"); $("#play").toggleClass("hide");
$("#pause").toggleClass("hide"); $("#pause").toggleClass("hide");
@@ -265,7 +265,7 @@ var Player = {
if(chromecastAvailable){ if(chromecastAvailable){
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id}); castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id});
chrome.cast.media.GenericMediaMetadata({metadataType: "GENERIC", title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg'}); chrome.cast.media.GenericMediaMetadata({metadataType: "GENERIC", title:song_title, image: 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg'});
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg'); chrome.cast.Image('https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg');
} else { } else {
Player.loadVideoById(video_id); Player.loadVideoById(video_id);
} }