You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Extracting a seperate method moveMediaSourceHolders was done to align with insert/remove code. A new default method instead of just implementing that in DefaultShuffleOrder was done because I believe the move detection is not required by simpler shuffle order implementations, and this makes upgrades easier as devs don't have to implement a new function.)
I'm going to send this for internal review now. You may see some more commits being added as I make changes in response to review feedback. Please refrain from pushing any more substantive changes as it will complicate the internal review - thanks!
Ok, I think I've wrapped my head around what this does. Sorry for the wait and for me being slow.
Currently, when items in the playlist are moved, the shuffle order is kept the same. With your change ExoPlayerImpl calls cloneAndMove(). This makes sense to me as this is consistent with what we do.
but a seperate "move" API is needed for my usecase.
Yeah, acknowledged adding cloneAndMove and calling this in ExoPlayerImpl makes sense to enable re-shuffling upon such an operation.
that shuffle order may decide to not reshuffle in the individual items when a group of items is moved.
I agree with this, but my conclusion would be that the default implementation is a no-op? This would have the advantage that we do not introduce a behavior change to what ExoPlayer is currently doing when a move is performed.
This would still be useful for your use case as I understand you have your own implementation of ShuffleOrder and you can then implement cloneAndMove() to actually re-shuffle.
I guess I'm going to change that accordingly unless you have some strong argument to inverse that procedure.
Add cloneAndMove() to ShuffleOrder. Make the default implementation a no-op
Call the method in ExoPlayerImpl so a custom implementation can re-shuffle in case that's desired.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #1932
Issue: #1381
--
(Extracting a seperate method
moveMediaSourceHolders
was done to align with insert/remove code. A newdefault
method instead of just implementing that inDefaultShuffleOrder
was done because I believe the move detection is not required by simpler shuffle order implementations, and this makes upgrades easier as devs don't have to implement a new function.)