PierfrancescoSoffritti / android-youtube-player

YouTube Player library for Android and Chromecast, stable and customizable.
https://pierfrancescosoffritti.github.io/android-youtube-player/
MIT License
3.39k stars 759 forks source link

How to restore the state of youtube player view in Fragment when navigation popup? #1043

Open rutikeyone opened 1 year ago

rutikeyone commented 1 year ago

Question / Problem

How to restore the state of youtube player view in Fragment when navigation popup?

Summary

I use the navigation component for navigation. When navigating, the youtube player popup view is recreated.

I need youtube player view to save its state when navigating and return to it when navigating popup. How can I implement this? Thank you.

initialize in fragment

android manifest

https://github.com/PierfrancescoSoffritti/android-youtube-player/assets/62370608/3ec8ccad-4f3e-40d9-9b6d-c330a4d5e47b

PierfrancescoSoffritti commented 1 year ago

You should try to not destroy the YouTubePlayerView. But if that's not possible you can try manually storing and restoring the state.