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

Ability to play sections of a video (eg: 0:10s - 0:30s) #1988

Closed
satyan opened this issue Oct 24, 2016 · 6 comments
Closed

Ability to play sections of a video (eg: 0:10s - 0:30s) #1988

satyan opened this issue Oct 24, 2016 · 6 comments
Assignees

Comments

@satyan
Copy link

satyan commented Oct 24, 2016

I'm looking at version 2.x of the API and trying to figure out if I could play sections of a video. eg: play only certain sections in a 1 minute video (eg: 10s- 30s then 40-50s).

Could use seek, but each section would start buffering initially.. and playback doesn't seem smooth.

I tried using the ConcatenatingMediaSource, (providing the same media multiple times, with different timeline). Though, couldn't figure out how to set the start and end time with the Timeline API.

Any suggestions would be helpful. Thanks.

@satyan
Copy link
Author

satyan commented Dec 6, 2016

Thanks @andrewlewis for picking it up.. Any quick suggestions on how we could implement it currently? Seeking manually is an option, though not the best.

ojw28 pushed a commit that referenced this issue Dec 14, 2016
ClippingMediaSource wraps a single period/window video-on-demand source and
exposes a specified time range within it.

Issue: #1988

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141991215
@andrewlewis
Copy link
Collaborator

@satyan Sorry for not replying sooner. Please try out ClippingMediaSource and let us know if this does what you need. You can compose ClippingMediaSources in a ConcatenatingMediaSource or LoopingMediaSource as required.

An important caveat is that when playback transitions into a ClippingMediaSource the player needs to do a frame-exact seek operation. To avoid buffering you therefore need to ensure that the clipping start point corresponds to a synchronization sample/key-frame. (Playback should work even if you don't do this, but transitions from one source to the next will not be seamless.)

@rafiip
Copy link

rafiip commented Dec 16, 2016

@andrewlewis ClippingMediaSource was removed from 2.1.0 release . should we import it manually ?
ps:
i used this method inside LoopingMediaSource but playback is not seamless

@jmgirven
Copy link

ClippingMediaSource is currently in the dev-v2 branch, so presumably will be available in future releases.

@satyan
Copy link
Author

satyan commented Jan 18, 2017

Thanks for including this quickly.. It worked beautifully for my case.

@ojw28
Copy link
Contributor

ojw28 commented Jan 31, 2017

It will be available in 2.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants