I am working on a app where we have a webview screen where we play youtube videos. Now the problem is that I have a requirement where upon back pressing from the webview(lands on native android screen) , I need the youtube video to be in PiP mode. The problem I am having is that i can not figure out how to instantiate a YoutubePlayerView inside an android fragment since I am using a webview and also my app only has one activity and all of the UI stuff is managed through fragments and navigation graph.
Thanks in advance.
I am not completely sure, but found articles stating that whole activity will be in PIP mode, as in my case I only have a main activity(which is the only hosting activity). Through my search , I found that youtube player is the way to go (can't use exoplayer or any other 3rd party library).