Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var promise = document.querySelector('video').play();
- if (promise !== undefined) {
- promise.then(_ => {
- // Autoplay started!
- }).catch(error => {
- // Autoplay was prevented.
- // Show a "Play" button so that user can start playback.
- });
- }
Add Comment
Please, Sign In to add comment