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

[iOS] Video continues playing after you leave page #50

Closed
lukeramsden opened this issue Dec 15, 2016 · 10 comments
Closed

[iOS] Video continues playing after you leave page #50

lukeramsden opened this issue Dec 15, 2016 · 10 comments

Comments

@lukeramsden
Copy link

Started at #46

If you leave a page, the video continues playing in the background, but only on iOS. Potential fix to make video run destroy() or suspend() on leaving the page?

@bnussey
Copy link
Contributor

bnussey commented Dec 15, 2016

I believe this is easily solved by just running the destroy method on the video. Videos must be destroyed as on iOS there is a hard limit of around 15-20 videos. Soon as you hit this, it'll stop rendering videos.

@bnussey bnussey closed this as completed Dec 15, 2016
@lukeramsden
Copy link
Author

@bnussey yes, but maybe it should be done automatically by the plugin? That would make everything simpler.

@bnussey
Copy link
Contributor

bnussey commented Dec 15, 2016

Hey @lukeramsden I disagree, its a common pattern and good practice to run necessary destroys when leaving a page.

@manijak
Copy link

manijak commented Dec 15, 2016

Did not know about destroy(), that will do :)

@lukeramsden
Copy link
Author

I knew about it, that's what I'm currently doing, I just think it's good practice to have to plugin clean up after itself.

@bnussey
Copy link
Contributor

bnussey commented Dec 15, 2016

@lukeramsden -- the plugin will not know when to do that, it relies on you to specify that. Feel free to provide a PR if you'd like though.

@lukeramsden
Copy link
Author

Is there no way to bind it to the onNavigatingFrom event? I'll have a go at it later cause I'm on my phone right now.

@manijak
Copy link

manijak commented Dec 17, 2016

@bnussey Just FYI, I tested it with destroy() and it works. But when you return back to the video-page, the binding is not being set.

Binding: Binding error while setting property src of Video<mainVideoPlayer>@file:///app/views/home/partial-video.xml:12:17;: TypeError: null is not an object (evaluating 'this._playerController.player = this._player')

@bnussey
Copy link
Contributor

bnussey commented Dec 17, 2016

Hey @manijak just depends on your specific scenario. If you want to come back to the video and play it, then you just need to pause it. If you never want to come back to the video, and the page is going to be reloaded the next time you want to access it, you destroy it. But please make sure you're destroying at some point otherwise will run into issues

@pandasoft0
Copy link

Here is another issue. The video player gets paused and mute when I switch to the iOS home screen, but when I lock device everything works correctly. I think the issue is in the native script’s videoplayer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants