-
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 option to align durations of MergingMediaSource elements #8422
Comments
If the media is downloaded, loading it to find its duration is not going to be excessively inefficient so that might be fine for now. Whether it's performant enough will depend on your specific requirements I guess. #3163 tracks having a way to update the clipping start/end points dynamically. @tonihei Please could you take a look and add or correct anything? Thanks. |
That's pretty much it:
|
Without this feature it's impossible to nicely merge multiple sources with different durations if these durations are not known exactly before the start of playback. Issue: #8422 PiperOrigin-RevId: 350567625
I want to set up a default audio clip to play for video playback when there is no audio track present. I want this default audio source to play for the same duration as the video (downloaded mp4 file) MediaSource. My first thought was to use a ClippingMediaSource + MergingMediaSource, but the nature of this application means I do not know what the precise video duration is (unless there is a performant way to easily calculate this without playing the file). If there was a way to dynamically update the ClippingMediaSource duration this could work, but I have not found a way.
So I guess there are two questions:
Is there a way to dynamically update the duration of a ClippingMediaSource?
or is there a way to set the ClippingMediaSource duration to the be same duration as another MediaSource?
The text was updated successfully, but these errors were encountered: