Swift: How to play the video and download at the same time - ios

Currently in our iOS Application, we are downloading the video and then playing it, which is indeed taking a lot of time and killing the user experience. Now, we want to shift to directly stream the video or play the video while it is downloading.
I have tried using AVAssetResourceLoaderDelegate. I doesn't play the video at all and displays the mime type as text/html. Maybe because I am loading from a secured URL with headers.
Can someone suggest me a good way where I can stream or Play the video while downloading it. Would be glad if someone suggest a way to Stream the video's directly from the URL.

Related

Fast uploading video and play without buffering video from URL

In my Application I'm capturing 10 second of video and upload to server by FTP and Other user can watch this video by URL(s) from web service response.
As per my question I want to capture video with good quality with small size so It easy to upload video by FTP. Right now I'm using .mp4 video formate to upload video if anybody know best video formation that can increase uploading speed then guide me.
Second I'm getting all those uploaded video in the response of web service as a URL(s).
In response there are many URLs so I need to play video in queue means one-by-one and end user can do swipe left to move on NEXT video and swipe RIGHT to previous video. You can see my code here.
Every thing is working good but problem is take much time to upload and play (buffering time) video.
Please guide me on this points.
COMMENT : Get success in the compress video 20 MB to 1.6 MB so uploading speed bit increase and Right now working with AVQueuePlayer for play video in queue but some time stuck video to playing.
Yes,
May you upload video using chunk data in base64 format.
This is faster then FTP video upload & also useful when your internet connection is lost same time when you upload video in sequence.
You can upload your files via SFTP, it is speed than FTP I think. Also your videos may bad performance with plays on http protocol.
You should follow this lines, I hope it will help you;
Upload video via SFTP or Amazon S3
Install to your server a stream engine like Wowza or Red5
Transcode video for mobile (Usually wowza makes auto)
Stream your videos over rtsp for android, hls (http) for ios
That its!
Good luck

upload video stream and audio stream on iOS

Here's the needs: People record their video via my App and upload stream to our website, you know, like a live show.
When they are recording, the network goes bad, then record audio instead of video.
And when audience watch, first comes the video, in a certain time comes the audio with a static picture.
How am I supposed to do that? Thanks.
I got this after thinking. So I'll answer by my self.
If you wanna record video and audio separately. Use lower level Library to handle this. Then upload it. And you can get the upload speed, When the speed goes low, you can shut down the video upload process.

IOS Live streaming

Problem:
I need to download mp4 video from media server and simultaneously feed the localhost httpserver (GCDWebServer) to enable video streaming.
What have i tried so far:
I am able to download a video file from media server and then provide the localhost url for streaming the video.
But this takes a lot of time in downloading. So i wanted to know if there is a way i can segment the video on the fly and keep updating the m3u8 file as and when my next segment is ready.
Ok, Why downloading? Basically i need to deal with a custom encrypted video file. So i need to download, then decrypt the stream and then feed to my local httpserver.
I hope i'm clear in the requirements.

Play the Video/Audio which is getting from the server

Is there any solution of this below one?
I have the Video/audio URLs
My Requirement is:
Is it possible to get the video/audio from the server and at the same time I have to open the player to play it(Like showing the Live-video directly in browser Field).
Means
Getting streaming into a buffer in back-end and at the same time I want to show it in the player.
If above is possible
I want to save that particular video/audio streaming data in to one file.
This blackberry KB link explains about streaming video from server. It may help you.

Blackberry, QRs, and video

I've been asked to create a QR image that, on being scanned by a smartphone, will play a short 2-minute video. The video is currently in .mp4 format, but the format can change. The video playback works fine on iPhone however I'm having some problems with the BlackBerry Bold.
When the user scans the QR code the phone directs them to a URL. Right now the URL they are directed to is http://domain.com/video.mp4. However when the user attempts to access this page they get a 413 Error "Entity too large". Basically, too much is being pushed to the client.
Reading the BlackBerryForums.com.au thread titled "Request Entity Too Large", I see you need to increase the allowed request size. But the user is able to play YouTube videos perfectly fine on their blackberry! WHY? is the youtube video size smaller? What format is YouTube using? Why does YouTube work, when my method doesn't?
I know the obvious solution here is to use YouTube as a hoster and embed the video but I am told I cannot use this quick and easy solution.
The problem is that YouTube streams the video. What you're trying to do is get the user to download the whole video file.
You may need to get a streaming server so that the video can be played.
Alternatively, reduce the filesize of the file by reducing the video resolution and bitrate, make sure the sound is mono and low bitrate as well.

Resources