summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-11-08 08:37:48 -0600
committerOmar Roth <omarroth@hotmail.com>2018-11-08 08:37:48 -0600
commit7a6d4e6ef9c2c834c61fa78e6c0a8d59d3ce18b4 (patch)
tree6db0700c677aa7f9365935e65e3709f9ca19e27a /src
parent6c19f0f2420fe6845250e971e9c8372165b2b5fb (diff)
downloadinvidious-7a6d4e6ef9c2c834c61fa78e6c0a8d59d3ce18b4.tar.gz
invidious-7a6d4e6ef9c2c834c61fa78e6c0a8d59d3ce18b4.tar.bz2
invidious-7a6d4e6ef9c2c834c61fa78e6c0a8d59d3ce18b4.zip
Add extra handling for autoplay
Diffstat (limited to 'src')
-rw-r--r--src/invidious/views/watch.ecr22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index b4247fd4..8b225ec6 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -275,6 +275,28 @@ function get_playlist() {
get_playlist();
<% end %>
+<% if params[:autoplay] %>
+var bpb = player.getChild('bigPlayButton');
+
+if (bpb) {
+ bpb.hide();
+
+ player.ready(function() {
+ var promise = player.play();
+
+ if (promise === undefined) {
+ bpb.show();
+ } else {
+ promise.then(function() {
+ bpb.show();
+ }, function() {
+ bpb.show();
+ });
+ }
+ });
+}
+<% end %>
+
function get_reddit_comments() {
comments = document.getElementById("comments");
var fallback = comments.innerHTML;