title: Video buffering when trying to play it flutter dart
body: <p>I am trying to create a dog photo/video generator app using Flutter and Dart. It basically sends a get request to a website called <a href="http://random.dog/woof.json" rel="nofollow noreferrer">random.Dog</a> to get a url to show on my app. Sometimes the url is a video and sometimes it is a img. When it is a video my app just buffers and this console message keeps on coming:</p>
  <pre><code>E/flutter ( 4345): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: 
  
  MissingPluginException(No implementation found for method init on channel better_player_channel)
  E/flutter ( 4345): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
  E/flutter ( 4345): &lt;asynchronous suspension&gt;
  E/flutter ( 4345): 
  E/flutter ( 4345): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method create on channel better_player_channel)
  E/flutter ( 4345): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
  E/flutter ( 4345): &lt;asynchronous suspension&gt;
  E/flutter ( 4345): #1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:358:43)
  E/flutter ( 4345): &lt;asynchronous suspension&gt;
  E/flutter ( 4345): #2      MethodChannelVideoPlayer.create (package:better_player/src/video_player/method_channel_video_player.dart:38:9)
  E/flutter ( 4345): &lt;asynchronous suspension&gt;
  E/flutter ( 4345): #3      VideoPlayerController._create (package:better_player/src/video_player/video_player.dart:202:18)
  E/flutter ( 4345): &lt;asynchronous suspension&gt;
  E/flutter ( 4345): 
  I/flutter ( 4345): {&quot;fileSizeBytes&quot;:3294982,&quot;url&quot;:&quot;https://random.dog/a922da9a-437c-4400-9d94-f36ec2e5452c.mp4&quot;}
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 2)
  D/BufferPoolAccessor2.0( 4345): bufferpool2 0xeac5e4a8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/45600 (fetch/transfer)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  I/CCodecConfig( 4345): query failed after returning 19 values (BAD_INDEX)
  D/CCodecConfig( 4345): c2 config diff is   c2::i32 coding.drc.compression-mode.value = 3
  W/Codec2Client( 4345): query -- param skipped: index = 1342179345.
  W/Codec2Client( 4345): query -- param skipped: index = 2415921170.
  W/Codec2Client( 4345): query -- param skipped: index = 1610614798.
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:Output[N]] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = {
  D/CCodecBuffers( 4345):   int32_t aac-drc-album-mode = 0
  D/CCodecBuffers( 4345):   int32_t aac-drc-boost-level = 127
  D/CCodecBuffers( 4345):   int32_t aac-drc-cut-level = 127
  D/CCodecBuffers( 4345):   int32_t aac-drc-effect-type = 3
  D/CCodecBuffers( 4345):   int32_t aac-drc-heavy-compression = 3
  D/CCodecBuffers( 4345):   int32_t aac-drc-output-loudness = -1
  D/CCodecBuffers( 4345):   int32_t aac-encoded-target-level = -1
  D/CCodecBuffers( 4345):   int32_t aac-max-output-channel_count = 8
  D/CCodecBuffers( 4345):   int32_t aac-target-ref-level = 64
  D/CCodecBuffers( 4345):   int32_t channel-count = 1
  D/CCodecBuffers( 4345):   string mime = &quot;audio/raw&quot;
  D/CCodecBuffers( 4345):   int32_t sample-rate = 44100
  D/CCodecBuffers( 4345): }
  D/CCodecConfig( 4345): c2 config diff is   c2::i32 coding.drc.compression-mode.value = 1
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:Output[N]] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = {
  D/CCodecBuffers( 4345):   int32_t aac-drc-album-mode = 0
  D/CCodecBuffers( 4345):   int32_t aac-drc-boost-level = 127
  D/CCodecBuffers( 4345):   int32_t aac-drc-cut-level = 127
  D/CCodecBuffers( 4345):   int32_t aac-drc-effect-type = 3
  D/CCodecBuffers( 4345):   int32_t aac-drc-heavy-compression = 1
  D/CCodecBuffers( 4345):   int32_t aac-drc-output-loudness = -1
  D/CCodecBuffers( 4345):   int32_t aac-encoded-target-level = -1
  D/CCodecBuffers( 4345):   int32_t aac-max-output-channel_count = 8
  D/CCodecBuffers( 4345):   int32_t aac-target-ref-level = 64
  D/CCodecBuffers( 4345):   int32_t channel-count = 1
  D/CCodecBuffers( 4345):   string mime = &quot;audio/raw&quot;
  D/CCodecBuffers( 4345):   int32_t sample-rate = 44100
  D/CCodecBuffers( 4345): }
  D/BufferPoolAccessor2.0( 4345): bufferpool2 0xeac5e4a8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/45824 (fetch/transfer)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 1)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  I/chatty  ( 4345): uid=10154(com.example.randomdog) HwBinder:4345_1 identical 4 lines
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  D/BufferPoolAccessor2.0( 4345): bufferpool2 0xeac5e4a8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/46039 (fetch/transfer)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 3)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 4)
  D/BufferPoolAccessor2.0( 4345): bufferpool2 0xeac5e4a8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/46268 (fetch/transfer)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 2)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 1)
  D/BufferPoolAccessor2.0( 4345): bufferpool2 0xeac5e4a8 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/46498 (fetch/transfer)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 3)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 4)
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:1D-Input.Impl[N]] codec released a buffer owned by client (index 0)
  I/CCodecConfig( 4345): query failed after returning 19 values (BAD_INDEX)
  D/CCodecConfig( 4345): c2 config diff is   c2::i32 coding.drc.compression-mode.value = 3
  W/Codec2Client( 4345): query -- param skipped: index = 1342179345.
  W/Codec2Client( 4345): query -- param skipped: index = 2415921170.
  W/Codec2Client( 4345): query -- param skipped: index = 1610614798.
  D/CCodecBuffers( 4345): [c2.android.aac.decoder#768:Output[N]] popFromStashAndRegister: output format changed to AMessage(what = 0x00000000) = {
  </code></pre>
  <p>And my video doenst show up on my emulator. What seems to be the problem and how do I fix it? My minimal code:</p>
  <pre><code>import 'package:better_player/better_player.dart';
  
  
  void main() =&gt; runApp(MaterialApp(home: RandomDog()));
  
  class RandomDog extends StatefulWidget {
    @override
    _RandomDogState createState() =&gt; _RandomDogState();
  }
  
  class _RandomDogState extends State&lt;RandomDog&gt; {
    var headers = {'Content-Type': 'application/json'};
    var body = {};
    var video = false;
    var img = false;
    var message;
    var loading = true;
    var _controller;
  
    @override
    void initState() {
      getDog();
      super.initState();
    }
  
    getDog() async {
      loading=true;
      var response = await http.get(Uri.https('random.dog', '/woof.json'));
      print(response.body);
      message = jsonDecode(response.body);
      if (message['url'].contains('gif') || message['url'].contains('png') ||
          message['url'].contains('jpg') || message['url'].contains('jpeg')) {
        video = false;
        img = true;
      } else {
        video = true;
        img = false;
      }
      loading = false;
      setState(() {
  
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          . . .
        body: Center(
          child: loading == true ? CircularProgressIndicator() : Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Visibility(visible: img,
                  child: Image.network(message['url'], fit: BoxFit.scaleDown,)),
              // Visibility(visible: video,child: VideoApp(url:message['url'])),
              video == true? CircularProgressIndicator() :
                  Visibility(visible: video, child: BetterPlayer.network(message['url'],betterPlayerConfiguration: BetterPlayerConfiguration(autoPlay: true),)), //Chewie(controller: _controller,)
              
              OutlinedButton(onPressed: () async {
                getDog();
              }, child: Text('GENERATE')),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>