-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Allow the app to override the start position when playback transitions to another source #2403
Comments
Wrapping the second source in a ClippingMediaSource should work for this. See #1988 for more info. |
I still want to be able to seek back to a previous position in the second
source. The initial position is just where the user left off last time.
…On Wed, Feb 1, 2017, 4:11 AM Andrew Lewis ***@***.***> wrote:
Wrapping the second source in a ClippingMediaSource should work for this.
See #1988 <#1988> for more info.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2403 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAZ-dEUSYE5zgreybhyI_dSWMUtJd--Nks5rYEw3gaJpZM4LzCyQ>
.
|
We have a way to do this with Timeline.getDefaultPositionUs but it's not convenient to use at the moment unless you have a custom MediaSource where you can update the Timeline when the desired start position changes. I'll mark this as an enhancement to track providing an easy way for apps to set the start position, perhaps via ExtractorMediaSource or ConcatenatingMediaSource. |
Thank you. For now I've just separated out the sources from the ConcatenatingMediaSource. |
You can do this fairly easily by wrapping your second source in a class similar to the one below. So you'd have:
Class:
It's unclear to me whether this feature is really important enough to make it into the library proper. What's the use case? Do you think other people are likely to need it? |
@ojw28 the solution posted above works great. The use case was pretty specific I'm not sure how many other people might need this in the library itself. Basically, we were displaying a preroll video (not an ad) every time a user started content. This pre-roll was followed by the content they may or may not had already started watching. We wanted them to be able to seek back from the initial start position without seeing the pre-roll again. Closing since the solution above works for our case. |
Hi @ojw28 |
@noamtamim For the first case, can you just seek before preparing the player? |
@andrewlewis what is the impact of seeking player instance to some position if no mediaSource was set? |
Provided you set |
The obvious caveat of seeking before prepare is that you need to know that where you're seeking to is actually going to be valid in the source you're going to |
Thanks @ojw28 and @andrewlewis, I didn't even know it's possible to seek before prepare. |
@ojw28 10x |
What was removed? The demo app is still there. It's just moved: |
let me recheck might be studio issue, it was not shown when I switched to it I could see now in git that it is called demos now |
@ojw28 |
include modulePrefix + 'demo' |
@ojw28 it appeared |
Sounds like a bug you should report to Android Studio (by the way, once you've made it appear, you can almost certainly revert your change again and have it remain visible). |
@ojw28 , @andrewlewis
|
It's the app's responsibility to save and restore positions, if it wishes to do so. |
@ojw28 |
I don't understand what that means, but please just look at what the demo app does, since it clearly demonstrates this feature. Thanks. |
@giladna You can omit the resume window and just do |
Thanks :) |
I have two sources in a concatenating source and would like to seek to a specific position once the first source has finished playing. Should I make use of onTracksChanged()? or is there a better solution?
The text was updated successfully, but these errors were encountered: