mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-07 18:15:35 +00:00
Got chromecast discoveryworking
This commit is contained in:
2
server/public/assets/dist/main.min.js
vendored
2
server/public/assets/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -12,6 +12,7 @@ var private_channel = false;
|
|||||||
var music = 0;
|
var music = 0;
|
||||||
var frontpage = 1;
|
var frontpage = 1;
|
||||||
var adminpass = "";
|
var adminpass = "";
|
||||||
|
var showDiscovery = false;
|
||||||
var filesadded = "";
|
var filesadded = "";
|
||||||
var player_ready = false;
|
var player_ready = false;
|
||||||
var viewers = 1;
|
var viewers = 1;
|
||||||
@@ -474,18 +475,6 @@ initializeCastApi = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(cast_ready_connect){
|
|
||||||
$(".castButton-unactive").css("display", "block");
|
|
||||||
if(!localStorage.getItem("_chSeen") || localStorage.getItem("_chSeen") == "false") {
|
|
||||||
$(".castButton-unactive").css("display", "block");
|
|
||||||
$('.tap-target').tapTarget('open');
|
|
||||||
localStorage.setItem("_chSeen", true);
|
|
||||||
tap_target_timeout = setTimeout(function() {
|
|
||||||
$('.tap-target').tapTarget('close');
|
|
||||||
}, 4000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var cast_state = cast.framework.CastContext.getInstance();
|
var cast_state = cast.framework.CastContext.getInstance();
|
||||||
cast_state.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED, function(event){
|
cast_state.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED, function(event){
|
||||||
Helper.log("cast state");
|
Helper.log("cast state");
|
||||||
@@ -493,13 +482,14 @@ initializeCastApi = function() {
|
|||||||
if(event.castState == "NOT_CONNECTED"){
|
if(event.castState == "NOT_CONNECTED"){
|
||||||
$(".castButton-unactive").css("display", "block");
|
$(".castButton-unactive").css("display", "block");
|
||||||
cast_ready_connect = true;
|
cast_ready_connect = true;
|
||||||
if(!localStorage.getItem("_chSeen") || localStorage.getItem("_chSeen") == "false") {
|
if(!localStorage.getItem("_chSeen") || localStorage.getItem("_chSeen") != "seen") {
|
||||||
$(".castButton-unactive").css("display", "block");
|
$(".castButton-unactive").css("display", "block");
|
||||||
|
showDiscovery = true;
|
||||||
$('.tap-target').tapTarget('open');
|
$('.tap-target').tapTarget('open');
|
||||||
localStorage.setItem("_chSeen", true);
|
|
||||||
tap_target_timeout = setTimeout(function() {
|
tap_target_timeout = setTimeout(function() {
|
||||||
$('.tap-target').tapTarget('close');
|
$('.tap-target').tapTarget('close');
|
||||||
}, 4000);
|
}, 4000);
|
||||||
|
localStorage.setItem("_chSeen", "seen");
|
||||||
}
|
}
|
||||||
} else if(event.castState == "NO_DEVICES_AVAILABLE"){
|
} else if(event.castState == "NO_DEVICES_AVAILABLE"){
|
||||||
$(".castButton-unactive").css("display", "none");
|
$(".castButton-unactive").css("display", "none");
|
||||||
@@ -1768,7 +1758,6 @@ function onepage_load(){
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/",
|
url: "/",
|
||||||
success: function(e){
|
success: function(e){
|
||||||
|
|
||||||
if(Helper.mobilecheck() || user_auth_avoid) {
|
if(Helper.mobilecheck() || user_auth_avoid) {
|
||||||
Helper.log("Removing all listeners");
|
Helper.log("Removing all listeners");
|
||||||
socket.removeAllListeners();
|
socket.removeAllListeners();
|
||||||
|
|||||||
@@ -294,10 +294,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tap-target" data-activates="google-cast-button">
|
|
||||||
<div class="tap-target-content">
|
|
||||||
<h5>Chromecast</h5>
|
|
||||||
<p>This site supports chromecasting!</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -165,3 +165,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tap-target" data-activates="google-cast-button">
|
||||||
|
<div class="tap-target-content">
|
||||||
|
<h5>Chromecast</h5>
|
||||||
|
<p>This site supports chromecasting!</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -54,6 +54,12 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="noselect">
|
<body class="noselect">
|
||||||
{{{body}}}
|
{{{body}}}
|
||||||
|
<div class="tap-target" data-activates="google-cast-button">
|
||||||
|
<div class="tap-target-content">
|
||||||
|
<h5>Chromecast</h5>
|
||||||
|
<p>This site supports chromecasting!</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div id="contact" class="modal">
|
<div id="contact" class="modal">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<h4>Contact</h4>
|
<h4>Contact</h4>
|
||||||
|
|||||||
Reference in New Issue
Block a user