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