From 911558760f5e208720b84e0a5f1c558ba5095956 Mon Sep 17 00:00:00 2001 From: Xaekai Date: Mon, 31 Jan 2022 17:02:10 -0800 Subject: [PATCH] Remove all references to wmode Usage of wmode was specific to Flash, which is long dead. --- docs/user-settings.md | 1 - player/dailymotion.coffee | 1 - player/peertube.coffee | 3 --- player/vimeo.coffee | 7 +------ player/youtube.coffee | 2 -- templates/useroptions.pug | 5 ----- www/js/callbacks.js | 2 ++ www/js/data.js | 1 - www/js/ui.js | 2 +- www/js/util.js | 2 -- 10 files changed, 4 insertions(+), 22 deletions(-) diff --git a/docs/user-settings.md b/docs/user-settings.md index 43512aea..60813286 100644 --- a/docs/user-settings.md +++ b/docs/user-settings.md @@ -21,7 +21,6 @@ Setting | Description --------|------------ Synchronize video playback | By default, CyTube attempts to synchronize the video so that everyone is watching at the same time. Some users with poor internet connections may wish to disable this in order to prevent excessive buffering due to constantly seeking forward. Synch threshold | The number of seconds your video is allowed to be ahead/behind before it is forcibly seeked to the correct position. Should be set to at least 2 seconds to avoid buffering problems and choppy playback. -Set wmode=transparent | There's probably no reason to touch this unless you know what you're doing. Having a non-transparent wmode can cause modals to display behind the video player, but also can cause performance issues in some situations. Remove the video player | Automatically remove the video player on page load. Equivalent to manually clicking Layout->Remove Video every time you load a channel. Hide playlist buttons by default | Hides the control buttons from each video in the playlist, so that only the title is displayed. The control buttons can be shown by right clicking the video item in the playlist. Old style playlist buttons | Legacy feature introduced in CyTube 2.0 for those who preferred the old 1.0-style video control buttons. diff --git a/player/dailymotion.coffee b/player/dailymotion.coffee index 2d8e3b21..8415ce02 100644 --- a/player/dailymotion.coffee +++ b/player/dailymotion.coffee @@ -12,7 +12,6 @@ window.DailymotionPlayer = class DailymotionPlayer extends Player params = autoplay: 1 - wmode: if USEROPTS.wmode_transparent then 'transparent' else 'opaque' logo: 0 quality = @mapQuality(USEROPTS.default_quality) diff --git a/player/peertube.coffee b/player/peertube.coffee index bbd96601..b8a07a36 100644 --- a/player/peertube.coffee +++ b/player/peertube.coffee @@ -51,9 +51,6 @@ window.PeerPlayer = class PeerPlayer extends Player allow: 'autoplay; fullscreen' ) - if USEROPTS.wmode_transparent - video.attr('wmode', 'transparent') - @peertube = new PeerTubePlayer(video[0]) @peertube.addEventListener('playbackStatusChange', (status) => diff --git a/player/vimeo.coffee b/player/vimeo.coffee index b59726c1..e0da747b 100644 --- a/player/vimeo.coffee +++ b/player/vimeo.coffee @@ -13,14 +13,9 @@ window.VimeoPlayer = class VimeoPlayer extends Player removeOld(video) video.attr( src: "https://player.vimeo.com/video/#{data.id}" - webkitallowfullscreen: true - mozallowfullscreen: true - allowfullscreen: true + allow: 'autoplay; fullscreen' ) - if USEROPTS.wmode_transparent - video.attr('wmode', 'transparent') - @vimeo = new Vimeo.Player(video[0]) @vimeo.on('ended', => diff --git a/player/youtube.coffee b/player/youtube.coffee index fb3bc3b5..9632772d 100644 --- a/player/youtube.coffee +++ b/player/youtube.coffee @@ -12,7 +12,6 @@ window.YouTubePlayer = class YouTubePlayer extends Player waitUntilDefined(YT, 'Player', => removeOld() - wmode = if USEROPTS.wmode_transparent then 'transparent' else 'opaque' @yt = new YT.Player('ytapiplayer', videoId: data.id playerVars: @@ -21,7 +20,6 @@ window.YouTubePlayer = class YouTubePlayer extends Player controls: 1 iv_load_policy: 3 # iv_load_policy 3 indicates no annotations rel: 0 - wmode: wmode events: onReady: @onReady.bind(this) onStateChange: @onStateChange.bind(this) diff --git a/templates/useroptions.pug b/templates/useroptions.pug index 8c2faf8e..68f04bf3 100644 --- a/templates/useroptions.pug +++ b/templates/useroptions.pug @@ -68,11 +68,6 @@ mixin us-playback form.form-horizontal(action="javascript:void(0)") +rcheckbox("us-synch", "Synchronize video playback") +textbox("us-synch-accuracy", "Synch threshold (seconds)", "2") - +rcheckbox("us-wmode-transparent", "Set wmode=transparent") - .form-group - .col-sm-4 - .col-sm-8 - p.text-info Setting wmode=transparent allows objects to be displayed above the video player, but may cause performance issues on some systems. +rcheckbox("us-hidevideo", "Remove the video player") +rcheckbox("us-playlistbuttons", "Hide playlist buttons by default") +rcheckbox("us-oldbtns", "Old style playlist buttons") diff --git a/www/js/callbacks.js b/www/js/callbacks.js index d66e8695..43a86929 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -1168,6 +1168,8 @@ const Callbacks = { } }; +window.Callbacks = Callbacks; + var SOCKET_DEBUG = { enabled: (localStorage.getItem('cytube_socket_debug') === 'true'), omit: (((data)=>{ diff --git a/www/js/data.js b/www/js/data.js index eddfe26a..dac3e96c 100644 --- a/www/js/data.js +++ b/www/js/data.js @@ -122,7 +122,6 @@ var USEROPTS = { synch : getOrDefault("synch", true), sync_accuracy : getOrDefault("sync_accuracy", 2), hidevid : getOrDefault("hidevid", false), - wmode_transparent : getOrDefault("wmode_transparent", true), default_quality : getOrDefault("default_quality", "auto"), qbtn_hide : getOrDefault("qbtn_hide", false), qbtn_idontlikechange : getOrDefault("qbtn_idontlikechange", false), diff --git a/www/js/ui.js b/www/js/ui.js index 68d233d8..41abb06b 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -917,7 +917,7 @@ function handleCSSJSTooLarge(selector) { this.parentNode.insertBefore(notice[0], this); } else { let notice = document.querySelector(selector); - notice.remove(); + notice?.remove(); } } diff --git a/www/js/util.js b/www/js/util.js index bdc3bfbf..ffee5957 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -649,7 +649,6 @@ function showUserOptions() { $("#us-synch").prop("checked", USEROPTS.synch); $("#us-synch-accuracy").val(USEROPTS.sync_accuracy); - $("#us-wmode-transparent").prop("checked", USEROPTS.wmode_transparent); $("#us-hidevideo").prop("checked", USEROPTS.hidevid); $("#us-playlistbuttons").prop("checked", USEROPTS.qbtn_hide); $("#us-oldbtns").prop("checked", USEROPTS.qbtn_idontlikechange); @@ -687,7 +686,6 @@ function saveUserOptions() { USEROPTS.synch = $("#us-synch").prop("checked"); USEROPTS.sync_accuracy = parseFloat($("#us-synch-accuracy").val()) || 2; - USEROPTS.wmode_transparent = $("#us-wmode-transparent").prop("checked"); USEROPTS.hidevid = $("#us-hidevideo").prop("checked"); USEROPTS.qbtn_hide = $("#us-playlistbuttons").prop("checked"); USEROPTS.qbtn_idontlikechange = $("#us-oldbtns").prop("checked");