matthoffner commited on
Commit
14bc85b
1 Parent(s): d96076f

Add play button for devices with autoplay restrictions

Browse files
Files changed (1) hide show
  1. public/index.html +8 -0
public/index.html CHANGED
@@ -45,6 +45,14 @@
45
  }, 1200)
46
  }, false);
47
 
 
 
 
 
 
 
 
 
48
  player.play()
49
  }
50
  })()
 
45
  }, 1200)
46
  }, false);
47
 
48
+ // Handle autoplay restrictions.
49
+ var promise = videoElement.play();
50
+ if (promise !== undefined) {
51
+ videoElement.addEventListener('click', function() {
52
+ videoElement.play();
53
+ });
54
+ }
55
+
56
  player.play()
57
  }
58
  })()