mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 00:19:27 +00:00
Base: Add the current playback position to the video test page
This commit is contained in:
parent
3d9106b1b5
commit
59848086ba
|
@ -55,9 +55,13 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Current Time</td>
|
||||
<td id=time>0.00 seconds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Duration</td>
|
||||
<td id=duration>0 seconds</td>
|
||||
<td id=duration>0.00 seconds</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Play State</td>
|
||||
|
@ -79,8 +83,12 @@
|
|||
document.getElementById('selected').textContent = event.track.selected;
|
||||
};
|
||||
|
||||
video.addEventListener('timeupdate', () => {
|
||||
document.getElementById('time').textContent = `${video.currentTime.toFixed(2)} seconds`;
|
||||
});
|
||||
|
||||
video.addEventListener('durationchange', () => {
|
||||
document.getElementById('duration').textContent = `${video.duration} seconds`;
|
||||
document.getElementById('duration').textContent = `${video.duration.toFixed(2)} seconds`;
|
||||
});
|
||||
|
||||
video.addEventListener('loadedmetadata', () => {
|
||||
|
|
Loading…
Reference in a new issue