Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pausing videos do not always work #66

Closed
isair opened this issue Jun 26, 2015 · 1 comment
Closed

Pausing videos do not always work #66

isair opened this issue Jun 26, 2015 · 1 comment
Assignees
Labels

Comments

@isair
Copy link
Contributor

isair commented 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.

@isair isair added the bug label Jun 26, 2015
@isair isair self-assigned this Jun 26, 2015
@isair
Copy link
Contributor Author

isair commented Jun 26, 2015

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 isair changed the title Pausing videos do not always work Player pause/play calls should be done on the main thread Jun 26, 2015
@isair isair changed the title Player pause/play calls should be done on the main thread Pausing videos do not always work Jun 29, 2015
@isair isair closed this as completed in 449b97a Jul 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant