Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Adjusting the Start Time

Scott Miller edited this page Mar 17, 2016 · 2 revisions

Normally, when you load a video tag into a MediaPlayer object and start playback, the file begins playing from the beginning. You may want to override this default behavior. For example, you might want to resume where the customer left off or the customer might be tuning into a live stream. In order to support these and other scenarios, you need to be able to determine where to start playback on your media.

Changing the starting point for media can be performed by calling the seek method. However, you need to make sure that the video is loaded before you call the seek method. If you call the seek method too early, it will result in an exception. You want to wait for the canplay event to make sure that it is safe to change the current time.