mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
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.
This commit is contained in:
parent
05019746d2
commit
2b269cf425
Notes:
sideshowbarker
2024-07-17 07:43:05 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/2b269cf425 Pull-request: https://github.com/SerenityOS/serenity/pull/18786 Reviewed-by: https://github.com/awesomekling
1 changed files with 59 additions and 0 deletions
59
Base/res/html/misc/video-source-children.html
Normal file
59
Base/res/html/misc/video-source-children.html
Normal file
|
@ -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>
|
Loading…
Reference in a new issue