ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Allow end user to trim media in playlist

Open b0g8 opened this issue 8 years ago • 10 comments

Issue description

I have a requirement where the user should be able to trim the media in a playlist. I first investigated ClippingMediaSource, but from my understanding, this does not read from source beyond the clipping limits. The user should be able to set trim in/out within full media duration during playback.

Basically I need a ClippingMediaPeriod, where the start / end of playback are as in current implementation, but it is possible to seek beyond them, while the user adjusts clipping.

I noticed recently that MediaPeriodInfoSequence already holds the type of data (start, end, duration) that I want the player to consider when playing a certain media. MediaPeriodInfoSequence was done targeting ad playback. I do not understand all the implications of using MediaPeriodInfoSequence. Could you advise me if it is possible to alter startPositionUs and endPositionUs so that it allows for trimming adjustment during playback?

I see that MediaPeriodHolder uses a ClippingMediaPeriod for the situation when endPositionUs is not TIME_END_OF_SOURCE. Should it work if I modify its limits when user drags a slider? (like update clipping limits, then seek to end position and display the frame)

Thanks

b0g8 avatar Aug 11 '17 11:08 b0g8

@tonihei You mentioned this feature should be part of v2.10 at https://github.com/google/ExoPlayer/issues/5538#issuecomment-467405790 but I can't find any related features on it.

Does it belong to current version or not?

devdivr avatar Sep 09 '20 15:09 devdivr

That was too optimistic unfortunately :( The feature is mostly implemented (since 2.10) except for one detail that could prevent the player from loading new data in a playlist. Because of this, we haven't added the final API bit that would let you set the clipping points.

tonihei avatar Sep 09 '20 16:09 tonihei

@tonihei is there any ETA for this feature to be available for end user?

mebhupendra avatar Sep 11 '20 19:09 mebhupendra

We don't usually provide ETAs due to potentially changing priorities and to avoid disappointment (see above, where I did that and then the feature wasn't include the release!). I'll keep the issue posted once we have updates.

tonihei avatar Sep 14 '20 10:09 tonihei

+1 to this feature request.

idish avatar Sep 29 '20 09:09 idish

is it present in the new release?

AmirRezaSobhdel avatar Feb 18 '21 13:02 AmirRezaSobhdel

Which is the current status of this enhancement?

b0g8 avatar Feb 19 '21 10:02 b0g8

+1 Is an important feature for a video lib 😁

viktorisacenko avatar Jul 21 '21 20:07 viktorisacenko

Do you have any idea when this feature will be implemented in the upcoming releases?

Xlcghs avatar Jul 23 '24 12:07 Xlcghs

I need a similar feature for ab that doesn't screw up with the media item. I need a "soft clip". This is to create loops within an audio item. Since I get the duration from the player, if I use ClipConfiguration it clips the actual data and this creates a lot of problems. It should be extremely easy to have a loop feature that loops only a segment of the mediaItem. It's literally just changing a few lines of code.

E.g., if we had a StartOffset and EndOffset variables which could be set it should solve a lot of problems with looping. Every other method is too complex and does little to solve this very simple problem.

Aphexus avatar Nov 07 '24 03:11 Aphexus