5

I have used video_player: ^0.10.1+2 it's working fine in IOS but not working on Android

_videoPlayerController1 = VideoPlayerController.network('url with .m3u8 file');
  

_chewieController = ChewieController(
    videoPlayerController: _videoPlayerController1,
    //aspectRatio: 3 / 2,
    //aspectRatio: _videoPlayerController1.value.aspectRatio,
    autoPlay: true,
    looping: true,
    routePageBuilder: (BuildContext context, Animation<double> animation,
        Animation<double> secondAnimation, provider) {
      return AnimatedBuilder(
        animation: animation,
        builder: (BuildContext context, Widget child) {
          return VideoScaffold(
            child: Scaffold(
              resizeToAvoidBottomPadding: false,
              body: Container(
                margin: EdgeInsets.only(bottom: 50),
                alignment: Alignment.center,
                color: Colors.black,
                child: provider,
              ),
            ),
          );
        },
      );
    },
    materialProgressColors: ChewieProgressColors(
       playedColor: Colors.red,
       handleColor: Colors.blue,
       backgroundColor: Colors.grey,
       bufferedColor: Colors.lightGreen,
     ),
     placeholder: Container(
       color: Colors.grey,
     ),
     autoInitialize: true,
    );
E/ExoPlayerImplInternal(13111): com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:300)
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:102)
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.DataSourceInputStream.open(DataSourceInputStream.java:65)
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:156)
E/ExoPlayerImplInternal(13111):     at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
E/ExoPlayerImplInternal(13111):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/ExoPlayerImplInternal(13111):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/ExoPlayerImplInternal(13111):     at java.lang.Thread.run(Thread.java:764)
Nikunj Rami
  • 51
  • 1
  • 2

1 Answers1

0

Flutter's video_player plugin uses ExoPlayer on Android as mentioned in the docs. It should have support for .m3u8 format per checking ExoPlayer's GitHub issue tracker.

If you're able to run an Android project, I suggest trying to play your .m3u8 stream link on their demo app and see if it works. If the .m3u8 link does work on the ExoPlayer demo app, there could be an issue in the video_player plugin. Otherwise, I suggest filing a ticket on ExoPlayer's GitHub issue page to check if there's an issue in the media that you're using. Please also include an accessible .m3u8 stream link that can be tested to diagnose the issue.

Omatt
  • 8,564
  • 2
  • 42
  • 144