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