-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting playback from middle of the video. #122
Comments
There is currently no 'nice' way to do this since the stream start time is deduced from the "stream limits" in StreamVideoSource. We could add a method on Player to set the desired playback start time, before the streams start we could just set the video's current time to this value so long as it is within the stream limits. |
Great, this would be a very useful addition. |
Based on this short discussion I opened pull request #123 with a possible change. |
Closed via 03703f1 |
Based on the addition of the new configure() method, setPlaybackStartTime should get removed and handled by this configure() method, no? |
EDIT: corrected formatting on code snippets which had previously eaten the top line of each We discussed this yesterday internally, and decided that settings in configure() will not automatically be cleared, but setPlaybackStartTime should be reset between playbacks. For example:
vs:
(Note that it isn't reset between playbacks now, but I planned to change that today.) If you disagree on any of this, please let me know. I would welcome your opinions on the matter. Do you feel like start time should be cleared between playbacks? Do you feel like setPlaybackStartTime should be replaced by a key in configure or should be independent? |
I ran into this today actually and I agree it should be reset between playbacks. Is the idea that configuration persists across playbacks so anything that shouldn't persist will not go in the configure() method? |
That was my rationale, yes, but I could be convinced otherwise if this doesn't fit with your use-case. |
No I think that makes things clearer. As a temp workaround I was just setting playbackStartTime to null if I wanted to wipe out the previous one and just get the default but intuitively I think you're right that setting the start time should be a one time thing. I think all your rationale makes sense so I'll just leave it for the moment. |
Okay, then I'll re-open this and close it when I've fixed the start time to clear automatically. |
Closes shaka-project#122 Change-Id: Ic36393df77c404bc958ab794af69b3cf0d5a8543
Is there an accepted way to begin playback not from the beginning of the video? For example let's say we want to bookmark a place in the video so we know that last time a user played they stopped playing at 30 seconds into the video. One way we could do this is add an event listener for 'loadedmetadata' and then set video.currentTime = 30. This works but there is a significant delay in starting playback when we do this vs letting it start from the beginning. It looks like it starts loading chunks from the beginning of the video regardless of where we set the time. Is there a way to dictate ahead of time that this is where we want to start, so just start getting junks from this point onward?
The text was updated successfully, but these errors were encountered: