Baseflow / XamarinMediaManager

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

[iOS] sporadically crashes with NSInvalidArgumentException when Play() overload with stopAt argument is called #888

Closed gsgou closed 1 year ago

gsgou commented 1 year ago

🐛 Bug Report

when Play() overload with stopAt argument is called, iOS app crashes sporadically when end of playback time is reached.

System.Exception: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: An instance of AVPlayer cannot remove a time observer that was added by a different instance of AVPlayer. Native stack trace: 0 CoreFoundation 0x0000000180483c94 55C76F8E-BCC9-3A4C-9F62-16EAC0BA8AB8 + 601236 1 libobjc.A.dylib 0x0000000197ca8ee4 objc_exception_throw + 56 2 AVFCore 0x0000000189210560 2C66AECB-8B65-371D-9509-079EB66707D3 + 214368

Expected behavior

when Play() overload with stopAt argument is called, iOS app does not crash sporadically when end of playback time is reached.

Configuration

Version: 1.1.1

Platform: