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

How to get the call back before and after player gets initialized #78

Open
wilz05 opened this issue Jun 21, 2021 · 3 comments
Open

How to get the call back before and after player gets initialized #78

wilz05 opened this issue Jun 21, 2021 · 3 comments

Comments

@wilz05
Copy link

wilz05 commented Jun 21, 2021

Thank you for you're effort, this package works really great on m3u8 links

Am looking for solution like whenever the player gets loaded or being initialized Need to show CircularProgressIndicator
or some loading animations, how can we do it ? like for example....

return Video(
              autoPlay: false,
              loadingPlaceholder: Center(
      child: CircularProgressIndicator()),
..........
);

or like if the player is null show progressindicators

_videoController != null &&
                _videoController!.value.isInitialized ? CircularProgressIndicator()  : Video(
controller=_videoController
........
)

@KhuramKhalid
Copy link
Member

You can use the onPlay through PlayerObserver to get notified when video starts playing. You can then hide the loading indicator. Checkout the example for this.

@wilz05
Copy link
Author

wilz05 commented Jun 21, 2021

In my case there will be 5-6 streaming players in one screen, so my default desiredState = PlayerState.Stopped

@wilz05
Copy link
Author

wilz05 commented Jul 5, 2021

@KhuramKhalid Can I use the above onPlay through PlayerObserver method and to resolve it ? when the state is Stopped. or
In future are there any chance to add the above callbacks/functionally?

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

2 participants