Created
October 4, 2017 12:39
-
-
Save eirslett/9e4da60e418ef490c94f3ba14cc4e7cd to your computer and use it in GitHub Desktop.
Webkit bug report
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Video bug report</title> | |
</head> | |
<body> | |
<script> | |
const video = document.createElement('video') | |
video.src = 'http://techslides.com/demos/sample-videos/small.mp4' | |
video.addEventListener('error', ev => console.log('Expected event (video playback error)', ev)) | |
// This is the unexpected event that is triggered, even when playback is denied | |
video.addEventListener('playing', ev => { | |
console.error('Unexpected event: video is playing.', ev) | |
}) | |
// Trigger play(), but not as a result of a user action - will be denied. | |
video.play() | |
.then(() => console.error('Unexpected state: video playing (Please disallow video autoplay in the browser, to reproduce the bug report)')) | |
.catch(err => console.log('Expected error (video playback failed)', err)) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment