From 59848086baf391eb675d4f901e164d721ecb1b88 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 10 Apr 2023 10:14:32 -0400 Subject: [PATCH] Base: Add the current playback position to the video test page --- Base/res/html/misc/video-webm.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Base/res/html/misc/video-webm.html b/Base/res/html/misc/video-webm.html index c9706e304d..c61604f403 100644 --- a/Base/res/html/misc/video-webm.html +++ b/Base/res/html/misc/video-webm.html @@ -55,9 +55,13 @@ + + Current Time + 0.00 seconds + Duration - 0 seconds + 0.00 seconds Play State @@ -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', () => {