'How to load the video at a specific time? [duplicate]

Edit: I have reviewed the other posts with a similar question and those do not resolve this issue. The #-t open just gets passed as a GET variable to my proxy script.

The following is to load a video. The source of the video is a php script that checks to ensure user is logged in then outputs the video. This is to ensure that only people logged in can download the video. How do I specify a time to start the video position at?

<video id="test" width="640" height="360" controlsList="nodownload" controls>
  <source src="vidRedir.php?v=video" type="video/mp4">
Your browser does not support the video tag.
</video>


Solution 1:[1]

Append #t=<time in seconds> to the URL. For example, setting src to vidRedir.php?v=video#t=30 will start the video at 30 seconds.

See this MDN article.

Solution 2:[2]

const video = document.querySelector('video');
video.currentTime = <Your time here>

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Caleb Denio
Solution 2 Mytch