diff options
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/css/default.css | 25 | ||||
| -rw-r--r-- | assets/css/embed.css | 16 | ||||
| -rw-r--r-- | assets/js/player.js | 17 |
3 files changed, 58 insertions, 0 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 17264532..07a879bb 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -490,3 +490,28 @@ See https://stackoverflow.com/a/34372979 for more info */ hr { margin: auto 0 auto 0; } + +/* Description Expansion Styling*/ +#description-box { + display: flex; + flex-direction: column; +} + +#descexpansionbutton { + display: none +} + +#descexpansionbutton ~ div { + overflow: hidden; + height: 8.3em; +} + +#descexpansionbutton:checked ~ div { + overflow: unset; + height: 100%; +} + +#descexpansionbutton + label { + order: 1; + margin-top: 20px; +} diff --git a/assets/css/embed.css b/assets/css/embed.css index 12fefe58..466a284a 100644 --- a/assets/css/embed.css +++ b/assets/css/embed.css @@ -8,3 +8,19 @@ height: auto; z-index: -100; } + +.watch-on-invidious { + font-size: 1.3em !important; + font-weight: bold; + white-space: nowrap; + margin: 0 1em 0 1em !important; + order: 3; +} + +.watch-on-invidious > a { + color: white; +} + +.watch-on-invidious > a:hover { + color: rgba(0, 182, 240, 1);; +} diff --git a/assets/js/player.js b/assets/js/player.js index 68fc805b..a6d0c8c1 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -616,3 +616,20 @@ if (navigator.vendor == "Apple Computer, Inc." && video_data.params.listen) { }); }); } + +// Watch on Invidious link +if (window.location.pathname.startsWith("/embed/")) { + const Button = videojs.getComponent('Button'); + let watch_on_invidious_button = new Button(player); + + // Create hyperlink for current instance + redirect_element = document.createElement("a"); + redirect_element.setAttribute("href", `http://${window.location.host}/watch?v=${window.location.pathname.replace("/embed/","")}`) + redirect_element.appendChild(document.createTextNode("Invidious")) + + watch_on_invidious_button.el().appendChild(redirect_element) + watch_on_invidious_button.addClass("watch-on-invidious") + + cb = player.getChild('ControlBar') + cb.addChild(watch_on_invidious_button) +}; |
