GithubHelp home page GithubHelp logo

fluttercommunity / chewie Goto Github PK

View Code? Open in Web Editor NEW
1.9K 1.9K 984.0 37.29 MB

The video player for Flutter with a heart of gold

License: MIT License

Objective-C 0.03% Dart 99.17% HTML 0.15% Kotlin 0.10% Swift 0.56%
flutter video-player

chewie's Introduction

Flutter Community

Flutter Community

A central place for community made Flutter content.


The Flutter Community is an organization aimed at providing a central place for community made Flutter packages and content to live.

Our goal is to ensure packages made by the Flutter community are kept alive and maintained in one place.

Medium Articles

To go along with the packages, we have started a Medium publication as a central location for community content to be published - especially if it relates to the packages here.

https://medium.com/flutter-community

Packages

These are the packages featured on the Flutter Community.

Name Release Description Maintainer
android_alarm_manager_plus Pub Flutter plugin for accessing the Android AlarmManager service, and running Dart code in the background when alarms fire. Miguel Beltran
android_id Pub Flutter plugin for retrieving the Android ID. Not supported on iOS. Joachim Nohl
android_intent_plus Pub Flutter plugin for launching Android Intents. Not supported on iOS. Miguel Beltran
app_review Pub Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Rody Davis
backdrop Pub Backdrop implementation in dart. (https://material.io/design/components/backdrop.html) Harsh Bhikadia
breakpoint Pub A Flutter plugin to calculate the material design breakpoints. Rody Davis
sealed_unions Pub Sealed Unions for Dart George Medve
firestore_helpers Pub Firestore helper function to create dynamic and location based queries Thomas Burkhart
draggable_scrollbar Pub A scrollbar that can be dragged for quickly navigation through a vertical list. Additional option is showing label next to scrollthumb with information about current item. Marina Kuznetsova
after_layout Pub Execute code after the first layout of your widget has been performed, i.e. after the first frame has been displayed. Simon Lightfoot
flutter_blurhash Pub Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium Robert Felker
contacts_service Pub A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Lukas Dickie
flutter_downloader Pub A plugin for creating and managing download tasks. Supports iOS and Android. Hung Duy Ha
flutter_google_places Pub Google places autocomplete widgets for flutter. No wrapper, use https://pub.dartlang.org/packages/google_maps_webservice Kev Morelli
infinite_listview Pub ListView with items that can be scrolled infinitely in both directions. Simon Lightfoot
flutter_launcher_icons Pub A package which simplifies the task of updating your Flutter app's launcher icon. Mark O'Sullivan
flutter_sms Pub A Flutter plugin to Send SMS and MMS on iOS and Android. If iMessage is enabled it will send as iMessage on iOS. This plugin must be tested on a real device on iOS. Rody Davis
sticky_headers Pub Flutter Sticky Headers - Lets you place headers on scrollable content that will stick to the top of the container whilst the content is scrolled. Simon Lightfoot
flutter_uploader Pub A plugin for creating and managing upload tasks with optional background exection support. Sebastian Roth
wear Pub A plugin that offers Flutter support for Wear OS by Google NO MAINTAINER PROVIDED
flutter_webview_plugin Pub Plugin that allow Flutter to communicate with a native Webview. Rafal Wachol
flutter_whatsnew Pub A new Flutter package to show updates to users. Rody Davis
workmanager Pub Flutter Workmanager. This plugin allows you to schedule background work on Android and iOS. NO MAINTAINER PROVIDED
font_awesome_flutter Pub The Font Awesome Icon pack available as Flutter Icons. Provides 1500 additional icons to use in your apps. Brian Egan
get_it Pub Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App" Thomas Burkhart
get_version Pub Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Rody Davis
import_sorter Pub Automatically sort all your dart imports. Support for any dart project. Matthew Gleich
native_widgets Pub A new Flutter package for using Android and iOS natively on each platform. Rody Davis
page_turn Pub Page Turn Widget - Add a page turn effect to widgets in your app. Rody Davis
persist_theme Pub A flutter plugin for persisting the theme data. Support for Dark Mode. Rody Davis
redux Pub Redux is a predictable state container for Dart and Flutter apps John Ryan
redux_undo Pub Make your redux store undo- and redoable. Inspired by the JS redux_undo package. Michel Engelen
responsive_scaffold Pub On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item. Rody Davis
rx_command Pub Reactive event handler wrapper class inspired by ReactiveUI. Thomas Burkhart
state_persistence Pub Persist state across app launches. By default this library store state as a local JSON file called data.json in the applications data directory. Simon Lightfoot

Submitting your packages

If you'd like to submit your package to the Flutter Community GitHub organization, please see the Flutter Community Transfer Guide.

Getting in contact

For any questions regarding the Flutter Community, please open an issue on the /community repository.

Note to packages owners

Flutter Community aims to bring the best community-made packages forward. Because of this, not all proposed packages will be accepted.

chewie's People

Contributors

ahmadre avatar brianegan avatar buginrug avatar cbenhagen avatar creativecreatorormaybenot avatar daohoangson avatar diegotori avatar ekuleshov avatar emredet avatar erickok avatar hasanm08 avatar henri2h avatar jcquintas avatar jeremiahlukus avatar jweidner-mbible avatar koutaro-masaki avatar kronos-2701 avatar localpcguy avatar luis901101 avatar magaroo avatar maherjaafar avatar manikandn avatar mideb avatar nstrelow avatar pratik-7span avatar shakyacsun avatar shiyiya avatar toddzeil avatar vaishnavi-2301 avatar ycv005 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chewie's Issues

Video doesn't play in full screen

Hi,
I have an issue when I click the icon to play in full screen.
It shows a play button but it doesn't work and when I click back I can see the error on the screen and console.

I'm copying the erro in case I'm missing something

I/ViewRootImpl(21950): ViewRoot's Touch Event : ACTION_DOWN I/ViewRootImpl(21950): ViewRoot's Touch Event : ACTION_UP E/flutter (21950): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter (21950): A VideoPlayerController was used after being disposed. E/flutter (21950): Once you have called dispose() on a VideoPlayerController, it can no longer be used. E/flutter (21950): #0 ChangeNotifier._debugAssertNotDisposed.<anonymous closure> (package:flutter/src/foundation/change_notifier.dart:61:9) E/flutter (21950): #1 ChangeNotifier._debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:67:6) E/flutter (21950): #2 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:155:12) E/flutter (21950): #3 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:217:5) E/flutter (21950): #4 VideoPlayerController.play (package:video_player/video_player.dart:223:5) E/flutter (21950): <asynchronous suspension> E/flutter (21950): #5 _MaterialControlsState._playPause.<anonymous closure> (package:chewie/src/material_controls.dart:288:29) E/flutter (21950): #6 State.setState (package:flutter/src/widgets/framework.dart:1125:30) E/flutter (21950): #7 _MaterialControlsState._playPause (package:chewie/src/material_controls.dart:275:5) E/flutter (21950): #8 _MaterialControlsState._buildHitArea.<anonymous closure> (package:chewie/src/material_controls.dart:122:17) E/flutter (21950): #9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24) E/flutter (21950): #10 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9) E/flutter (21950): #11 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7) E/flutter (21950): #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9) E/flutter (21950): #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12) E/flutter (21950): #14 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11) E/flutter (21950): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19) E/flutter (21950): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22) E/flutter (21950): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7) E/flutter (21950): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7) E/flutter (21950): #19 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7) E/flutter (21950): #20 _invoke1 (dart:ui/hooks.dart:134:13) E/flutter (21950): #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)

Regards

Better Cupertino Icons

Looks like the Flutter team has some Cupertino icons in a font, but does not expose all of them yet. Watch for updates to the Flutter repo and use the better icons when available.

Controller '.dispose' explicit call never works

I am trying to play multiple videos one after the other by clicking thumbnails. More like a youtube kinda flow. I am aware to stop current video from playing (as I have to open the different video) I have to use following.
videoController.pause()
videoController.dispose()

These don't work, and the old video keeps playing in background after opening new video.

I also tried
@override void dispose() { videoController.dispose(); super.dispose(); }

in the main life cycle.

Buffering UI

If the video is buffering but not playing, show some UI to let the user know. Currently, there isn't much info coming back from the Controller of when the video is in this state. Need to find a way to determine this.

updated video player 0.7.5

has Exception

I/dalvikvm( 5366): Could not find method android.graphics.SurfaceTexture.setOnFrameAvailableListener, referenced from method io.flutter.view.FlutterView$SurfaceTextureRegistryEntry.
W/dalvikvm( 5366): VFY: unable to resolve virtual method 697: Landroid/graphics/SurfaceTexture;.setOnFrameAvailableListener (Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;Landroid/os/Handler;)V
D/dalvikvm( 5366): VFY: replacing opcode 0x6e at 0x0015
E/flutter ( 5366): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(40)] java.lang.NoSuchMethodError: android.graphics.SurfaceTexture.setOnFrameAvailableListener
E/flutter ( 5366): at io.flutter.view.FlutterView$SurfaceTextureRegistryEntry.(FlutterView.java:969)
E/flutter ( 5366): at io.flutter.view.FlutterView.createSurfaceTexture(FlutterView.java:955)
E/flutter ( 5366): at io.flutter.plugins.videoplayer.VideoPlayerPlugin.onMethodCall(VideoPlayerPlugin.java:291)
E/flutter ( 5366): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:191)
E/flutter ( 5366): at io.flutter.view.FlutterNativeView.handlePlatformMessage(FlutterNativeView.java:163)
E/flutter ( 5366): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 5366): at android.os.MessageQueue.next(MessageQueue.java:138)
E/flutter ( 5366): at android.os.Looper.loop(Looper.java:150)
E/flutter ( 5366): at android.app.ActivityThread.main(ActivityThread.java:5323)
E/flutter ( 5366): at java.lang.reflect.Method.invokeNative(Native Method)
E/flutter ( 5366): at java.lang.reflect.Method.invoke(Method.java:515)
E/flutter ( 5366): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
E/flutter ( 5366): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
E/flutter ( 5366): at dalvik.system.NativeStart.main(Native Method)
E/flutter ( 5366):
F/flutter ( 5366): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(77)] Check failed: CheckException(env).
F/libc ( 5366): Fatal signal 6 (SIGABRT) at 0x000014f6 (code=-6), thread 5366 (ive.mysterylive)
handle_request(15)

Fullscreen aspect ratio

Hi!
When switching fullscreen the aspect ratio is not respected, the video is always strechted to the size of the screen

If the videoplayer is wrapped in a AspectRatio also with the condition "widget.fullScreen && MediaQuery.of(context).orientation == Orientation.landscape" in "player_with_controls.dart" then the aspect ratio seems to be preserved

Thank you!

Fullscreen mode by default

Hello.

I am trying to figure out how to load a video in fullscreen mode by default.
How would you do it?
Thanks in advance.

video can not play on iOS device

this demo can run on android phone all right ,but can not play video on iOS devices. and notes that:Failed to load video:the operation could not completed

Chewie not render video when change controller

I have a problem with chewie. When I change the controller, chewie play the audio but not show the video. If I click on fullscreen and after, go back, the video is show correctly.
I have tried in Android v5.0 and emulator. the code is the same of the example.

import 'package:chewie/chewie.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(
    new ChewieDemo(),
  );
}

class ChewieDemo extends StatefulWidget {
  final String title;

  ChewieDemo({this.title = 'Chewie Demo'});

  @override
  State<StatefulWidget> createState() {
    return new _ChewieDemoState();
  }
}

class _ChewieDemoState extends State<ChewieDemo> {
  TargetPlatform _platform;
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = new VideoPlayerController.network(
      'https://github.com/flutter/assets-for-api-docs/blob/master/assets/videos/butterfly.mp4?raw=true',
    );
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: widget.title,
      theme: new ThemeData.light().copyWith(
        platform: _platform ?? Theme.of(context).platform,
      ),
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text(widget.title),
        ),
        body: new Column(
          children: <Widget>[
            new Expanded(
              child: new Center(
                child: new Chewie(
                  _controller,
                  aspectRatio: 3 / 2,
                  autoPlay: true,
                  looping: true,

                  // Try playing around with some of these other options:

                  // showControls: false,
                  // materialProgressColors: new ChewieProgressColors(
                  //   playedColor: Colors.red,
                  //   handleColor: Colors.blue,
                  //   backgroundColor: Colors.grey,
                  //   bufferedColor: Colors.lightGreen,
                  // ),
                  // placeholder: new Container(
                  //   color: Colors.grey,
                  // ),
                  // autoInitialize: true,
                ),
              ),
            ),
            new Row(
              children: <Widget>[
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _controller = new VideoPlayerController.network(
                          'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
                        );
                      });
                    },
                    child: new Padding(
                      child: new Text("Video 1"),
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                    ),
                  ),
                ),
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _controller = new VideoPlayerController.network(
                          'http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_20mb.mp4',
                        );
                      });
                    },
                    child: new Padding(
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                      child: new Text("Video 2"),
                    ),
                  ),
                )
              ],
            ),
            new Row(
              children: <Widget>[
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _platform = TargetPlatform.android;
                      });
                    },
                    child: new Padding(
                      child: new Text("Android controls"),
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                    ),
                  ),
                ),
                new Expanded(
                  child: new FlatButton(
                    onPressed: () {
                      setState(() {
                        _platform = TargetPlatform.iOS;
                      });
                    },
                    child: new Padding(
                      padding: new EdgeInsets.symmetric(vertical: 16.0),
                      child: new Text("iOS controls"),
                    ),
                  ),
                )
              ],
            )
          ],
        ),
      ),
    );
  }
}

Fade between placeholder and first video frame

Right now it goes from placeholder to black to first frame which looks pretty crappy. Maybe we can't do much about the first frame being black but fading would at least make the experience a lot smoother.

Hide or disable progress bar

Hello, how can I hide the progress bar, since I'm streaming live video and dont need it.
I have commented "_buildPosition" and "_buildProgressBar" but It'st really hacky and mess with controls distribution.

Could you add that feature?
Thank you.

Get onClickListener for play button.

Am new to flutter and dart.
Is there any delegate method or any OnClickListener method when tapping play button.
On Pressed of floating button is not working properly.
I tried to add Gesture too.

import 'package:chewie/chewie.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:flutter/services.dart';



class ChewieDemo extends StatefulWidget {
  final String title;

  ChewieDemo({this.title = 'Chewie Demo'});

  @override
  _ChewieDemoState createState() => new _ChewieDemoState();
}

class _ChewieDemoState extends State<ChewieDemo> {
  TargetPlatform _platform = TargetPlatform.android;
  VideoPlayerController _controller;




  @override
  void initState() {
    super.initState();
    _platform = TargetPlatform.android;
    _controller = new VideoPlayerController.network(
      'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
    );

  }

  @override
  void didUpdateWidget(ChewieDemo oldWidget) {
    print("didUpdateWidget");
    new SimpleDialog(
      title: const Text('Select assignment'),
      children: <Widget>[
        new SimpleDialogOption(
          onPressed: () {
            //  Navigator.pop(context, Department.treasury);
          },
          child: const Text('Treasury department'),
        ),
        new SimpleDialogOption(
          onPressed: () {
            //Navigator.pop(context, Department.state);
          },
          child: const Text('State department'),
        ),
      ],
    );
    // TODO: implement didUpdateWidget
    super.didUpdateWidget(oldWidget);
  }

  @override
  Widget build(BuildContext context) {
    double width = MediaQuery.of(context).size.width;
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: new Column(
        children: <Widget>[
          new Chewie(
            _controller,
            aspectRatio: 3 / 2,
            autoPlay: false,
            looping: true,
            autoInitialize: true,
            materialProgressColors: new ChewieProgressColors(
              playedColor: Colors.red,
              handleColor: Colors.blue,
              backgroundColor: Colors.grey,
              bufferedColor: Colors.lightGreen,
            ),
          ),
        ],
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed:
            _controller.value.isPlaying ? _controller.pause : _controller.play,
        child: new Icon(
          _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
        ),
      ),
    );
  }
}

Buffering event and listener

I am pretty impressed with this player and have started using it already, however I don't see how I can implement the circle indicator when the video is buffering. I mean, there's no callback property as such where I can use a stack to show/hide indicator on top.

List of video players

Is there easy way to make list of video players? I want to show up more than 1 video. I tried this:

void main() {
  runApp(
    new ChewieDemo(controller:[
       new VideoPlayerController('https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'),
       new VideoPlayerController('https://flutter.github.io/assets-for-api-docs/videos/bee.mp4'),
    ]),
  );
}

class ChewieDemo extends StatefulWidget {
  final String title;
  final List <VideoPlayerController> controller;

But widget.controller gives error with argument type List. Could you help me?

Isuue with VideoPlayerController

compiler message: lib/main.dart:67:9: Error: Method not found: 'VideoPlayerController'.
compiler message:     new VideoPlayerController(
compiler message:         ^^^^^^^^^^^^^^^^^^^^^
  final playerWidget = new Chewie(

    new VideoPlayerController(
        'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4'
    ),
    aspectRatio: 3 / 2,
    autoPlay: true,
    looping: true,
  );

local video

new VideoPlayerController.asset(
      "assets/videos/test.mp4",

local videos crash...

RTMP Player

Hi! I need to play an RTMP stream (I don't want to use hls) but I don't find the way for doing that. How I can play it with Flutter?

Thanks!

Full Screen: Use Landscape mode

When transitioning to Full screen, we should force screen rotation and use the entire size of the screen, at least on Android (need to check what iOS does here).

ios don't support m3u8

cupertino_controls.dart and material_controls.dart need to update .please tell me how to do...

Hide play button until video has loaded

With a network video, sometimes the video can take a couple seconds to load. The play button still shows up during this time and the user can press it. I can use a placeholder to show a CircularProgressIndicator but the play button sits in front of it, hiding it.

It would be great if the play button was hidden until the video had finished loading/initializing.

Launch video in fullscreen through a custom button.

Hello,
I wanted to hide the video controls and alternatively launch the video in fullscreen when the user clicks on a specific button. I know that you can hide the controls through showControls attribute but I was wondering if there was anything to change the video to fullscreen. I do not think that the video_player plugin has anything of such functionality either although it does have a setVolume property which is missing in chewie. I was hoping if you knew anything about setting the video to fullscreen without relying on the video controls or could create such functionality.
Thank You.

Video player throws error when put in ListView and scrolled past really quickly

When the video is part of a list and you scroll to it very quickly, it throws an error and the interface becomes red.

Code to reproduce:

import 'package:flutter/material.dart';
import 'package:chewie/chewie.dart';
import 'package:video_player/video_player.dart';


class Media extends StatefulWidget {
  @override
  MediaState createState() {
    return new MediaState();
  }
}

class MediaState extends State<Media> {
  VideoPlayerController _controller;


  @override
  void initState() {
    super.initState();
    _controller = new VideoPlayerController.network(
      'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Media"),
        actions: <Widget>[],
      ),
      //TODO: Add a grid view (102)
      body: new ListView(
        children: <Widget>[
          Chewie(
            _controller,
            aspectRatio: 1280 / 720,
            autoPlay: false,
            looping: false,
          ),
          new Column(
            children: List.generate(20, (index) {
              return feedCard();
            }),
          ),
        ],
      ),
    );
  }

  Widget feedCard() {
    return new Card(
      child: new Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          ListTile(
            leading: Icon(Icons.ondemand_video),
            title: Text('The Enchanted Nightingale',
                style: TextStyle(fontWeight: FontWeight.bold)),
            subtitle: Column(
              children: <Widget>[
                Text('Video by Julie Gable. Lyrics by Sidney Stein.'),
                Align(
                  alignment: Alignment.bottomLeft,
                  child: Text('Sunday 5th July, 2020',
                      style: TextStyle(fontStyle: FontStyle.italic)),
                ),
              ],
            ),
          ),
          new ButtonTheme.bar(
            // make buttons use the appropriate styles for cards
            child: new ButtonBar(
              children: <Widget>[
                new FlatButton(
                  child: const Text('Download'),
                  onPressed: () {/* ... */},
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

I/flutter ( 6193): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6193): The following assertion was thrown building Chewie(state: _ChewiePlayerState#17748):
I/flutter ( 6193): A VideoPlayerController was used after being disposed.
I/flutter ( 6193): Once you have called dispose() on a VideoPlayerController, it can no longer be used.
I/flutter ( 6193): When the exception was thrown, this was the stack:
I/flutter ( 6193): #0      ChangeNotifier._debugAssertNotDisposed.<anonymous closure> (package:flutter/src/foundation/change_notifier.dart:61:9)
I/flutter ( 6193): #1      ChangeNotifier._debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:67:6)
I/flutter ( 6193): #2      ChangeNotifier.addListener (package:flutter/src/foundation/change_notifier.dart:97:12)
I/flutter ( 6193): #3      _VideoPlayerWithControlsState.initState (package:chewie/src/player_with_controls.dart:114:23)
I/flutter ( 6193): #4      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3751:58)
I/flutter ( 6193): #5      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
I/flutter ( 6193): #6      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #7      Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #8      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3653:16)
I/flutter ( 6193): #9      Element.rebuild (package:flutter/src/widgets/framework.dart:3495:5)
I/flutter ( 6193): #10     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3622:5)
I/flutter ( 6193): #11     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3769:11)
I/flutter ( 6193): #12     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
I/flutter ( 6193): #13     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #15     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4654:14)
I/flutter ( 6193): #16     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #17     Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3653:16)
I/flutter ( 6193): #19     Element.rebuild (package:flutter/src/widgets/framework.dart:3495:5)
I/flutter ( 6193): #20     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3622:5)
I/flutter ( 6193): #21     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
I/flutter ( 6193): #22     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #23     Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #24     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3653:16)
I/flutter ( 6193): #25     Element.rebuild (package:flutter/src/widgets/framework.dart:3495:5)
I/flutter ( 6193): #26     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3622:5)
I/flutter ( 6193): #27     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
I/flutter ( 6193): #28     ParentDataElement.mount (package:flutter/src/widgets/framework.dart:3955:11)
I/flutter ( 6193): #29     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #31     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3653:16)
I/flutter ( 6193): #32     Element.rebuild (package:flutter/src/widgets/framework.dart:3495:5)
I/flutter ( 6193): #33     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3622:5)
I/flutter ( 6193): #34     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3769:11)
I/flutter ( 6193): #35     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5)
I/flutter ( 6193): #36     Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14)
I/flutter ( 6193): #37     Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12)
I/flutter ( 6193): #38     SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:744:36)
I/flutter ( 6193): #39     SliverMultiBoxAdaptorElement.createChild.<anonymous closure> (package:flutter/src/widgets/sliver.dart:729:20)
I/flutter ( 6193): #40     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2222:19)
I/flutter ( 6193): #41     SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:722:11)
I/flutter ( 6193): #42     RenderSliverMultiBoxAdaptor._createOrObtainChild.<anonymous closure> (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:254:23)
I/flutter ( 6193): #43     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1666:58)
I/flutter ( 6193): #44     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:740:15)
I/flutter ( 6193): #45     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1666:13)
I/flutter ( 6193): #46     RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:243:5)
I/flutter ( 6193): #47     RenderSliverMultiBoxAdaptor.insertAndLayoutLeadingChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:352:5)
I/flutter ( 6193): #48     RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:99:29)
I/flutter ( 6193): #49     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6193): #50     RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:182:11)
I/flutter ( 6193): #51     RenderObject.layout (package:flutter/src/rendering/object.dart:1570:7)
I/flutter ( 6193): #52     RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:336:13)
I/flutter ( 6193): #53     RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1131:12)
I/flutter ( 6193): #54     RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1049:20)
I/flutter ( 6193): #55     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1445:7)
I/flutter ( 6193): #56     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:709:18)
I/flutter ( 6193): #57     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:270:19)
I/flutter ( 6193): #58     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:627:13)
I/flutter ( 6193): #59     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5)
I/flutter ( 6193): #60     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 6193): #61     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 6193): #62     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter ( 6193): #63     _invoke (dart:ui/hooks.dart:120:13)
I/flutter ( 6193): #64     _drawFrame (dart:ui/hooks.dart:109:3)

Feature Request: Hide video box when media is audio only

Chewie does a great job handling audio-only files; however, there should be a way to make chewie disable the video display box when media is an audio-only file.

This could be implemented as a flag to the chewie constructor so that only the audio controls are shown or so that no controls are shown at all.

I'll see if I can implement it myself and issue a pull request.

Strange size issue

@brianegan do you see a reason why 1px of the video can be seen on the left side? This does not happen if use the VideoPlayer.

screenshot_1530200866

bildschirmfoto 2018-06-28 um 17 53 38

import 'package:chewie/chewie.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(
    ChewieDemo(),
  );
}

class ChewieDemo extends StatefulWidget {
  final String title;

  ChewieDemo({this.title = 'Chewie Demo'});

  @override
  State<StatefulWidget> createState() {
    return _ChewieDemoState();
  }
}

class _ChewieDemoState extends State<ChewieDemo> {
  TargetPlatform _platform;
  VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(
      'https://flutter.github.io/assets-for-api-docs/videos/butterfly.mp4',
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: widget.title,
      theme: ThemeData.light().copyWith(
            platform: _platform ?? Theme.of(context).platform,
          ),
      home: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Padding(
          padding: EdgeInsets.all(20.0),
          child: Stack(
            children: [
              Chewie(
                _controller,
                autoPlay: true,
                looping: true,
              ),
              Container(color: Colors.white),
            ],
          ),
        ),
      ),
    );
  }
}

Use of the VideoPlayerController inside Chewie

I have two questions about chewie (which are tecnically speaking not 'issues') that i feel like would not make sense on github or gitter because of their specific nature. It would be great if you could help me out here! :)

That said, my current structure is simplified the following

new FutureBuilder<DocumentSnapshot>(
...
new Chewie(
	controller,
	aspectRatio: 16 / 9,
	autoPlay: true,
	looping: false,
	placeholder: new Container(
	color: Colors.grey,
	),
	autoInitialize: true,
),
),
...
  @override
  void initState() {
    controller = new VideoPlayerController(
        'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4');

    super.initState();
  }

As seen above, the controller is outsiede the scope of the Futurebuilder, so no data from the DocumentSnapshot can be used as a parameter for the VideoPlayerController.

So now my question: is it possible to implement the VideoPlayerController inside the Chewie widget, or can I maybe pass a value from the FutureBuilder down to the VideoPlayerController any other way? Any help would be highly appreciated!

On a sidenote, do you know whether it is possible to rotate the currently watched video into landscape mode as soon as the Fullscreen mode is activated? This way more screen real estate would be used and the user would be incentivised to rotate his/her device.

chewie does not respect previous UI orientation

When chewie enters Fullscreen mode, it set the preferred Orientation to landscape mode.
when you exits fullscree, chewie sets the preferred orientation ot portrait as well as landscape.

It is fine to have landscape mode for the video, but if you had your app set to portrait mode only before, after leaving fullscreen video mode, the app will be available in landscape mode again, which might not be intended.

chewie should respect the previous orientation mode.

Two parameters not defined after flutter packer upgrade

After the use of Flutter Packages upgrade the parameters handleColor and disabledColor of progressColors: new VideoProgressColors(..) are not defined, although they are described in the example as "Try playing around with some of these other options".
Are they simply no longer necessary or is this a bug? Thanks anyway for the awesome chewie package!

Fullscreen events

Hello, is there any way to access the events when the video comes out of full screen?
Because my application runs in full screen and leaves it when I leave a video in full screen.
I need my application to return to full screen.
Thanks!
Sorry for my english.

not competitive with video_player version

Hello.
Your lib not working in newest video_player version, plz update it. Thanks you
Because chewie 0.3.0 depends on video_player ^0.2.0 and no versions of chewie match >0.3.0 <0.4.0, chewie ^0.3.0 requires video_player ^0.2.0.
So, because icamerasolution depends on both video_player ^0.5.3 and chewie ^0.3.0, version solving failed.
pub get failed (1)

How to implement onVideoCompletion Callback ?? Help Required

After watch video I have to mark it watched so I need a onCompletion Callback. I tried with listener as `class _ChewieDemoState extends State {
TargetPlatform _platform;
VideoPlayerController _controller;
VoidCallback listener;
bool isCompeleted = false;

@OverRide
void initState() {
super.initState();
_controller = new VideoPlayerController.network(
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4',
);
listener = () {
// if (!mounted) {
// return;
// }
//debugPrint("listening .....");

  if(_controller.value.duration!=null){
    debugPrint("duration"+_controller.value.duration.inMilliseconds.toString()+" _ position _"+"duration"+_controller.value.position.inMilliseconds.toString());
    //debugPrint(_controller.value.position.inMilliseconds.toString());
    if(_controller.value.duration.inMilliseconds==_controller.value.position.inMilliseconds){
      debugPrint("competed .....");
      _controller.removeListener(listener);
    }

  }

// if (isCompeleted == _controller.value.completed) {
// initialized = _controller.value.initialized;
// setState(() {});
// }
};
_controller.addListener(listener);

}`

But it don't work and _controller.value.duration.inMilliseconds and _controller.value.position.inMilliseconds never become same ,quite surprising why ? Thanks in advance

Help: CoMaintainer needed!

Hey all! I've been getting more and more issues on this library, but don't have a much time to work on Chewie at the moment. I'm looking for someone who is willing to help maintain Chewie so we can help support folks and fix bugs at a faster rate!

If you're interested, please respond to this issue and we'll go from there :)

Fullscreen on landsacpe

It would be nice if the player could automatically switch to fullscreen mode when the device is currently in (or when being rotated to) landscape mode.

Can't play m3u8

Can't play m3u8 ? When can I update support for video_player version 0.5.3 or later?

videoplayer has error com.google.android.exoplayer2 ExoPlaybackException

My video prompts an error when playing repeatedly. The position of the progress bar.
image
It's normal at the beginning, and I will have this problem when I open the video frequently.

I/ExoPlayerImpl(22488): Release a840477 [ExoPlayerLib/2.8.0] [HWRNE, RNE-L22, HUAWEI, 26] [goog.exo.core]

E/ExoPlayerImplInternal(22488): Caused by: android.media.MediaCodec$CodecException: start failed
E/ExoPlayerImplInternal(22488): at android.media.MediaCodec.native_start(Native Method)
E/ExoPlayerImplInternal(22488): at android.media.MediaCodec.start(MediaCodec.java:2063)
E/ExoPlayerImplInternal(22488): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:421)
E/ExoPlayerImplInternal(22488): ... 8 more
E/ExoPlayerImplInternal(22488): Stop failed.

Some vids only work in Full Screen

Reported via email:

I love this package, however I have had an issue where some links only work in fullscreen mode. I'm testing on an android.

Links such as this work fine with the video player plugin but not in chewie. When I hit play the UI disappears and then when I can accidentally tap where the fullscreen should be the video will work in fullscreen mode.

https://i.imgur.com/TKL8h8J.mp4

Update Video_player

Hi can you update video_player to as there is an issue with IOS in the 0.6.4 version and using Chewie always loads the 0.6.4 version.
video_player: git: url: https://github.com/recastrodiaz/plugins.git path: packages/video_player ref: f0ade3cf3e366ec1e93139458f2bdf32d243b2be version: ^0.6.5

onCompletionListener callback

Hi.

In the current state of the plugin is it possible to set a callback function to be called on finished video playing? The listener for VideoPlayerController does not seem to help a lot. I tried to make it somehow work, but it is not always called in Android.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.