How to cache a video in flutter? - flutter

Is there anyway we can combine cached_video_player 1.0.3 & chewie 0.12.0 ?
I am using chewie to play my video, but I want to cache them so that user need not download the video again and again.

You can try using this package pub.dev/packages/better_player which already uses chewie and manages cache or try following up this https://www.gitmemory.com/issue/flutter/flutter/28094/612075565
Here it uses your video player and cache manager to achieve the result

One solution could be to just store the video as a file in the file system when first downloaded. Then you just load the video from the file system and play it if it's already downloaded the next time you want to play the video.

Related

Is there way to cache audio files from API response in flutter?

I need to cache audio files and save it locally so as to remove latency while playing it. I tried using the audioplayers package but I could not cache it. Could anyone help with this caching? Previously when I followed Angela Yu's course I had played from assets folder but now I need to cache audio files from network.

Flutter video_player is taking too much time to load video from firbase

Hi I am creating a video player which lists all videos from Firebase storage and play it. I used cache_video_player plugin to play video. This is similar to video_player plugin with cache service. This plugin takes too much time to initialize and load video from network(approximately 10-20 seconds). Is there any way to reduce loading time of this plugin or is there any other plugin which takes minimum time to load video from network
Basically cached_video_player plugin is virtually a clone of official video_player plugin. I used video_player plugin in my project and it takes time when initializing and loading the video when playing from network, it works fine when playing a local video as a file but takes time for playing video from network. It totally depends upon your internet connection and speed, No need to worry about and I don't think that you will find any better plugin for playing video other than video_player.

Adaptive HLS Streaming - Flutter video_player

I am developing a new native App. I have chosen Flutter for it (over React Native). In this app, there will be a section for video streaming. These videos will have HLS streaming.
I am using video_player package in Flutter for it. I am able to play the video successfully but there is no option to change the quality (1080p, 720p etc.). How can I implement video quality selection in video_player package? Also, does video_player have adaptive bitrate streaming for HLS?
You can use stack widget adding there video player and button. After pressing button you change url of video from 1080 p to 720 p.
There's a package which you can use to change the quality from 1080p to 720p, here's the package's link: yoyo_player
For those that might come here looking for a solution. It is a pretty trivial solution using the default video_player or even yoyo player. In front of the url, just add the file format type that you desire. For example for HLS just add ".m3u8" and for dash add ".mpd" and the video will work and still be adaptive.
So your full url should be something like this:
For HLS
https://itvnnowoptimised-sano1.streaming.media.azure.net/3c0ecaef-002f-461f-854a-2397449d351f/thestoryofjoseph.ism/manifest(format=m3u8-aapl).m3u8
For dash
https://itvnnowoptimised-sano1.streaming.media.azure.net/3c0ecaef-002f-461f-854a-2397449d351f/thestoryofjoseph.ism/manifest(format=mpd-time-cmaf).mpd
This was using azure Media Services.

Can we download video and play it with flutter without add it into asset?

I want to download video with flutter (maybe use dio package), and play it in the screen automatic. There is a way to do that?
I have searched it but feel like it only can play a video have added to asset.
check this one Flutter Video Player
The VideoPlayerController offers several different constructors to play videos from assets, files, or the internet.
You can use https://flutter.dev/docs/cookbook/plugins/play-video and can download that to app directory and get the path from there and then play using a video player.don't need to play it from assets.

why quicktime video don't play in moodle

Using Moodle, can play .flv file but can't paly quick time video foarm and force downlaod.
I want to direct play in website.pls,suggestion me
You can use JW player plugin to upload quick time video. Even you can use media plugin which is in Moodle plugin site to upload videos.