title: VideoPlayerController.network() ran into source error
body: <p>Im trying to play a video from the internet using VideoPlayerController.netWork() method but every single url that i try face with an error which is specified below :</p>
  
  <p>Source error.
  E/flutter ( 4250): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(VideoError, Video player had error com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to <a href="https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4" rel="nofollow noreferrer">https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4</a>, null)
  E/flutter ( 4250): #0      ChewieController._initialize (package:chewie/src/chewie_player.dart:291:7)
  E/flutter ( 4250): 
  E/flutter ( 4250): #1      new ChewieController (package:chewie/src/chewie_player.dart:197:5)
  E/flutter ( 4250): #2      _ChewieListState.initState (package:flutterappvideoandshit/screens/chewie_list.dart:20:25)
  E/flutter ( 4250): #3      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4640:58)
  E/flutter ( 4250): #4      ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
  E/flutter ( 4250): #5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #6      Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #7      SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5830:14)
  E/flutter ( 4250): #8      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #9      Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #10     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5830:14)
  E/flutter ( 4250): #11     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #12     Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
  E/flutter ( 4250): #14     Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
  E/flutter ( 4250): #15     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
  E/flutter ( 4250): #16     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
  E/flutter ( 4250): #17     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #18     Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
  E/flutter ( 4250): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
  E/flutter ( 4250): #21     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
  E/flutter ( 4250): #22     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
  E/flutter ( 4250): #23     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #24     Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #25     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
  E/flutter ( 4250): #26     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4675:11)
  E/flutter ( 4250): #27     Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
  E/flutter ( 4250): #28     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
  E/flutter ( 4250): #29     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4666:11)
  E/flutter ( 4250): #30     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
  E/flutter ( 4250): #31     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #32     Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
  E/flutter ( 4250): #34     Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
  E/flutter ( 4250): #35     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4481:5)
  E/flutter ( 4250): #36     ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
  E/flutter ( 4250): #37     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
  E/flutter ( 4250): #38     Element.updateChild (package:flutter/src/widgets/framework.dart:3214:18)
  E/flutter ( 4250): #39     SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1147:36)
  E/flutter ( 4250): #40     SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:1132:20)
  E/flutter ( 4250): #41     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2607:19)</p>
  
  <p>and here is my code :</p>
  
  <pre><code>
  import 'package:video_player/video_player.dart';
  import 'package:chewie/chewie.dart';
  void main() =&gt; runApp(MyApp());
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
      home: HomePage(),
      );
    }
  }
  class HomePage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text("Video Player"),
        ),
        body: ListView(
          children: &lt;Widget&gt;[
            ChewieList(
              videoPlayerController: VideoPlayerController.asset('assets/videos/soccer.mp4'),
              looping: true,
            ),
            ChewieList(
              videoPlayerController: VideoPlayerController.network(
                  'https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4'),
            ),
            /*
            ChewieList(
              videoPlayerController: VideoPlayerController.network(
                  'http://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4'),
            )
             */
          ],
        ),
      );
    }
  }
  
  
  
  
  class ChewieList extends StatefulWidget {
    ChewieList({@required this.videoPlayerController,this.looping,Key key,}) : super(key:key);
    final VideoPlayerController videoPlayerController;
    final bool looping;
  
    @override
    _ChewieListState createState() =&gt; _ChewieListState();
  }
  
  class _ChewieListState extends State&lt;ChewieList&gt; {
    ChewieController _chewieController;
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
      _chewieController = ChewieController(
          videoPlayerController: widget.videoPlayerController,
          aspectRatio: 16/9,
          autoInitialize: true,
          looping: widget.looping,
          errorBuilder: (context,errMsg){
            return Center(
              child:Column(
                mainAxisSize: MainAxisSize.min,
                mainAxisAlignment: MainAxisAlignment.center,
                children: &lt;Widget&gt;[
                  Icon(Icons.warning,color: Colors.yellowAccent,),
                  Text("!خطایی در برقراری ارتباط رخ داده است",style: TextStyle(color: Colors.white),)
                ],
              ),
            );
          }
      );
    }
  
    @override
    void dispose() {
      // TODO: implement dispose
      super.dispose();
      widget.videoPlayerController.dispose();
      _chewieController.dispose();
    }
    @override
    Widget build(BuildContext context) {
      return Padding(
        padding: EdgeInsets.all(8.0),
        child: Chewie(
          controller: _chewieController,
        ),
      );
    }
  }
  
  
  </code></pre>
  
  <p>it's driving me crazy!!!!
  guys please help me .</p>