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

There are some problems with background playback #41

Closed
Frank0945 opened this issue Jul 10, 2019 · 9 comments
Closed

There are some problems with background playback #41

Frank0945 opened this issue Jul 10, 2019 · 9 comments
Labels
question Further information is requested

Comments

@Frank0945
Copy link

When I leave the app, the music plays as usual.
But it will not be long before he will be intermittent.

And the detection movie ends and cannot be executed in the background.

@sarbagyastha
Copy link
Owner

Extremely sorry for the late respond, was quite busy since last time I updated the plugin. Will be looking into the issue.
I think it was webview not being disposed properly which has been fixed. Will merge and update the plugin with the fix.

@Jay-Jeong1988
Copy link

I have the same problem. waiting for the update 😃. Thank you for the plugin.

@sarbagyastha
Copy link
Owner

@Frank0945 @Jay-Jeong1988 Could you please check if it is fixed on version 4 ?

@sarbagyastha sarbagyastha added the question Further information is requested label Aug 12, 2019
@Jay-Jeong1988
Copy link

Jay-Jeong1988 commented Aug 12, 2019

@Frank0945 @Jay-Jeong1988 Could you please check if it is fixed on version 4 ?

Hi @sarbagyastha I just have tested it and webviews seem to be disposed properly after a few seconds leaving the page. Thanks for fast update!!
ps. is there a way to reduce the seconds until they get disposed ?

@sarbagyastha
Copy link
Owner

@Jay-Jeong1988 You may implement AppLifeCycleState and pause the video when the state is paused.

@Jay-Jeong1988
Copy link

Jay-Jeong1988 commented Aug 14, 2019

@sarbagyastha Thank you, it works perfect 😄. Btw this is little out of the topic, but I am trying to implement Pip mode with your plugin. I made it working that now it turns into pip mode by clicking the button, but the player turns into pause state as the app goes pip mode. The app state goes into AppLifeCycleState.inactive as it goes into Pip mode and AppLifeCycleState.resume as it comes back to normal mode so there is no problem listening to those changes and call play(). However, there is a middle mode which the app goes into when user clicks the minimized screen and that also pause the video again(which I do not want). The problem is that there is no listenable change in AppLifeCycleState between the smallest mode and the middle mode thus I cannot have control of the video player. To cut the long story short, according to the research I had, there are a few work arounds but I do not know how to.

  1. Use method channel to listen to native method call, isInPictureInPictureMode() -> if true, call play().
  2. Listen to android's other activities such as Resize etc -> if true, call play()
  3. This is what I think would be the best solution. According to the official document(link attached below), I should prevent the player from pausing when the app state goes into pause so the video can continue playing without no pause at all.
    https://developer.android.com/guide/topics/ui/picture-in-picture

if you know how to manage any of the options and tell me ,would be really appreciated..👍

@sarbagyastha
Copy link
Owner

@Jay-Jeong1988 if you want pip mode then opt for youtube_player instead. It'll be much more smooth experience with that one.

@Jay-Jeong1988
Copy link

Jay-Jeong1988 commented Aug 15, 2019

@sarbagyastha I believe your youtube_player plugin is not compatible with ios. Am I correct ? Maybe I should try it anyways. Thanks for advice !

@bkocadere
Copy link

same, this buttons background black

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

No branches or pull requests

4 participants