geekyants / flick-video-player Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
So, I'm using image_picker package to pick a video file, and show with video_player package, based on the example code of image_picker repo
I see the different examples of Flick Video Player, and I'm achieve to show custom controls, but I have different errors in the log for the code in initState or in Dispose.
The example file of the next link has a class AspectRatioVideo at the end, and I put the Flick Video Player code inside in the lines with the comment //Flick Video Player Code
You can download the image picker example folder with downgit, add the Flick Video Player package and change the next class.
class AspectRatioVideo extends StatefulWidget {
AspectRatioVideo(this.controller);
final VideoPlayerController controller;
@override
AspectRatioVideoState createState() => AspectRatioVideoState();
}
class AspectRatioVideoState extends State<AspectRatioVideo> {
VideoPlayerController get controller => widget.controller;
bool initialized = false;
FlickManager flickManager; //Flick Video Player Code
void _onVideoControllerUpdate() {
if (!mounted) {
flickManager.dispose(); //Flick Video Player code
return;
}
if (initialized != controller.value.initialized) {
flickManager = FlickManager(videoPlayerController: widget.controller); //Flick Video Player Code
initialized = controller.value.initialized;
setState(() {});
}
}
@override
void initState() {
super.initState();
controller.addListener(_onVideoControllerUpdate);
}
@override
void dispose() {
controller.removeListener(_onVideoControllerUpdate);
super.dispose();
}
@override
Widget build(BuildContext context) {
if (initialized) {
return Center(
child: AspectRatio(
aspectRatio: controller.value?.aspectRatio,
child: FlickVideoPlayer(flickManager: flickManager) //Flick Video Player code
),
);
} else {
return Container();
}
}
}
This one happens when I open the page.
The line with the #5 refers to _onVideoControllerUpdate of the previous class.
E/flutter ( 4337): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The method 'dependOnInheritedWidgetOfExactType' was called on null.
E/flutter ( 4337): Receiver: null
E/flutter ( 4337): Tried calling: dependOnInheritedWidgetOfExactType<_ModalScopeStatus>()
E/flutter ( 4337): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
E/flutter ( 4337): #1 ModalRoute.of package:flutter/…/widgets/routes.dart:882
E/flutter ( 4337): #2 FlickVideoManager._changeVideo package:flick_video_player/…/manager/video_manager.dart:144
E/flutter ( 4337): #3 FlickVideoManager._handleChangeVideo package:flick_video_player/…/manager/video_manager.dart:104
E/flutter ( 4337): #4 new FlickManager package:flick_video_player/…/manager/flick_manager.dart:35
E/flutter ( 4337): #5 AspectRatioVideoState._onVideoControllerUpdate my_project/page_video.dart:287
E/flutter ( 4337): #6 ChangeNotifier.notifyListeners package:flutter/…/foundation/change_notifier.dart:209
E/flutter ( 4337): #7 ValueNotifier.value= package:flutter/…/foundation/change_notifier.dart:276
E/flutter ( 4337): #8 VideoPlayerController.initialize.eventListener package:video_player/video_player.dart:286
E/flutter ( 4337): #9 _rootRunUnary (dart:async/zone.dart:1198:47)
E/flutter ( 4337): #10 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
When I have fullscreen video player launched within listView.builder its stop working, probably because when device is rotated list item is being removed from the list, same as video player is being disposed. It working perfectly when video player its displayed outside of the listView.builder.
Any idea how solve this issue ?
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Container(constraints: BoxConstraints(w=450.0, h=800.0)):
A VideoPlayerController was used after being disposed.
Other question is it possible to support slide down
gesture to dismiss fullscreen mode? Would it require to implement fullscreen via Navigator
?
I m trying to play a video from this link https://zmky-nextcloud.sandslash.seedbox.link/s/esm5JcjaGRo7eot/download , everything works well except the sound. I got no sound.
Can you please fix that?
First of all congratulations on the beautiful work, it is perfectly suited to my project.
The package has a problem when displaying the video in full screen, when clicking close (Navigator.pop (context);) a black screen appears and the page does not return and the application stops working.
The problem is in this line (remembering that the error occurs only in full screen): https://github.com/GeekyAnts/flick-video-player/blob/master/example/lib/landscape_player/landscape_player_controls.dart#L138
A provisional alternative, would it be possible to hide Icons.cancel (from line 130 to 145) only in full screen?
It happens on a physical device, api 28 and 29 and others.
I hope you can reproduce the error, I look forward to the correction.
Ps. Sorry for the English, it's not my native language.
Nowadays widget FlickLeftDuration has the following parameters: fontSize and color. So i can't change: font family, fontWeight e.t.c. The ability to set text style would be good.
i want to add listener.
flickManager.addListener(() { })
I need function onTap() from FlickVideoProgressBar to print(value position)
Is there anyway to change the aspect ratio of the video player?
I tried CustomOrientationPlayer flick-video-player every thing worked fine but don't find how to make playing video highlighted. any suggestion would be appreciated. Thank You
Can you improve the speed? So the package is useless. It is too slow. I had to put the cached_video_player back. And if you don't want to improve the speed please add the problem in the description of the package, for which I wasted a couple of hours integrating the function into my app to then have a really bad result.
Thanks
Is there a way to set buffer object values so that video streaming can be improved?
MIN_BUFFER_DURATION
MAX_BUFFER_DURATION
MIN_PLAYBACK_START_BUFFER
MIN_PLAYBACK_RESUME_BUFFER
Hi, is it possible to attach any thumbnail to a video file? My application stores these thumbnails on the server, but I have a black screen when buffering a larger video file. I would like to put a thumbnail there 🥇
Plz add Live support for youtube video and speedo meter and quality options as soon as possible
By playing AWS cloud front video of m3u8 format it is working properly in android but in ios it is showing error without any message
How can I listener the completion & seek-bar time.
I was looking for alternatives to play my network video and I stumbled upon your repo it solved everything that I wanted except one thing.
I want to get the time when the pause button is pressed or the video is stopped due to some event.
If you can help me with that it will be wonderful and it will help me a lot.
Thank you
I used 5 subordinate default players
1 player takes up approximately 3/1 of the screen.
I click on the first player, I watch the video, the top video when I land the lowest video starts to load again and the time I stop is deleted automatically. I want it protected. How do I get it?
It would be nice to have hls/m2u8 support
this is awesome plugin!
GOOD!!
Any quick ideas?
Does it support subtitles?
thank you
hello, how can I add the video cover image to the top, so it will be the cover image before the video opens.
It would be excellent to see playback speed added to this. The ability to slow down or speed up video would be very helpful.
Plz add Live support for youtube video and speedo meter and quality options as soon as possible plz share code.
Not sure if this flick's problem or video_player
itself. I have built a similar example like FlickMultiPlayer
(Feed). the video in the example (butterfly) plays fine in the Feed, but I have tried playing some other videos and some don't run at all. any help is appreciated
LOG
I/ACodec (31729): [] Now uninitialized
I/ACodec (31729): [] onAllocateComponent
I/OMXClient(31729): IOmx service obtained
I/ACodec (31729): [OMX.qcom.video.decoder.avc] Now Loaded
I/ACodec (31729): [OMX.qcom.video.decoder.avc] Now uninitialized
I/ACodec (31729): [] Now kWhatShutdownCompleted event : 8519
I/MediaCodec(31729): Codec shutdown complete
W/MediaCodecRenderer(31729): Failed to initialize decoder: OMX.qcom.video.decoder.avc
W/MediaCodecRenderer(31729): android.media.MediaCodec$CodecException: Error 0xffffec77
W/MediaCodecRenderer(31729): at android.media.MediaCodec.native_configure(Native Method)
W/MediaCodecRenderer(31729): at android.media.MediaCodec.configure(MediaCodec.java:1960)
W/MediaCodecRenderer(31729): at android.media.MediaCodec.configure(MediaCodec.java:1889)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.configureCodec(MediaCodecVideoRenderer.java:483)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:805)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodecWithFallback(MediaCodecRenderer.java:745)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:474)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:1261)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1111)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:552)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:647)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:529)
W/MediaCodecRenderer(31729): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
W/MediaCodecRenderer(31729): at android.os.Handler.dispatchMessage(Handler.java:102)
W/MediaCodecRenderer(31729): at android.os.Looper.loop(Looper.java:214)
W/MediaCodecRenderer(31729): at android.os.HandlerThread.run(HandlerThread.java:65)
E/ExoPlayerImplInternal(31729): Playback error.
E/ExoPlayerImplInternal(31729): com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(1, null, null, video/avc, null, -1, null, [3840, 2160, -1.0], [-1, -1])
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:479)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.reinitializeCodec(MediaCodecRenderer.java:1261)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1111)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:552)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:647)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:529)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
E/ExoPlayerImplInternal(31729): at android.os.Handler.dispatchMessage(Handler.java:102)
E/ExoPlayerImplInternal(31729): at android.os.Looper.loop(Looper.java:214)
E/ExoPlayerImplInternal(31729): at android.os.HandlerThread.run(HandlerThread.java:65)
E/ExoPlayerImplInternal(31729): Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.qcom.video.decoder.avc, Format(1, null, null, video/avc, null, -1, null, [3840, 2160, -1.0], [-1, -1])
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodecWithFallback(MediaCodecRenderer.java:753)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.maybeInitCodec(MediaCodecRenderer.java:474)
E/ExoPlayerImplInternal(31729): ... 9 more
E/ExoPlayerImplInternal(31729): Caused by: android.media.MediaCodec$CodecException: Error 0xffffec77
E/ExoPlayerImplInternal(31729): at android.media.MediaCodec.native_configure(Native Method)
E/ExoPlayerImplInternal(31729): at android.media.MediaCodec.configure(MediaCodec.java:1960)
E/ExoPlayerImplInternal(31729): at android.media.MediaCodec.configure(MediaCodec.java:1889)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.video.MediaCodecVideoRenderer.configureCodec(MediaCodecVideoRenderer.java:483)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:805)
E/ExoPlayerImplInternal(31729): at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.initCodecWithFallback(MediaCodecRenderer.java:745)
E/ExoPlayerImplInternal(31729): ... 10 more
按照这个用例去写
import 'package:flutter/material.dart';
import 'package:flick_video_player/flick_video_player.dart';
import 'package:video_player/video_player.dart';
class SamplePlayer extends StatefulWidget {
SamplePlayer({Key key}) : super(key: key);
@OverRide
_SamplePlayerState createState() => _SamplePlayerState();
}
class _SamplePlayerState extends State {
FlickManager flickManager;
@OverRide
void initState() {
super.initState();
flickManager = FlickManager(
videoPlayerController:
VideoPlayerController.network("url"),
);
}
@OverRide
void dispose() {
flickManager.dispose();
super.dispose();
}
@OverRide
Widget build(BuildContext context) {
return Container(
child: FlickVideoPlayer(
flickManager: flickManager
),
);
}
}
android可以播放,但是ios是黑屏,ios中视频一直在加载,就是不播放;android和ios点击全屏都会黑屏
请问是我哪里有问题,有解决方案么?
克隆完该github代码,怎么能运行该仓库里面的Example用例?
Hello. We are attempting to use the flick video player in a big social media like product. Our main concern is the performance of the plugin and the speed of video loading in a big feed of videos. As maintainers we would love to hear from a first party:
Thanks
Player Controls should be invisible on autoplay mode, user can tap on the video to see them.
as of now
bool _showPlayerControls = true; this is specifically set to true so the controls are visible for 5 seconds when the video loads which is not good as per UX.
Hi, When I play video in portrait mode, e.g. 1080x1920, I click watch in full screen. The application screen rotates to the landscape screen. However, the video is projected to the full width of the phone and not to the video height, so I can only see part of my video.
Video Player does not support HLS and Progressive Steaming for both iOS & Android.
I tried using the HLS file format as an input to the video player but it does not work and shows an error in the view.
Is there a way I can stream HLS URLs in the flick video player
flickManager = FlickManager( autoPlay: false, autoInitialize: true, videoPlayerController: VideoPlayerController.network( 'https://d2tlhrnhiaq7gn.cloudfront.net/show/main-video/240/${widget.exclusiveDetailObj["mediaList"][0]["hlsSourceLink"]}', formatHint: VideoFormat.hls), );
Even though I use window.addflags(LayoutParams.FLAG_SECURE) in the MainActivity of the android file, it's only preventing in regular app but not when video is playing.
Does it support playing youtube videos? If not, then are there any plans for that.
Reference: https://pub.dev/packages/ext_video_player
ext_video_player plugin is basic one without much controls.
I'm now developing Video player in Flutter and using Flick package
The video will be streamed with m3u8 format to the Flutter App. I would like to let the user to choose Video Quality (720p, 480p, etc.) like Youtube.
Since Flutter's video_player is based on ExoPlayer for Android under the hood, I know that ExoPlayer supports choosing Video Quality by the users.
Whenever User selects the new video quality from a list I want the new video to be played from exactly same time where the last video was left .
Live video not played. Please add live video play support.
not support video cache please add this feature thanks for great work!
the package does not support the newest video_player package
Is it possible to exit video in landscape mode with the android back button?
When the video is done playing, if we replay, then it again fetches data from internet.
In animation video player to fit in full screen Portrait mode it cut some video sides.
is their any way i can do it with default video player or can you please tell us what is the aspect ratio .
Hey,
First I just want to say thanks for the package, it's really great and easy to use.
Is support for web in the pipeline?
Thanks!
Why It buffer all the time when we rewind the video
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.