-
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
Add or remove playlist items (MediaSources) #1706
Comments
It's pretty easy to implement the first request yourself (create a class a bit like Please file a separate enhancement request for the other request; the two aren't related. |
do you finish to make this function? |
Hi, I'm trying to implement a DynamicConcatenatingMediaSource class close to ConcatenatingMediaSource, except for the Lists management instead of arrays for mediasources, timelines and manifests and adding the following addSource method:
I receive the following exception when I seek to the last-1 track (before the one I added): What am I missing? Thank you! |
I eventually found the problem (yeah!). To add new sources in my DynamicConcatenatingMediaSources:
|
Now I'm stuck on the remove issue... any help?
obviously does not update all the lists and Periods references but I'm losing into the code and not able to figure out what is to be done. |
I had this working but since I moved to version r2.0.4 it only plays first video and the appended ones causes player to be in idle or end state. The only change I needed to do was refactoring the override method createPeriod from Since this change all stopped working. Any idea what can cause the issue? Anyone can give me a light what callback does? |
Hello, any updates on this issue? If not, is there any reference on how to implement the remove part? Thanks |
@marwanf1 take a look at issue #2097 and see if the AppendingMediaSource.java class can help you. In addition, to make this work for me I had to make the changes commented on 28 Nov 2016 (referred thread) |
AppendingMediaSource.java is very helpfull, but exist one problem: in method appendSource you use method removeFirstMediaSource() if count of MediaSources bigger then 2. With this method nothing work. I tried to increase the max size of lists (up to 10) and items had been adding (during playing) successfully. But when i added 11-th item, it not played. When i removed method removeFirstMediaSource(), i can adding as much MediaSources as i want, but i care about StackOverFlow or something also. Can you help me with this? |
Hi. Sorry no referring that, but I quit using the |
Okay, i understand, thank you |
@ascmartins Did you ever make a MediaSource that can also remove items? @ojw28 In issue #2097, you suggested exposing a |
Hello @AOrobator ! |
@calulelalu , @tonihei , did you manage to get a MediaSource where items can be removed/swaped without releasing the player? |
Hi, unfortunately not, I had to manage the playlist by myself externally from exoplayer. |
@b0g8, We are going to work on this topic soon to provide a build-in solution for a media source which supports adding/removing. Subscribe to this thread and you'll get informed as soon as we are ready :) |
(Preparation for GitHub issue #1706) AbstractConcatenatedTimeline repeatly calls methods of its implementation to query a specific child timeline. This may be inefficient if the implementation repeatly executes the same code to find the timeline. Changed the class such that it now queries all information at once using a meta data class. As all methods need at least two of four variables anyway, this doesn't generate unnecessary overhead. Also generified the UID for the child indices to allow new implementations to use some other UID besides the index. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158711979
@tonihei, is this on hold? |
No, still working on it. It is currently undergoing internal reviews. |
@tonihei any approximate ETA on this. not a specific date, but in terms of time frame: day(s), week(s), month(s)? |
@oikmar Days, most likely. |
@tonihei When this is implemented, will gapless playback be supported? |
@AOrobator Gapless playback is already supported when you use ConcatenatingMediaSource. |
@tonihei I understand that ConcatenatingMediaSource supports gapless playback. I would assume that when this PlaylistMediaSource gets implemented it would also support gapless playback by extension, but I just wanted to clarify instead of assuming. |
We finished working on the DynamicConcatenatingMediaSource by now. You'll find it in the dev branch. It works exactly the same as the ConcatenatingMediaSource but also offers methods to add, remove, and access media sources during playback. |
That is great news! Thank you!
…On Tue, Jul 4, 2017, 2:04 PM tonihei ***@***.***> wrote:
We finished working on the DynamicConcatenatingMediaSource
<https://github.com/google/ExoPlayer/blob/dev-v2/library/core/src/main/java/com/google/android/exoplayer2/source/DynamicConcatenatingMediaSource.java>
by now. You'll find it in the dev branch. It works exactly the same as the
ConcatenatingMediaSource but also offers methods to add, remove, and access
media sources during playback.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1706 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsiywGFA_XfUaM6ezGQ5EAd22C-V-z8ks5sKipCgaJpZM4JZHMi>
.
|
Hi, do you provide some snapshot builds of dev branch or do I have to checkout sources / wait for stable release? |
Yes, you're right. Until we merge this change into our release branch, you would either need to check out the sources or wait for the release. |
@ursusursus I've built an aar off the develop branch that I've been playing around with that has compile(name: "library-core-release", ext: "aar") |
This option allows to move the currently playing media source to another position and also to move other media source without creating a new MediaSource object. Issue:#1706 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=161402022
Hello @tonihei, Do you know when the DynamicConcatenatingMediaSource class will be merged on master ? And when will it be available on Gradle ? Thank you very much for your work ! |
Probably a couple of weeks. It'll be available in the 2.5 release. Thanks. |
Hello @AOrobator ! Thank you for your .aar file. Do you know how I could get it ? |
@mirandole try a clean build? Make sure you're spelling it correctly? It's in the aar and I'm using it in a project of mine, so I know it works |
@AOrobator I've extrat .aar and add the classes .jar file to my build.gradle app with this line :
Now everything works well. Thank you |
Hello @tonihei @ojw28 @AOrobator ! My app crash when I prepare Exoplayer with a Source Code :
Log
|
That looks like an issue with the way you're building and including the code. If you want to depend on the |
Thank you that solved my problem. |
Hello @ojw28 DynamicConcatenatingMediaSource works well to play several tracks with gapless. It seems that I can't use playbackstate listener because STATE_ENDED with DynamicConcatenatingMediaSource until i've played all the playlist tracks. How can I know if the current track is completed and the next one started to always get current track playing metadatas on my front activity screen ? Thank you very much. |
@mirandole onPositionDiscontinuity (from memory) is the callback you want |
Thanks @ursusursus but it could be a seekTo discontinuity, right ? Could discontinuity come from other things that a track change ? Because I can only verify if discontinuity comes from a seek, I can't verify for other event that produce onPositionDiscontinuity. I don't know them. |
To detect advancing from window (playlist item) to the next, handle Several things can cause a discontinuity: (1) advancing from one window (playlist item) to the next, (2) advancing from one period to the next (which is different from (1) for multi-period windows), (3) seeking and (4) source-initiated discontinuities (for example, when the source retries loading due to an error, but has to move the playback position). |
@mirandole I've been using onTracksChanged() with success as it's a bit more specific to our use case. You just have to keep track of how many tracks have played because the first time it's called, it's with the first track. @andrewlewis @ojw28 curious to get your thoughts on my approach |
We recommend to use |
Thank you @AOrobator @tonihei . Unfortunately, it seems that Did someone succeed in playing mp3 or FLAC tracks album gapless? |
I'm also confirming that I hear a small gap between tracks when using DynamicConcatenatingMediaSource. I guess it's probably best to create another issue, then link it here. @mirandole |
Yes, please create a new issue with steps to reproduce your problem. Thanks! |
It looks like ExoPlayer.getDuration() doesn't work with DynamicConcatenatingMediaSource, even after calling prepare(). Is there a way to get a queued MediaSource's duration (and seek to a position) before setPlayWhenReady(true) is called? |
Please create a new issue using the issue template if you think something is wrong. Thank you! |
I don't necessarily think there is anything wrong. It might just be my own lack of understanding how DeferredTimeline is expected to work. I'll file a bug just in case. |
I use exoplayer dev-v2, I need function to add or remove playlist items (media sources) without release player or initialize player.
Can you make this function?
thanks!
The text was updated successfully, but these errors were encountered: