MediaPlayer has black screen when entering back into app [4.0.0a10]
Verified this on ios.
Issue
When I leave the video paused in the background and attempt to return to my application to resume, I only get audio playing.
No matter how long I wait, video never shows up again.
I have verified that the players view is present & that the videoTrack in question is selected.
replication steps:
- Pause playing media.
- Go to home screen
- Wait about 5 seconds
- re-enter application and play media.
PiP replication steps:
- Enter PiP
- Close PiP window
- Wait about 5 seconds
- re-enter application and play media.
Expectation
Media should resume like normal where both video and audio show no delay and are visible and play is invoked.
Workaround
Only by toggling the videoTrack.isSelected property have I been able to get the video to render again. This isnt the greatest solution either as there is still about a 1 second delay until video works again.
Heres a snippet of my workaround.
// Current solution to fixing black screen when re-entering application
if let videoTrack = self.vlc.player.videoTracks.first { $0.isSelected == true } {
videoTrack.isSelected = false
videoTrack.isSelectedExclusively = true
self.vlc.player.play()
self.vlc.player.pause()
}