removed some logging functions, and made lsitening on chromecast better

This commit is contained in:
Kasper Rynning-Tønnesen
2016-11-18 15:13:53 +01:00
parent 071744440d
commit 37ee42fab5
4 changed files with 8 additions and 10 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

@@ -246,12 +246,10 @@ initializeCastApi = function() {
context.addEventListener( context.addEventListener(
cast.framework.CastContextEventType.SESSION_STATE_CHANGED, cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
function(event) { function(event) {
console.log(event);
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();
castSession.addMessageListner("urn:x-cast:zoff.no", chromecastListener) castSession.addMessageListner("urn:x-cast:zoff.no", chromecastListener)
window.castSession = cast.framework.CastContext.getInstance().getCurrentSession();
chromecastAvailable = true; chromecastAvailable = true;
castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id, seekTo: Player.player.getCurrentTime()}) castSession.sendMessage("urn:x-cast:zoff.no", {type: "loadVideo", videoId: video_id, seekTo: Player.player.getCurrentTime()})
@@ -275,8 +273,6 @@ initializeCastApi = function() {
}); });
}; };
window.hide_native = hide_native;
function hide_native(way){ function hide_native(way){
if(way == 1){ if(way == 1){
$("#controls").toggleClass("hide"); $("#controls").toggleClass("hide");

View File

@@ -139,9 +139,11 @@ var Player = {
case 2: case 2:
/*if(Helper.mobilecheck() || embed) /*if(Helper.mobilecheck() || embed)
{*/ {*/
paused = true; if(!chromecastAvailable){
if(window.location.pathname != "/") Playercontrols.play_pause_show(); paused = true;
mobile_beginning = true; if(window.location.pathname != "/") Playercontrols.play_pause_show();
mobile_beginning = true;
}
/*} /*}
else else
Player.player.playVideo();*/ Player.player.playVideo();*/