mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
More updates receiver
This commit is contained in:
@@ -37,6 +37,7 @@ var embed_autoplay = "&autoplay";
|
||||
var connect_error = false;
|
||||
var access_token_data_youtube = {};
|
||||
var youtube_authenticated = false;
|
||||
var chromecastAvailable = false;
|
||||
|
||||
if(localStorage.debug === undefined){
|
||||
var debug = false;
|
||||
@@ -238,14 +239,24 @@ function init(){
|
||||
|
||||
initializeCastApi = function() {
|
||||
cast.framework.CastContext.getInstance().setOptions({
|
||||
receiverApplicationId: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID});
|
||||
receiverApplicationId: "E6856E24",
|
||||
autoJoinPolicy: chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED});
|
||||
//var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
//console.log(castSession);
|
||||
var context = cast.framework.CastContext.getInstance();
|
||||
context.addEventListener(
|
||||
cast.framework.CastContextEventType.SESSION_STATE_CHANGED,
|
||||
function(event) {
|
||||
console.log(event);
|
||||
switch (event.sessionState) {
|
||||
case cast.framework.SessionState.SESSION_STARTING:
|
||||
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
console.log(castSession);
|
||||
break;
|
||||
case cast.framework.SessionState.SESSION_STARTED:
|
||||
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
//cast.framework.CastSession(castSession);
|
||||
console.log(castSession);
|
||||
$(".castButton").toggleClass("hide");
|
||||
$(".castButton-active").toggleClass("hide");
|
||||
break;
|
||||
@@ -259,8 +270,15 @@ initializeCastApi = function() {
|
||||
// Update locally as necessary
|
||||
break;
|
||||
}
|
||||
})
|
||||
$(".castButton").css("display", "inline-block");
|
||||
});
|
||||
console.log(context);
|
||||
console.log("asd");
|
||||
if(context.L == "NOT_CONNECTED"){
|
||||
//$(".castButton").css("display", "inline-block");
|
||||
var castSession = cast.framework.CastContext.getInstance().getCurrentSession();
|
||||
console.log("hello");
|
||||
console.log(castSession);
|
||||
}
|
||||
};
|
||||
|
||||
function setup_no_connection_listener(){
|
||||
|
||||
Reference in New Issue
Block a user