1

I have implemented MediaElement to play videos in xamarin.forms (using community toolkit) application. But whenever application goes into the background in android, it pauses the video and restart it whenever app resumes. I have tried saving position when app goes in background and apply saved position when app resumes but in android position is not updating. I want to start the video where it paused when app resumes. Any help ?

Dhruv Gohil
  • 503
  • 1
  • 5
  • 13
  • Show code. The declaration of the video element. What method you save it in, and what you did to save it. What method you restore position from. Also debugging info: 1) When you restore position, the value you use - have you confirmed it is what you expect. 2) Order in which events happen - Assuming all the code you show is correct, then its possible that MediaElement gets reset to its start AFTER you set position. To accurately control its behavior, set position to a binding that you control. `... Position="{Binding MyPosition}" ...`. Then you set MyPosition to control the position. – ToolmakerSteve Jul 29 '21 at 10:15

0 Answers0