Youtube_player_flutter: There are some problems with background playback

Created on 10 Jul 2019  路  9Comments  路  Source: sarbagyastha/youtube_player_flutter

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.

question

Most helpful comment

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

All 9 comments

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.

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

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

@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 ?

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

@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..馃憤

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

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

same, this buttons background black

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cerireyhan picture cerireyhan  路  3Comments

kulture-rob-snider picture kulture-rob-snider  路  5Comments

snoopdoggy322 picture snoopdoggy322  路  4Comments

jimmyff picture jimmyff  路  3Comments

mohadel92 picture mohadel92  路  3Comments