From 6385971d3bdd43636dbbddae2524c6a6a72b3cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 18 Jan 2019 17:03:38 +0100 Subject: [PATCH] Adding switch for chromecast info being hidden or not (#463) --- server/public/assets/js/listeners.js | 13 ++++++++++++- .../partials/channel/client_settings.handlebars | 12 ++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/server/public/assets/js/listeners.js b/server/public/assets/js/listeners.js index a407bab3..1da96410 100755 --- a/server/public/assets/js/listeners.js +++ b/server/public/assets/js/listeners.js @@ -20,6 +20,7 @@ var sc_initialized = false; var intelligentQueue = []; var intelligentList = false; var deleted_elements = 0; +var chromecastInfoShow = true; var soundcloud_enabled = true; var local_new_channel = false; var sc_need_initialization = true; @@ -349,7 +350,8 @@ initializeCastApi = function() { mobile_beginning = false; //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(), source: videoSource, thumbnail: Player.np.thumbnail}) - castSession.sendMessage("urn:x-cast:zoff.me", {type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title, source: full_playlist[0].source, thumbnail: full_playlist[0].thumbnail}) + castSession.sendMessage("urn:x-cast:zoff.me", {type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title, source: full_playlist[0].source, thumbnail: full_playlist[0].thumbnail}); + castSession.sendMessage("urn:x-cast:zoff.me", {type: "chromecastInfoShow", value: chromecastInfoShow}); loadChromecastVideo(); if(window.location.hostname.indexOf("zoff.me") > -1 && !offline && window.location.hostname.indexOf("localhost") == -1) { socket.emit("get_id"); @@ -375,6 +377,7 @@ initializeCastApi = function() { if(window.location.hostname.indexOf("zoff.me") > -1 && !offline && window.location.hostname.indexOf("localhost") == -1) { socket.emit("get_id"); } + castSession.sendMessage("urn:x-cast:zoff.me", {type: "chromecastInfoShow", value: chromecastInfoShow}); loadChromecastVideo(); //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(), source: videoSource, thumbnail: Player.np.thumbnail}) castSession.sendMessage("urn:x-cast:zoff.me", {type: "nextVideo", videoId: full_playlist[0].id, title: full_playlist[0].title, source: full_playlist[0].source, thumbnail: full_playlist[0].thumbnail}) @@ -942,6 +945,14 @@ function addDynamicListeners() { } }); + addListener("change", '.chromecast_info_display_class', function() + { + chromecastInfoShow = document.getElementsByName("chromecast_info_display")[0].checked; + if(chromecastAvailable) { + castSession.sendMessage("urn:x-cast:zoff.me", {type: "chromecastInfoShow", value: chromecastInfoShow}); + } + }); + addListener("change", '.offline_switch_class', function() { offline = document.getElementsByName("offline_switch")[0].checked; diff --git a/server/public/partials/channel/client_settings.handlebars b/server/public/partials/channel/client_settings.handlebars index bfca6453..15760670 100644 --- a/server/public/partials/channel/client_settings.handlebars +++ b/server/public/partials/channel/client_settings.handlebars @@ -54,6 +54,18 @@ +
  • + + Cast info + +
    + +
    +
  • Color