Playing youtube videos with progressive downloading - ios

My application has a custom video player which should be played with youtube links (just to save me the hassle and money from making my own server side and stream videos from there).
Here are some facts that I believe are true:
Youtube prohibits any use of custom players except UIWebView and MPMoviePlayerController.
Youtube doesn't share rtsp links for iOS devices, so I'm left with progressive downloading.
Apple clearly states in the documentation that progressive downloading is possible only for small clips (under 10 minutes or 5MB/5min ratio).
I've downloaded the application 'iTube' which allows you to watch youtube links with playlist control in the device. I was wondering how did they make it work for them. The app obviously uses progressive download as it downloaded 30MB after I've watched ~1 minute of the video (over 3G).
Question: Does Apple allow applications to break the policy of progressive download when youtube links are involved (because youtube doesn't offer any alternative)? or is this application just went under Apple's radar?
Thank you

OK as it turns out, this application just slipped under Apple's radar.
I've asked this question in the developer's forum and got the answer from one of Apple's employees:
You would have to disable downloading over cellular if the clip is over 10 minutes.
I'll forward this to the app review people.
The question I've asked is here: https://devforums.apple.com/message/966814#966814
(You need developer account to get in there)
Thanks all

If your video longer than 10 minutes, you need to use HLS streaming for your apps. For example you can upload your videos to http://int10h.com get HLS link and stream. Good luck

Related

Should I use local videos or youtube videos

I'm developing an iOS app that is going to use plenty of videos. The app in summary is a quiz app, where after each question it shows your a video relevant to that question.
my question is, should I use local videos or just referencing youtube links to show the videos? keep in mind that all of the videos that I am going to show are youtube videos that I have already downloaded and added to the app bundle.
what are the benefits and downfalls of each? in terms of app development and user interaction?
Most of the things that you need to consider are
Size of the app with all videos inside. If you add everything in the
bundle than the size of the application will be big and some people
will reject to download it especially if they are not in wifi
network
Do you need these videos if you don't have a network? If yes, you
have two options, the first one to add everything in the bundle and the second one to download them inside the app when the app starts.
What about the speed? Is it okay to wait for the stream or you need instant play?
I think these are the 3 main points for this. (Size, Offline, Speed)
If you have everything in the bundle Offline support and speed of playing will be okay. But for sure you can have a problem with the size. If everything is in youtube the size will be fine but then you will have problems with the speed and the offline mode.

Store videos for an iOS app online or offline?

I am currently working on an iOS app where users can watch several videos (e.g. fitness videos). The videos are all captured by my team, so I don't need access to external videos.
Now my question is, does it make more sense to store the video files offline right in the app or use some kind of online server (and which one would you recommend)? I don't want to embed Youtube videos.
Thanks in advance!
It is always better to go online. Because the size of video may vary and huge video files would scrap user device's memory. SO it is recommended to use an external server to host the video files.
You can also add an option to download the files if needed.

Is there any way to get direct video download link from YouTube and which work on another devices for long time?

Is there any way to get direct video download link from YouTube and which work on another devices for long time? I tried a lot of third parties softwares to generate the direct download links but after a short time these links dead. May be YouTube changes some parameters in the direct download url. I am trying this for my own channel, to offer direct download for my videos from YouTube at my website, so I need direct download links for each video.
One of the benefits of YouTube Red is the ability to download videos for up to 30 days on supported devices. This is the only official way I am aware of to download videos offline. According to the YouTube Developer Policy, you are not allowed to make content available for offline playback, so I would be cautious of these third party services.
One solution would be to upload the video to YouTube for normal online playback, and upload a copy of the video file somewhere else (ex. Google Drive or on your website) so that users can download from this alternate location.

iOS requirement for live steaming

I'm working on the live streaming app like Periscope and doing research on requirement and restriction on iOS.
I found out that Apple only allows HLS (Http Live Streaming) for certain conditions. I found such conditions below from apple site.
If your app delivers video over cellular networks, and the video exceeds either 10 minutes duration or 5 MB of data in a five minute period, you are required to use HTTP Live Streaming.(https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-SW5)
But I'm not sure that HLS should be used for both publishing and watching video or only for watching is acceptable? Because i thinking of using RTMP for publishing and HLS for watching.
I wrote an app similar to periscope that is on the app store now and it can use 2Mbps and connects via RTMP protocol to send the data. So my guess is they no longer enforce it. I also beleive that at the time that that was written cell service load was possibly to high and they were hoping that HLS would help with that would be my guess. Now with 4gLTE it can handle the loads a little better. Again that is just a guess. My app went up with no problem or mention of that and the review team was more than aware what the app did.

Is RTSP allowed on iOS or one MUST use Http Live Streaming instead?

Apple Http Live Streaming Overview document clearly states that streaming videos exceeding 10 minutes cannot be downloaded progressively and MUST be transferred using Http Live Streaming(HLS). It also states that the latency of HLS is in the neighbourhood of 30 seconds.
In my case, I am building an app that needs to receives live steaming videos in almost real-time. So on one hand I must use HLS for real time streaming but it is not fast enough. On the other hand I can not use anything else because it seems anything other than HLS is not allowed. I know RTSP is possible on iOS but will it be approved by the App Store?
Cheers,
M.
Apple is not transparent. The only way to know if an app will be rejected or accepted is to submit it.

Resources