title: Flutter is unable to display video
body: <pre><code>import 'package:video_player/video_player.dart';
  import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(VideoApp());
  class VideoApp extends StatefulWidget {
  @override
  _VideoAppState createState() =&gt; _VideoAppState();
  }
  class _VideoAppState extends State&lt;VideoApp&gt; {
  VideoPlayerController _controller;
  @override
  void initState() {
  super.initState();
  _controller = VideoPlayerController.network(
      'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4')
    ..initialize().then((_) {
      // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
      setState(() {});
    });
    }
  @override
  Widget build(BuildContext context) {
  return MaterialApp(
    title: 'Video Demo',
    home: Scaffold(
      body: Center(
        child: _controller.value.isInitialized
            ? AspectRatio(
                aspectRatio: _controller.value.aspectRatio,
                child: VideoPlayer(_controller),
              )
            : Container(),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          setState(() {
            _controller.value.isPlaying
                ? _controller.pause()
                : _controller.play();
          });
        },
        child: Icon(
          _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
        ),
      ),
    ),
  );
   }
   @override
   void dispose() {
  super.dispose();
  _controller.dispose();
  }
  }
  </code></pre>
  <p>Even though I had tried adding the dependencies and change the video link to a YouTube link instead, it still the same and does not display the video. May I know how to solve this problem? There are a few errors, I listed it as below:</p>
  <ol>
  <li>The method 'VideoPlayer' isn't defined for the type '_VideoAppState'</li>
  <li>Undefined name 'VideoPlayerController'.</li>
  <li>Undefined class 'VideoPlayerController'.</li>
  <li>Target of URI doesn't exist: 'package:video_player/video_player.dart'</li>
  </ol>
  <p>Pubspec.yml below</p>
  <pre><code>    name: icseat
  description: A new Flutter project.
  
  # The following line prevents the package from being accidentally published to
  # pub.dev using `pub publish`. This is preferred for private packages.
  publish_to: 'none' # Remove this line if you wish to publish to pub.dev
  
  # The following defines the version and build number for your application.
  # A version number is three numbers separated by dots, like 1.2.43
  # followed by an optional build number separated by a +.
  # Both the version and the builder number may be overridden in flutter
  # build by specifying --build-name and --build-number, respectively.
  # In Android, build-name is used as versionName while build-number used as versionCode.
  # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
  # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
  # Read more about iOS versioning at
  # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
  version: 1.0.0+1
  
  environment:
    sdk: &quot;&gt;=2.12.0 &lt;3.0.0&quot;
  
  dependencies:
    
    dio: ^4.0.0
    file_picker: ^4.0.0
    video_player:
    advance_pdf_viewer: ^2.0.0
    flutter:
      sdk: flutter
  
  
    # The following adds the Cupertino Icons font to your application.
    # Use with the CupertinoIcons class for iOS style icons.
    cupertino_icons: ^1.0.2
    http: ^0.13.0
  
  dev_dependencies:
    flutter_test:
      sdk: flutter
  
  # For information on the generic Dart part of this file, see the
  # following page: https://dart.dev/tools/pub/pubspec
  
  # The following section is specific to Flutter.
  flutter:
  
    # The following line ensures that the Material Icons font is
    # included with your application, so that you can use the icons in
    # the material Icons class.
    uses-material-design: true
  
    # To add assets to your application, add an assets section, like this:
    assets:
      - images/logoicseat.png
      - images/person.png
    #   - images/a_dot_burr.jpeg
    #   - images/a_dot_ham.jpeg
  
    # An image asset can refer to one or more resolution-specific &quot;variants&quot;, see
    # https://flutter.dev/assets-and-images/#resolution-aware.
  
    # For details regarding adding assets from package dependencies, see
    # https://flutter.dev/assets-and-images/#from-packages
  
    # To add custom fonts to your application, add a fonts section here,
    # in this &quot;flutter&quot; section. Each entry in this list should have a
    # &quot;family&quot; key with the font family name, and a &quot;fonts&quot; key with a
    # list giving the asset and other descriptors for the font. For
    # example:
    # fonts:
    #   - family: Schyler
    #     fonts:
    #       - asset: fonts/Schyler-Regular.ttf
    #       - asset: fonts/Schyler-Italic.ttf
    #         style: italic
    #   - family: Trajan Pro
    #     fonts:
    #       - asset: fonts/TrajanPro.ttf
    #       - asset: fonts/TrajanPro_Bold.ttf
    #         weight: 700
    #
    # For details regarding fonts from package dependencies,
    # see https://flutter.dev/custom-fonts/#from-packages
  </code></pre>
  <p>@Tommie C. The below are the errors that I experienced when running the codes:</p>
  <pre><code>Launching lib\View\Video.dart on sdk gphone x86 arm in debug mode...
  Running Gradle task 'assembleDebug'...
  √  Built build\app\outputs\flutter-apk\app-debug.apk.
  Installing build\app\outputs\flutter-apk\app.apk...
  Debug service listening on ws://127.0.0.1:57805/tl8ztZ-XWag=/ws
  Syncing files to device sdk gphone x86 arm...
  W/e.icseattestin( 4832): Accessing hidden method Landroid/media/AudioTrack;-&gt;getLatency()I (greylist, reflection, allowed)
  I/ExoPlayerImpl( 4832): Init bda4bd9 [ExoPlayerLib/2.14.1] [generic_x86_arm, sdk_gphone_x86_arm, Google, 30]
  I/Choreographer( 4832): Skipped 54 frames!  The application may be doing too much work on its main thread.
  I/OpenGLRenderer( 4832): Davey! duration=921ms; Flags=0, IntendedVsync=313961916316, Vsync=314861916280, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=314868026700, AnimationStart=314868094000, PerformTraversalsStart=314871530500, DrawStart=314873232800, SyncQueued=314874438400, SyncStart=314875924800, IssueDrawCommandsStart=314875998400, SwapBuffers=314879263000, FrameCompleted=314885090400, DequeueBufferDuration=1230100, QueueBufferDuration=3509200, GpuCompleted=0, 
  I/TetheringManager( 4832): registerTetheringEventCallback:com.example.icseattesting
  I/VideoCapabilities( 4832): Unsupported profile 4 for video/mp4v-es
  I/OMXClient( 4832): IOmx service obtained
  D/SurfaceUtils( 4832): connecting to surface 0xe4d1c578, reason connectToSurface
  I/MediaCodec( 4832): [OMX.android.goldfish.h264.decoder] setting surface generation to 4947969
  D/SurfaceUtils( 4832): disconnecting from surface 0xe4d1c578, reason connectToSurface(reconnect)
  D/SurfaceUtils( 4832): connecting to surface 0xe4d1c578, reason connectToSurface(reconnect)
  E/ACodec  ( 4832): [OMX.android.goldfish.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
  I/ACodec  ( 4832): codec does not support config priority (err -1010)
  D/SurfaceUtils( 4832): disconnecting from surface 0xe4d1c578, reason setNativeWindowSizeFormatAndUsage
  D/SurfaceUtils( 4832): connecting to surface 0xe4d1c578, reason setNativeWindowSizeFormatAndUsage
  D/SurfaceUtils( 4832): set up nativeWindow 0xe4d1c578 for 1280x720, color 0x13, rotation 0, usage 0x1002900
  W/Gralloc4( 4832): allocator 3.x is not supported
  Lost connection to device.
  </code></pre>