google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

Allow end user to trim media in playlist #3163

Open b0g8 opened 7 years ago

b0g8 commented 7 years ago

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

devdivr commented 3 years ago

@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?

tonihei commented 3 years ago

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.

mebhupendra commented 3 years ago

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

tonihei commented 3 years ago

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.

idish commented 3 years ago

+1 to this feature request.

AmirRezaSobhdel commented 3 years ago

is it present in the new release?

b0g8 commented 3 years ago

Which is the current status of this enhancement?

viktorisacenko commented 3 years ago

+1 Is an important feature for a video lib 😁

Xlcghs commented 1 month ago

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