-
Notifications
You must be signed in to change notification settings - Fork 413
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
Image is skipped when mixing image and video media items in a exoplayer playlist #1017
Comments
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. When a renderer is being enabled and the player is 'playing', that renderer is also started. When playing a mixed playlist of images and content with audio & video, the player may skip some image items because the early-starting of the audio renderer causes a clock update. A solution is to only start the "early-enabled" renderers at the point of media transition and add a condition on DefaultMediaClock to use the standalone clock when reading-ahead and the renderer clock source is not in a started state. Issue: #1017 PiperOrigin-RevId: 613231227
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. When a renderer is being enabled and the player is 'playing', that renderer is also started. When playing a mixed playlist of images and content with audio & video, the player may skip some image items because the early-starting of the audio renderer causes a clock update. A solution is to only start the "early-enabled" renderers at the point of media transition and add a condition on DefaultMediaClock to use the standalone clock when reading-ahead and the renderer clock source is not in a started state. Issue: androidx/media#1017 PiperOrigin-RevId: 613231227
How are you displaying image and video in playlist can you share some sample code |
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. Currently, when a player is set to pause, it stops all renderers that are `STATE_STARTED`. When a player is set to play, it starts all renderers that are enabled. This would include renderers that were enabled early for the subsequent media item. The solution is to only start renderers that are enabled by the current playing period. Issue: #1017 PiperOrigin-RevId: 614734437
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. Currently, when a player is set to pause, it stops all renderers that are `STATE_STARTED`. When a player is set to play, it starts all renderers that are enabled. This would include renderers that were enabled early for the subsequent media item. The solution is to only start renderers that are enabled by the current playing period. Issue: androidx/media#1017 PiperOrigin-RevId: 614734437
Hello @kleiren, Thank you for reporting your issue! We submitted some fixes that should address the problem. These commits, 8b219b0 and 638b2a3 were pushed into the androidx/media main branch. With the fixes, Images with set duration should not be skipped in the mixed video, image playlist. Hopefully that helps! |
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. When a renderer is being enabled and the player is 'playing', that renderer is also started. When playing a mixed playlist of images and content with audio & video, the player may skip some image items because the early-starting of the audio renderer causes a clock update. A solution is to only start the "early-enabled" renderers at the point of media transition and add a condition on DefaultMediaClock to use the standalone clock when reading-ahead and the renderer clock source is not in a started state. Issue: #1017 PiperOrigin-RevId: 613231227 (cherry picked from commit 638b2a3)
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. Currently, when a player is set to pause, it stops all renderers that are `STATE_STARTED`. When a player is set to play, it starts all renderers that are enabled. This would include renderers that were enabled early for the subsequent media item. The solution is to only start renderers that are enabled by the current playing period. Issue: #1017 PiperOrigin-RevId: 614734437 (cherry picked from commit 8b219b0)
Hi @microkatz However, ImageOutput.onDisabled() seems to be being called immediately after the last onImageAvailable(). For example, for 2 images and a video in sequence. Image 1 is shown correctly, the second image is shown for a few millis instead of its full presentation time (as on disabled is immediately called, hiding the view and showing what's below) and then the video is shown in the exoplayer view. Should I use something different than onDisabled() to know when the current image has to stop being shown? Thanks for the work! |
Hi @kleiren. Glad that progress has been made. The original issue was addressed by the player not transitioning its clock to the subsequent media item until the item has started(aka the play time has reached the next start position). I see that there is still a prevailing issue of the ImageRenderer finishing its renderering duties as soon as it offers that last image. Thank you for reporting this new issue. We will need a little time to figure out the best solution. In the meantime, may I suggest using the onMediaItemTransition callback? Hopefully that will provide ample notification for when the playback transitions to an item that is video vs image for switching your UI views. |
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. When a renderer is being enabled and the player is 'playing', that renderer is also started. When playing a mixed playlist of images and content with audio & video, the player may skip some image items because the early-starting of the audio renderer causes a clock update. A solution is to only start the "early-enabled" renderers at the point of media transition and add a condition on DefaultMediaClock to use the standalone clock when reading-ahead and the renderer clock source is not in a started state. Issue: androidx#1017 PiperOrigin-RevId: 613231227 (cherry picked from commit 638b2a3)
Renderers may be enabled for subsequent media items as soon as the current media item's renderer's isEnded() returns true. Currently, when a player is set to pause, it stops all renderers that are `STATE_STARTED`. When a player is set to play, it starts all renderers that are enabled. This would include renderers that were enabled early for the subsequent media item. The solution is to only start renderers that are enabled by the current playing period. Issue: androidx#1017 PiperOrigin-RevId: 614734437 (cherry picked from commit 8b219b0)
Version
Media3 pre-release (alpha, beta or RC not in this list)
More version details
1.3.0-alpha01
Devices that reproduce the issue
OnePlus Nord running Android 11
Emulator running Android 14
Emulator running Android 10
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
In a default exoplayer with a simple ImageOutput set, setting a playlist with multiple media items:
e.g.:
mediaItems.add(imageMediaItemBuilder1.setImageDurationMs(3000).build()) //[Image1]
mediaItems.add(imageMediaItemBuilder2.setImageDurationMs(3000).build()) //[Image2]
mediaItems.add(videoMediaItem) //[Video]
videoPlayer.setMediaItems(mediaItems)
videoPlayer.playWhenReady = true
videoPlayer.prepare()
Expected result
Image 1 is shown 3000 ms, Image 2 is shown 3000 ms, Video is played in its entirety.
Actual result
The image right before the video is shown just a few milliseconds, transitioning directly to the video. That is, Image1 is shown 3000 ms, Image2 is shown a few ms, Video is played in its entirety.
For some reason, it seems having a video next in the playlist "overrides" the current image.
When the media items are only images it works as expected (all images are shown the set ms) and with only video it works as expected
Media
Not applicable
Bug Report
adb bugreport
to [email protected] after filing this issue.The text was updated successfully, but these errors were encountered: