Skip to content
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

Closed
sanbornhilland opened this issue Jul 10, 2015 · 10 comments
Closed

Starting playback from middle of the video. #122

sanbornhilland opened this issue Jul 10, 2015 · 10 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@sanbornhilland
Copy link
Contributor

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?

@tdrews
Copy link
Contributor

tdrews commented Jul 10, 2015

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.

@tdrews tdrews added this to the v1.5.0 milestone Jul 10, 2015
@joeyparrish joeyparrish added the type: enhancement New feature or request label Jul 10, 2015
@sanbornhilland
Copy link
Contributor Author

Great, this would be a very useful addition.

@sanbornhilland
Copy link
Contributor Author

Based on this short discussion I opened pull request #123 with a possible change.

@tdrews
Copy link
Contributor

tdrews commented Jul 13, 2015

Closed via 03703f1

@tdrews tdrews closed this as completed Jul 13, 2015
@sanbornhilland
Copy link
Contributor Author

Based on the addition of the new configure() method, setPlaybackStartTime should get removed and handled by this configure() method, no?

@joeyparrish
Copy link
Member

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:

player.setPlaybackStartTime(10);
player.load(source1);  // starts at 10s
// ... later ...
player.load(source2);  // starts at 0s

vs:

player.setPlaybackStartTime(10);
player.load(source1);  // starts at 10s
// ... later ...
player.setPlaybackStartTime(30);
player.load(source2);  // starts at 30s

(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?

@sanbornhilland
Copy link
Contributor Author

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?

@joeyparrish
Copy link
Member

That was my rationale, yes, but I could be convinced otherwise if this doesn't fit with your use-case.

@sanbornhilland
Copy link
Contributor Author

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.

@joeyparrish
Copy link
Member

Okay, then I'll re-open this and close it when I've fixed the start time to clear automatically.

@joeyparrish joeyparrish reopened this Jul 14, 2015
@joeyparrish joeyparrish self-assigned this Jul 14, 2015
jonoward pushed a commit to blinkbox/shaka-player that referenced this issue Sep 16, 2015
Closes shaka-project#122

Change-Id: Ic36393df77c404bc958ab794af69b3cf0d5a8543
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants