Play an audio with the preloading concept - ionic-framework

I am creating a media player. Where I want an audio file to be played with the preloading concept. I am trying to use ionic preloading plugins, but they only work with local storage file not if the audio URL starts with HTTPS:
Can anyone help me with this?

Related

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.

How to play video while it is downloading using AVPro video in unity3D?

I want to play the video simultaneously while it is downloading via unitywebrequest. Will AVPro video support this? If so please provide me some guidance, as i am new to unity and avpro video. I can able to play the video which is downloaded fully through FullscreenVideo.prefab in AVPro demo. Any help will be much appreciated.
There are two main options you could use for displaying the video while it is still downloading.
Through livestream
You can stream a video to AVPro video using the "absolute path or URL" option on the media player component, then linking this to a stream in rtsp, MPEG-DASH, HLS, or HTTP progressive streaming format. Depending on what platforms you will be targeting some of these options will work better than others
A table of which file format supports what platform can be found in the AVProVideo Usermanual that is included with AVProVideo from page 12 and onwards.
If you want to use streaming you also need to set the "internet access" option to "required" in the player settings, as a video cannot stream without internet access.
A video that is being streamed will automatically start/resume playing when enough video is buffered.
This does however require a constant internet connection which may not be ideal if you're targeting mobile devices, or unnecessary if you're planning to play videos in a loop.
HLS m3u8
HTTP Live Streaming (HLS) works by cutting the overall stream into shorter, manageable hunks of data. These chunks will then get downloaded in sequence regardless of how long the stream is. m3u8 is a file format that works with playlists that keeps information on the location of multiple media files instead of an entire video, this can then be fed into a HLS player that will play the small media files in sequence as dictated in the m3u8 file.
using this method is usefull if you're planning to play smaller videos on repeat as the user will only have to download each chunk of the video once, which you can then store for later use.
You can also make these chunks of video as long or short as you want, and set a buffer of how many chunks you want to have pre-loaded. if for example you set the chunk size to 5 seconds, with a buffer of 5 videos the only loading time you'll have is when loading the first 25 seconds of the video. once these first 5 chunks are loaded it will start playing the video and load the rest of the chunks in the background, without interrupting the video (given your internet speed can handle it)
a con to this would be that you have to convert all your videos to m3u8 yourself. a tool such as FFMPEG can help with this though.
references
HLS
m3u8
AVPro documentation

Play video and audio at the same time in Ionic Hybrid app

I am using Ionic 3 to build a hybrid app.
I have both video and audio file saved in phone local storage.
The video is played in html5 video element.
The audio can be played either in html5 audio element or Ionic Native Media plugin.
I want to:
mute the video (works)
play video and audio at the same time (not working).
It seems that the system does not allow two media resources to run at the same time.
Any suggestions?
Thanks,
D

playing downloaded audio video in iphone

Hi seen many tutorial but couldn't find the right workable answer. I need to play audio and video file from my webservice, for this I want to download the file and play it in the app, seen tutorial for avPlayer nothing workable. Please provide link or guide how to do this.
Use MPMoviePlayer, as this can open network streams and despite the name works with audio. The only thing is this pops up the modal player with controls.
First Download the network file using NSURLConnection and store it locally, then use AVAudioPlayer to play the local file.

Playing Audiobooks (m4b media format) using AudioQueue services | iPhone

I am working on developing an iPhone app to play music. Am using AudioQueue services to play the audio files. App plays all media files correctly, but the app fails to play audiobooks, which I think is because they are different media format (.m4b) from other media items in my library (mp3).
I am sure I need to change how am initializing the audioqueue or AVAssetReaderTrackOutput to play media with different file format but am not sure how.
Can anyone point me to right direction.
Thanks in advance
I have figured it out, the issue was not because of the media format. The Audiobook I was trying to play in my app was DRM protected, so the was unable to play it.
Thanks