mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Add extra handling for autoplay
This commit is contained in:
parent
6c19f0f242
commit
7a6d4e6ef9
1 changed files with 22 additions and 0 deletions
|
@ -275,6 +275,28 @@ function get_playlist() {
|
||||||
get_playlist();
|
get_playlist();
|
||||||
<% end %>
|
<% 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() {
|
function get_reddit_comments() {
|
||||||
comments = document.getElementById("comments");
|
comments = document.getElementById("comments");
|
||||||
var fallback = comments.innerHTML;
|
var fallback = comments.innerHTML;
|
||||||
|
|
Loading…
Reference in a new issue