Halil Ozercan
07/15/2020, 4:56 PMZach Klippenstein (he/him) [MOD]
07/15/2020, 4:59 PMTimo Drick
07/15/2020, 5:35 PMStack {
val recompose = invalidate
//your views here.
// call recompose() when you want to trigger a recompose
}
Sean McQuillan [G]
07/16/2020, 7:05 PMHalil Ozercan
07/17/2020, 11:11 PMAndroidView
with some old callbacks like surface updates for TextureView
threw me off a little bit.
A mediaplayer needs a surface, which becomes available asynchronously, to play the video. I struggled with implementing the source URL as a dependency to my Composable view so that when this URL changes, MediaPlayer should start playing the new video. It felt like the easiest way was to completely get rid off the surface(TextureVuew) and restart from scratch because the initial source always worked as expected.
I decided to tweak my design a bit and move MediaPlayer related functionality to a specific controller. That helped a lot to figure out how to map other video player related stuff like seekbar into compose.