-
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
Accessing active datasource in onPositionDiscontinuity #7525
Comments
Why don't you assign a specific So when the media source calls |
Isn't that highly inefficient to create a DefaultDataSourceFactory and my factory for every single items for very large playlists? |
Not sure about your exact use case, but you can also consider one of the following:
|
@tonihei Ok so let me try to better explain the need that is. The player can play media from many different sources and some of them can transcode the media on the fly. But I need to know this at the player / UI side to either disable the seek functions or intercept the seek to be actual restart of the media at the proper new starting point. The problem is that with gapless / ConcateningMediaSource the And from So TL;DR I need to access the MediaSource/MediaItem from the |
Aside: If you make the |
Thanks that's what I do, but the new playlist api is all about MediaItem directly no? Or I can use MediaSources directly and still use the new playlist api instead of concateningmediasource? |
Yes, you can. The |
Ok thanks, closing this one too as there's no other way and factory are small :) |
[REQUIRED] Searched documentation and issues
I did :)
[REQUIRED] Question
I'm having an hard time to get the active datasource when the media change in a
ConcatenatingMediaSource
.I use a specific
DataSourceFactory
that extendsHttpDataSource.BaseFactory
and prepare the media in theopen(dataSpec)
.During this preparation the media can be transcoded or not and depending on many factor the resulting may support some things like seeking or not.
I need to be able to access this information to do things like not calling normal seek but restart the transcoding at the new position.
The problem is that in
ConcatenatingMediaSource
open
can be called to prepare the next media while the active media is still not closed.So the question is how can I access the datasource from the player
onPositionDiscontinuity
callback. Or how can I access theMediaSource
from theDataSource
to be able to modify the tag?The text was updated successfully, but these errors were encountered: