aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js
diff options
context:
space:
mode:
authorAstound <kirito@disroot.org>2025-03-04 11:06:04 +0800
committerAstound <kirito@disroot.org>2025-03-04 11:06:04 +0800
commita7993781648fefb51444e208d92e7efb7f3ab783 (patch)
tree742f61d28c8d587ae69cdbcee8ffa91422a4fe76 /youtube/static/js
parentf64b36260381fe46b739a9821d3e850e82e5848b (diff)
downloadyt-local-a7993781648fefb51444e208d92e7efb7f3ab783.tar.lz
yt-local-a7993781648fefb51444e208d92e7efb7f3ab783.tar.xz
yt-local-a7993781648fefb51444e208d92e7efb7f3ab783.zip
Renew plyr UI and simplify elements
Diffstat (limited to 'youtube/static/js')
-rw-r--r--youtube/static/js/plyr-start.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/youtube/static/js/plyr-start.js b/youtube/static/js/plyr-start.js
index 3838acc..4188829 100644
--- a/youtube/static/js/plyr-start.js
+++ b/youtube/static/js/plyr-start.js
@@ -133,4 +133,23 @@
// Needed so controls won't be hidden before playback has started
player.started = false;
player.once('playing', function(){this.started = true});
+
+ // Custom styles for plyr similar to shaka-player
+ const playerUI = document.querySelector(".plyr");
+ if (playerUI) {
+ playerUI.classList.add("plyr--minimal");
+ const controls = document.querySelector(".plyr__controls");
+ const progressContainer = document.querySelector(".plyr__progress__container");
+ const topControls = document.createElement("div");
+ topControls.classList.add("plyr__controls__top");
+ document.querySelectorAll(".plyr__controls__item").forEach((item) => {
+ if (!item.classList.contains("plyr__progress__container")) {
+ topControls.appendChild(item);
+ }
+ });
+ // Insert new structure to player
+ controls.prepend(topControls);
+ controls.appendChild(progressContainer);
+ }
+ // End of custom styles
})();