Fixed issue where chromecast button not showing up when navigating back and forth from channels

This commit is contained in:
Kasper Rynning-Tønnesen
2017-06-07 00:49:46 +02:00
parent 991e093b8d
commit 9a57ad1b59
3 changed files with 10 additions and 4 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

@@ -475,8 +475,9 @@ initializeCastApi = function() {
}
});
var cast_state = cast.framework.CastContext.getInstance();
cast_state.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED, function(event){
//var cast_state = cast.framework.CastContext.getInstance();
context.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED, function(event){
Helper.log("cast state");
Helper.log(event.castState);
if(event.castState == "NOT_CONNECTED"){
@@ -496,6 +497,11 @@ initializeCastApi = function() {
cast_ready_connect = false;
}
});
if(context.getCastState() == "NOT_CONNECTED") {
$(".castButton-unactive").css("display", "block");
cast_ready_connect = true;
}
};
function hide_native(way){