You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this to be yet another threading issue. I didn't have this issue with the remote videos in my app, but when I added video pre-loading to it using a hacky way (just move video component to background, assign the next video to it, and pause it until it is needed) I realized that videos kept playing even when paused property was correctly being set.
The text was updated successfully, but these errors were encountered:
setPaused seems to be called correctly with the right values. When setPaused is called with paused as true in my app, the progress update timer is stopped properly but player is not being paused. So it is definitely a threading issue. Will fix this.
Since all the property setters seem to be called asynchronously we should check them all and make sure what needs to be on the main thread stays on the main thread. I'll check and open another issue if necessary.
From Apple's documentations:
AVPlayer serializes notifications of changes that occur dynamically during playback on a dispatch queue. By default, this queue is the main queue (see dispatch_get_main_queue). To ensure safe access to a player’s nonatomic properties while dynamic changes in playback state may be reported, you must serialize access with the receiver’s notification queue. In the common case, such serialization is naturally achieved by invoking AVPlayer’s various methods on the main thread or queue.
isair
changed the title
Pausing videos do not always work
Player pause/play calls should be done on the main thread
Jun 26, 2015
I believe this to be yet another threading issue. I didn't have this issue with the remote videos in my app, but when I added video pre-loading to it using a hacky way (just move video component to background, assign the next video to it, and pause it until it is needed) I realized that videos kept playing even when paused property was correctly being set.
The text was updated successfully, but these errors were encountered: