Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
762 stars 305 forks source link

iOS: When leaving page with videoview in it, upon return videoview just black #821

Closed innomotionmedia closed 3 years ago

innomotionmedia commented 3 years ago

So this is terrible:

I can create and see my video. I will now leave the page while it still is open (I pick a picture from gallery on the same page)

i return to the page with the video in it (cause it hasnt closed)

Andt he video is gone and there is just a play button but no file behind it anymore.

This only happens on iOS.

If I retake another video and try to display it, it also just shows a black screen.

I would have to completeley leave the page and open it again for the player to be working again.

Platform:

innomotionmedia commented 3 years ago

The issue is the auto attach to the view. Once you leave the view, the video wont attach back to it = fail.

Solution:

Put the whole video logic in a content view. Since content views dont know about their lifecycle, they believe they are visible for as long as the page is in stack. This will make this plugin work way better.

ALWAYS put it in content view and inflate content view in content page.