Glimpse: Always prepare ExoPlayer when media type is video
* Fixes video loading when a video is selected from reels Change-Id: I62f5d20e041f83fc0384e7f9e4a7c4f08a75268f
This commit is contained in:
parent
44e74bfdfa
commit
74389a9725
|
@ -189,10 +189,12 @@ class MediaViewerFragment : Fragment(R.layout.fragment_media_viewer) {
|
||||||
)
|
)
|
||||||
|
|
||||||
if (media.mediaType == MediaType.VIDEO) {
|
if (media.mediaType == MediaType.VIDEO) {
|
||||||
exoPlayer?.setMediaItem(MediaItem.fromUri(media.externalContentUri))
|
with(exoPlayerLazy.value) {
|
||||||
exoPlayer?.seekTo(C.TIME_UNSET)
|
setMediaItem(MediaItem.fromUri(media.externalContentUri))
|
||||||
exoPlayer?.prepare()
|
seekTo(C.TIME_UNSET)
|
||||||
exoPlayer?.playWhenReady = true
|
prepare()
|
||||||
|
playWhenReady = true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
exoPlayer?.stop()
|
exoPlayer?.stop()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue