Sorry, not sure if noob question. As the title says, I want to use setAudioSessionId
, setAudioAttributes
, and setScreenOnWhilePlaying
in a VideoView
. But I can't seem to find anything that teaches how to do it. There's no getMediaPlayer
method in VideoView and setting them in onPrepared
where the MediaPlayer instance is getting passed to seems to be too late. So how can I use them in VideoView, is there some other VideoView initialization callback that I can use? Or is there anything that would allow me to set the stream type for the app in general? And maintain screen on without using wakelock like setScreenOnWhilePlaying
?
Thank you very much! :)
VideoView is a wrapper of MediaPlayer. VideoView instantiate a MediaPlayer object inside of it and never exposes it.