Application that plays videos from the video library - ios

I would like to create a simple app that does some video playback (with a few extra controls) of videos that you would find in the videos app. I've been searching and searching for a way to access the videos but I haven't found a single API that plays from the videos app.
Every solution I find plays videos from the photos app. I have apps that access the videos library on my iPad/iPhone so I'm assuming it's possible. Does anyone have the api for this?

Apps cannot access data from other applications on iOS, you cannot access the data of other apps unless it's made available by the app via a web server etc.

Your best bet is to use UIImagePicker to load the videos and images that are on your phone.
You can check out a reference here.
As for getting the videos off the videos app, that's not really possible (as far as I know), but you are able to show just photos or just videos with UIImagePicker using the mediaTypes property.

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.

How do YouTube downloaders access the videos?

I did find this answer but it uses YouTube's APIv2, and is now outdated as stated in the answer.
YouTube's terms of use state that you can't use another player or download videos, so it makes sense they've excluded it from the API.
Knowing that, how do online YouTube downloaders, or third party Android apps (that allow to turn the screen off while they keep playing music for example) access those videos?
I'm trying to access a video to stream it inside unity for example (by the way there's a couple of unity assets that do it too), and I'd like to learn how they do it.

Get streaming URL from any YouTube video

I know about how to play video in device. But Here I just want to know that is it possible to get streaming URL from any YouTube Video? Then how can I do it, I tried to search on google but I can not able to find my solution.
Generally I does not want to play direct stream from video, actually I want to save this URL (stream) in my buffer memory OR whatever temporary file and whenever user click on particular button then particular URL Stream is play.
Al Last I got YouTube APIs + iPhone = Cool mobile apps. But I am not sure that it's helpful in my case or not ? If anybody who worked on this API then please suggest me, Otherwise How can I get streaming URL.
Your suggestion will be appreciated.
Thanks in advance.
http://www.youtube.com/get_video_info?&video_id={VIDEO_ID}
This will not work on all files, some will display the message "This+video+contains+content+from.....". But many will work.
Is it possible to get streaming URL from any YouTube Video? - No, it is not possible without hurting the terms of service of youtube. Google has built the business model of youtube around the advertisements all over youtube, in-video banners and video ads and they want your user to see their ads. This is the reason they completely hide the video stream and would ban your app if you anyway access and stream it directly.
The only consented way to play youtube videos on iOS is to embed it into an iframe of a web view.

Youtube integration in iOS SDK

How I can integrate Youtube with iOS? Mainly I want to play private videos without asking for login. Login should be hard coded in the app and will not ask user before playing the private video.
Some YouTube videos can be played back in a MPMoviePlayerController - some cannot. When you query a video through the YouTube Data API https://developers.google.com/youtube/2.0/reference#Videos_feed
you'll get back all the content types available for a particular videos, including the Flash player, 3GPP, MP4 (if available), etc. You can use these URLs to load up a MPMoviePlayerController.
This is perfectly fine, but as I've said - not all videos are available to embed this way. Some videos (mainly ones that require adverts to be displayed) can't be put into native controllers.

Resources