Quick fix for enabling start and end seconds on chromecast

This commit is contained in:
Kasper Rynning-Tønnesen
2017-11-09 08:07:49 +01:00
parent 120006c866
commit dd357ce7e3
2 changed files with 9 additions and 9 deletions

View File

@@ -531,7 +531,7 @@ initializeCastApi = function() {
} catch(e){
_seekTo = seekTo;
}
castSession.sendMessage("urn:x-cast:zoff.me", {type: "loadVideo", videoId: video_id, seekTo: _seekTo, channel: chan.toLowerCase()})
castSession.sendMessage("urn:x-cast:zoff.me", {type: "loadVideo", start: Player.np.start, end: Player.np.end, videoId: video_id, seekTo: _seekTo, channel: chan.toLowerCase()})
castSession.sendMessage("urn:x-cast:zoff.me", {type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title})
if(Helper.mobilecheck() && !chromecast_specs_sent) {
@@ -554,7 +554,7 @@ initializeCastApi = function() {
} catch(e){
_seekTo = seekTo;
}
castSession.sendMessage("urn:x-cast:zoff.me", {type: "loadVideo", videoId: video_id, seekTo: _seekTo, channel: chan.toLowerCase()})
castSession.sendMessage("urn:x-cast:zoff.me", {type: "loadVideo", start: Player.np.start, end: Player.np.end, videoId: video_id, seekTo: _seekTo, channel: chan.toLowerCase()})
castSession.sendMessage("urn:x-cast:zoff.me", {type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title})
hide_native(1);
break;

View File

@@ -304,17 +304,17 @@ var Player = {
},
loadVideoById: function(id, this_duration, start, end){
var s;
var e;
if(start) s = start;
else s = Player.np.start;
if(end) e = end;
else e = Player.np.end;
if(chromecastAvailable){
castSession.sendMessage("urn:x-cast:zoff.me", {type: "loadVideo", videoId: id, channel: chan.toLowerCase()});
castSession.sendMessage("urn:x-cast:zoff.me", {start: s, end: e, type: "loadVideo", videoId: id, channel: chan.toLowerCase()});
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 {
var s;
var e;
if(start) s = start;
else s = Player.np.start;
if(end) e = end;
else e = Player.np.end;
Player.player.loadVideoById({'videoId': id, 'startSeconds': s, 'endSeconds': e});
}
},