'Flutter video_player multiple videos
Flutter video_player package has this bug, when you play 4-5 videos, after that it hangs, does not play any more videos. Looks like in the backed its not releasing the controller and I see messages in Android Studio like, "Failed to initialize decoder: OMX.qcom.video.decoder.avc"
I am using the same controller and loading new video files from assets.
Solution 1:[1]
Yes its a known issue and even i had the same issue earlier try-out this solution
https://github.com/kaina404/FlutterDouBan/blob/master-new/lib/widgets/video_widget.dart
Solution 2:[2]
Try to use _controller.dispose()
, when moving on to the next video. And make sure to use the same video controller.
Here is an example.
Solution 3:[3]
Solution:
final String url = 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4';
VideoPlayerController.network(url, videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true));
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Zahid Shaikh |
Solution 2 | Paul |
Solution 3 | md-siam |