fluttercommunity / chewie Goto Github PK
View Code? Open in Web Editor NEWThe video player for Flutter with a heart of gold
License: MIT License
The video player for Flutter with a heart of gold
License: MIT License
Hi,
It doesn't say in the docs what types of video it supports - does it support HLS and DASH playback? Is this planned?
Thanks for the package!
ios the video player has sound but no image
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.
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
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
Code needs a good refactor / clean up.
new VideoPlayerController.asset(
"assets/videos/test.mp4",
local videos crash...
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).
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)
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.
cupertino_controls.dart and material_controls.dart need to update .please tell me how to do...
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.
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.
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.
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)
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.
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.
My video prompts an error when playing repeatedly. The position of the progress bar.
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.
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.
aspectRatio causes my video to be distorted I can't find a better solution
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!
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!
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 :)
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,
);
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!
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)
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.
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.
How should I customize the style of Controls, please give me a hint, thank you.
No image show on Samsung tab 10 214 edition, just audio. works well on emulator.
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
Can you update your version constraint? It's currently set at:
"<2.0.0"
The most recent stable version of Dart, as far as I know, is 2.1.0
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?
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.
Can HLS be supported?
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.
Can't play m3u8 ? When can I update support for video_player version 0.5.3 or later?
Need to update the Full Screen Cupertino views when in Portrait mode
@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
.
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),
],
),
),
),
);
}
}
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.
I receive this error.
Because flutter_app depends on chewie ^0.7.0 which depends on video_player ^0.6.0, video_player ^0.6.0 is required. So, because flutter_app depends on video_player ^0.7.2, version solving failed.
The issue #48 has occurred on my android devices with follow instruction appear continuously on terminal
E/MALI (16638): _essl_run_frontend:218: [MALI] Parse translation unit failed (1, 0)
Device sleep when playing video in fullscreen, there is https://pub.dartlang.org/packages/screen, and it's should be like 1 line to add :)
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.
Sorry for asking this here, but does chewie handle audio files like mp3?
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"),
),
),
)
],
)
],
),
),
);
}
}
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.
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.
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
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,
),
),
);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.