Tryit<!DOCTYPE html><html><head><title>Wikitechy HTML onseeked Attribute</title></head><body><h1>Wikitechy HTML onseeked Attribute</h1><videoid =“wikiVideo”width="300"height="300"controlsonseeked ="onSeeked()"><sourcesrc="hibiscus.mp4"type="video/mp4"></video><script>
function onSeeked() {
document.getElementById("position").innerHTML = " Position has been
moved to " + document.getElementById("wikiVideo").currentTime;
}
</script><pid="position">The video moves to a new position :</p></body></html>
Code Explanation for onseeked Attribute in HTML:
<video> tag is used to display the video and it has id as “wikiVideo”.
The onseeked attribute used to call onSeeked() JavaScript function, when user try to seeking the video.
<source> tag defines the source of video resource.
onSeeked() JavaSript function used to display the position of the video seeked by its time in <p> tag which has id as “position”.
The <p> tag display the position of video seeking by JavaScript function.
Output for onseeked Attribute in HTML:
The video file has been displayed.
Here the output shows the playing video with its duration in seconds.
The seconds of video is displayed as Position has been moved to 12.00426.
Browser Support for onseeked Attribute in HTML:
Yes
Yes
Yes
Yes
Yes
Tips and Notes
The currentTime property of the Audio/Video Object is used to get the present playback position.