Skip to content
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 preload manager to exoplayer to improve short form playback experience #91

Merged
merged 9 commits into from
Sep 6, 2024

Conversation

MayuriKhinvasara
Copy link
Contributor

@MayuriKhinvasara MayuriKhinvasara commented Aug 12, 2024

Add preload manager to exoplayer to improve short form playback experience

(1) Add preload manager for exoplayer (2) Create an Wrapper class to manage and customize all functionalities of preload (PreloadManagerWrapper)(3) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :preload: message to any chat (5) Replace Timeline surface view with Player view for better performance.

In order to test / generate a bunch of short form videos in the Timeline View, send a "preload" text message to any chat in the Chat screen. Thereby a list of 10 short videos urls (listed in ShortsVideoList class) will be sent as a response. These vidoes can then be used in the Timeline View to scroll .

… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance.
@MayuriKhinvasara MayuriKhinvasara requested review from calren, SigmanZero and Cristian-A and removed request for Cristian-A August 12, 2024 09:47
… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance. (6) Use the preloaded source from PreloadManager (7) Add a flag to enable Preload Manager
Copy link
Contributor

@calren calren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we'll need a follow up PR for a 'offline' state for the app's timeline screen, can we file an issue for this so we don't forget?

right now if there's no internet connection, there will be a lot of black videos on the timeline.

lgtm otherwise, super cool to see it implemented!

… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance. (6) Use the preloaded source from PreloadManager (7) Add a flag to enable Preload Manager
… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance. (6) Use the preloaded source from PreloadManager (7) Add a flag to enable Preload Manager
… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance. (6) Use the preloaded source from PreloadManager (7) Add a flag to enable Preload Manager
… for videos.(2) Add preload manager as an optional to Timeline screen (4) Add 10 remote videos to chats by sending :prelaod: message to any chat (5) Replace Timeline surface view with Player view for better performance. (6) Use the preloaded source from PreloadManager (7) Add a flag to enable Preload Manager
Copy link
Contributor

@riggaroo riggaroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the placement of the preloading video feature should be on the main screen as "story" type UI and not with a special incoming message.

You can use the new HorizontalMultiBrowseCarousel in Material to add these at the top of the UI, and load it as needed.

@@ -107,6 +108,12 @@ class ChatRepository @Inject internal constructor(
)

coroutineScope.launch {
// Special incoming message indicating to add shorts videos to try preload in exoplayer
if (text == "preload") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This experience for testing is okay, but if you want to merge this, it should probably be in the main text UI as "story" type blocks that open up this screen, as this just seems like a broken user experience.

@riggaroo
Copy link
Contributor

riggaroo commented Sep 6, 2024

The UI doesn't load the content properly for me into a Pager, the visuals sometimes appear in the chat but not reliably.

Also after sometime of running the app, it crashes:

FATAL EXCEPTION: FinalizerWatchdogDaemon (Ask Gemini)
                                                                                                    Process: com.google.android.samples.socialite, PID: 15726
                                                                                                    java.util.concurrent.TimeoutException: android.media.MediaMetadataRetriever.finalize() timed out after 10 seconds
                                                                                                    	at android.media.MediaMetadataRetriever.native_finalize(Native Method)
                                                                                                    	at android.media.MediaMetadataRetriever.finalize(MediaMetadataRetriever.java:1109)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:370)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.processReference(Daemons.java:350)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:322)
                                                                                                    	at java.lang.Daemons$Daemon.run(Daemons.java:131)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)

@MayuriKhinvasara
Copy link
Contributor Author

The UI doesn't load the content properly for me into a Pager, the visuals sometimes appear in the chat but not reliably.

Also after sometime of running the app, it crashes:

FATAL EXCEPTION: FinalizerWatchdogDaemon (Ask Gemini)
                                                                                                    Process: com.google.android.samples.socialite, PID: 15726
                                                                                                    java.util.concurrent.TimeoutException: android.media.MediaMetadataRetriever.finalize() timed out after 10 seconds
                                                                                                    	at android.media.MediaMetadataRetriever.native_finalize(Native Method)
                                                                                                    	at android.media.MediaMetadataRetriever.finalize(MediaMetadataRetriever.java:1109)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:370)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.processReference(Daemons.java:350)
                                                                                                    	at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:322)
                                                                                                    	at java.lang.Daemons$Daemon.run(Daemons.java:131)
                                                                                                    	at java.lang.Thread.run(Thread.java:1012)

Can you help file a bug for this with repro steps, Seems like network or server issue.

@MayuriKhinvasara MayuriKhinvasara merged commit 80ef8a3 into main Sep 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants