mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Updated chromecast sender
- Trying to get YouTube thumbnail to show up in the notificationbar - Trying to get YouTube title to show up in the notificationbar
This commit is contained in:
@@ -272,6 +272,8 @@ initializeCastApi = function() {
|
||||
case cast.framework.SessionState.SESSION_STARTED:
|
||||
castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
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.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||
chromecastAvailable = true;
|
||||
paused = false;
|
||||
mobile_beginning = false;
|
||||
@@ -288,6 +290,8 @@ initializeCastApi = function() {
|
||||
case cast.framework.SessionState.SESSION_RESUMED:
|
||||
castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
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.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||
chromecastAvailable = true;
|
||||
paused = false;
|
||||
mobile_beginning = false;
|
||||
|
||||
@@ -174,6 +174,8 @@ var Player = {
|
||||
if(chromecastAvailable){
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "playVideo"});
|
||||
//socket.emit('pos', {channel: chan.toLowerCase()});
|
||||
chrome.cast.media.GenericMediaMetadata({title:song_title, image: 'https://img.youtube.com/vi/'+id+'/mqdefault.jpg'});
|
||||
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||
if($("#pause").hasClass("hide")){
|
||||
$("#play").toggleClass("hide");
|
||||
$("#pause").toggleClass("hide");
|
||||
@@ -208,6 +210,8 @@ var Player = {
|
||||
loadVideoById: function(id){
|
||||
if(chromecastAvailable){
|
||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: id});
|
||||
chrome.cast.media.GenericMediaMetadata({metadataType: "GENERIC", title:song_title, image: 'https://img.youtube.com/vi/'+id+'/mqdefault.jpg'});
|
||||
chrome.cast.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||
} else {
|
||||
Player.player.loadVideoById(id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user