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:
4
public/dist/embed.min.js
vendored
4
public/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
8
public/dist/main.min.js
vendored
8
public/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -272,6 +272,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.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||||
chromecastAvailable = true;
|
chromecastAvailable = true;
|
||||||
paused = false;
|
paused = false;
|
||||||
mobile_beginning = false;
|
mobile_beginning = false;
|
||||||
@@ -288,6 +290,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.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||||
chromecastAvailable = true;
|
chromecastAvailable = true;
|
||||||
paused = false;
|
paused = false;
|
||||||
mobile_beginning = false;
|
mobile_beginning = false;
|
||||||
|
|||||||
@@ -174,6 +174,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.Image('https://img.youtube.com/vi/'+id+'/mqdefault.jpg');
|
||||||
if($("#pause").hasClass("hide")){
|
if($("#pause").hasClass("hide")){
|
||||||
$("#play").toggleClass("hide");
|
$("#play").toggleClass("hide");
|
||||||
$("#pause").toggleClass("hide");
|
$("#pause").toggleClass("hide");
|
||||||
@@ -208,6 +210,8 @@ var Player = {
|
|||||||
loadVideoById: function(id){
|
loadVideoById: function(id){
|
||||||
if(chromecastAvailable){
|
if(chromecastAvailable){
|
||||||
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: id});
|
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 {
|
} else {
|
||||||
Player.player.loadVideoById(id);
|
Player.player.loadVideoById(id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user