title: Unable to play video from server url in VideoPlayer : Flutter
body: <p>I unable to play video from my server using Video Player lib of flutter
  When i try to <code>flutter</code> video is working fine and played, but if i play my server side <code>url</code> video show me error and black screen. So kindly please help me to short out this query.</p>
  <p>code is</p>
  <pre><code>import 'package:audioplayers/audioplayers.dart';
  import 'package:flutter/material.dart';
  import 'package:video_player/video_player.dart';
  class MyVideoPlayerPage extends StatefulWidget {
    String myvideo;
    MyVideoPlayerPage({this.myvideo});
    @override
    _MyVideoPlayerPageState createState() =&gt; _MyVideoPlayerPageState(myvideo);
  }
  
  class _MyVideoPlayerPageState extends State&lt;MyVideoPlayerPage&gt; {
    String myvideo;
    _MyVideoPlayerPageState(this.myvideo);
    VideoPlayerController _controller;
    Future&lt;void&gt; _initializeVideoPlayerFuture;
  
  
  
    @override
    void initState() {
      // TODO: implement initState
      super.initState();
      _controller = VideoPlayerController.network(
        //'http://ochapchap.com/public/propertyImage/1594746367.VID-20200713-WA0001.mp4'
      // 'http://techslides.com/demos/sample-videos/small.mp4',
        'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4'
      );
      _initializeVideoPlayerFuture = _controller.initialize();
      _controller.setLooping(true);
      _controller.setVolume(1);
    }
    @override
    void dispose() {
      _controller.dispose();
  
      super.dispose();
    }
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(&quot;Video&quot;),
        ),
        body: FutureBuilder(
          future: _initializeVideoPlayerFuture,
          builder: (context, snapshot) {
            if (snapshot.connectionState == ConnectionState.done) {
              // not wrapped in an AspectRatio widget
              return VideoPlayer(_controller);
            } else {
              return Center(child: CircularProgressIndicator());
            }
          },
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            print(myvideo);
            setState(() {
              if (_controller.value.isPlaying) {
                _controller.pause();
              } else {
                _controller.play();
              }
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>but when i put this flutter dev video plays like charm. link is <code>https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4</code>
  and my server link which does not play is <code>http://ochapchap.com/public/propertyImage/1594746367.VID-20200713-WA0001.mp4</code></p>
  <p>and error shown me on my link is</p>
  <pre><code>E/ExoPlayerImplInternal: Source error
        com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect
          at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:282)
          at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
          at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:956)
          at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
          at java.lang.Thread.run(Thread.java:919)
       Caused by: java.io.IOException: Cleartext HTTP traffic to ochapchap.com not permitted
          at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:124)
          at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
          at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
          at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:550)
          at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:454)
          at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:280)
          at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83) 
          at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:956) 
          at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:391) 
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
          at java.lang.Thread.run(Thread.java:919) 
  </code></pre>