title: Streaming videos from firebase storage in flutter
body: <p>To play a video in Flutter, you have to instantiate its Url in the init() method.
  So How to get a list of video Url's from Firestore?
  If I retrieve the Url from Firestore in the form of Future then the Video player is not accepting it because it accepts only String and and not Future objects.</p>
  
  <pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
  import 'package:flutter/material.dart';
  import 'package:video_player/video_player.dart';
  import 'package:chewie/chewie.dart';
  
  
  class VideoScreen extends StatefulWidget {
    VideoScreen({this.studentName});
    final String studentName;
    @override
    _VideoScreenState createState() =&gt; _VideoScreenState();
  }
  
  class _VideoScreenState extends State&lt;VideoScreen&gt; {
  
    VideoPlayerController videoPlayerController;
    @override
    void initState() {
     videoPlayerController = VideoPlayerController.network('${getU()}');
  
      super.initState();
    }
  
  
    @override
    Widget build(BuildContext context) {
      final chewieController = ChewieController(
        videoPlayerController: videoPlayerController,
        aspectRatio: 3 / 2,
        autoPlay: true,
        looping: true,
      );
      final playerWidget = Chewie(
        controller: chewieController,
      );
      return playerWidget;
    }
    Future&lt;String&gt; getU() async {
      var document = await Firestore.instance.collection('Students')
          .document('Badri');
      var url = document.get().then((documents) {
        print('video url: ${documents['video']}');
        return documents['video'];
      }
      );
      return url;
    }
  }
  </code></pre>
  
  <p>error coming is - </p>
  
  <pre><code>W/ykiddypijourna(28557): Accessing hidden method Landroid/media/AudioTrack;-&gt;getLatency()I (light greylist, reflection)
  I/ExoPlayerImpl(28557): Init 77e7389 [ExoPlayerLib/2.9.6] [beryllium, POCO F1, Xiaomi, 28]
  E/ExoPlayerImplInternal(28557): Source error.
  E/ExoPlayerImplInternal(28557): com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to Instance of 'Future&lt;String&gt;'
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:281)
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:83)
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:885)
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:381)
  E/ExoPlayerImplInternal(28557):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
  E/ExoPlayerImplInternal(28557):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
  E/ExoPlayerImplInternal(28557):     at java.lang.Thread.run(Thread.java:764)
  E/ExoPlayerImplInternal(28557): Caused by: java.net.MalformedURLException: no protocol: Instance of 'Future&lt;String&gt;'
  E/ExoPlayerImplInternal(28557):     at java.net.URL.&lt;init&gt;(URL.java:601)
  E/ExoPlayerImplInternal(28557):     at java.net.URL.&lt;init&gt;(URL.java:498)
  E/ExoPlayerImplInternal(28557):     at java.net.URL.&lt;init&gt;(URL.java:447)
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:426)
  E/ExoPlayerImplInternal(28557):     at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:279)
  E/ExoPlayerImplInternal(28557):     ... 6 more
  </code></pre>