mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-11-04 06:31:57 +00:00 
			
		
		
		
	Add extra handling for autoplay
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user