XamarinMediaManager icon indicating copy to clipboard operation
XamarinMediaManager copied to clipboard

Calling stop function before the media is loaded doesn't work

Open AswinPG opened this issue 3 years ago • 2 comments

🐛 Bug Report

When we play from a url, the mediamanager takes some time to load the video. if during this time we change the url, the mediaplayer continnues to load the previous url first and starts playing the first media and then plays the current one. So for the current label wrong video will be played at first and then the actual one. The first thing we might try to do to avoid this behaviour is to stop the media player before loading the next one. But this is also not working during that loading period.

Expected behavior

Current item should stop playing when stop function is called even if it was still in loading state

Reproduction steps

Create mediaplayer element in xamarin forms, play one video, before loading is complete call the stop function. It won't work, the media starts playing later. Also play a url first. change the url before first media is loaded, The player first plays the first media and then loads the next one. The required behaviour would be to play the currently given url.

Configuration

Version: 0.9.9 and below

Platform:

  • [ ] :iphone: iOS
  • [ ] :robot: Android
  • [ ] :checkered_flag: WPF
  • [ ] :earth_americas: UWP
  • [ ] :apple: MacOS
  • [ ] :tv: tvOS
  • [.] :monkey: Xamarin.Forms

AswinPG avatar Aug 13 '20 13:08 AswinPG

I don't know if this issue is accurate. Setting autoplay to false seems to clear my problem. I'll check what the real problem is and try to do a PR if I find it. The project is big and awesome. It'll take some time to fully understand it.

AswinPG avatar Aug 14 '20 07:08 AswinPG

Setting autoplay didn't stop the issue. I was wrong. The problem here is that we can't stop the video from playing if it has not started playing.

AswinPG avatar Aug 14 '20 12:08 AswinPG