diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-05-12 15:08:24 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-13 15:51:44 +0200 |
commit | 2b269cf425a22e4314374fe28bfcc15e81f4be5a (patch) | |
tree | 60bb5cf4d65da521539693d640523a197136f0c6 | |
parent | 05019746d2c09dd76b0925ca74b2f507959f515d (diff) | |
download | serenity-2b269cf425a22e4314374fe28bfcc15e81f4be5a.zip |
Base: Add a test page to load a video element with <source> children
This verifies we cycle through the source children until we land on one
with a video we can play.
-rw-r--r-- | Base/res/html/misc/video-source-children.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Base/res/html/misc/video-source-children.html b/Base/res/html/misc/video-source-children.html new file mode 100644 index 0000000000..098d45a83f --- /dev/null +++ b/Base/res/html/misc/video-source-children.html @@ -0,0 +1,59 @@ +<html> +<head> +<style type="text/css"> + video { + border: 1px solid #333; + } + + table, td { + border: 1px solid #333; + border-collapse: collapse; + } + + thead, tfoot { + background-color: #333333; + color: #ffffff; + } +</style> +</head> +<body> + <table> + <thead> + <tr> + <th colspan="2">Metadata</th> + </tr> + </thead> + <tbody> + <tr> + <td>Current Source</td> + <td id=src>null</td> + </tr> + <tr> + <td>Is Selected</td> + <td id=selected>false</td> + </tr> + </tbody> + </table> + + <br /> + + <video id=video controls> + <source> + <source src=""> + <source src="Yo I don't exist!"> + <source src="../../../home/anon/Videos/test-webm.webm"> + </video> + + <script type="text/javascript"> + let video = document.getElementById('video'); + + video.videoTracks.onaddtrack = (event) => { + document.getElementById('selected').textContent = event.track.selected; + }; + + video.addEventListener('loadedmetadata', () => { + document.getElementById('src').textContent = video.currentSrc; + }); + </script> +</body> +</html> |