Play a video from video gallery in iPhone app - iphone

I am developing an iPhone app, in which I have to play multiple videos like "Top rated", "Most played","Favorites" etc.. Each category may have around 20 videos. So having around 100 videos inside resources folder increases the app size. So what I am trying to do is, first saving all the videos locally within the device and selecting the respective videos from the app whenever these videos needs to be played. So is it possible to do so?
Or have to have all the videos inside resources folder?
Thanks in advance.

yes, this is very well possible. you can store your videos in the device before instead of the resources folder and use the ALAssetsLibrary to get access to your videos stored in the photo library.
refer this on how to use the ALAssetsLibrary display image from URL retrieved from ALAsset in iPhone

Related

iPhone is there a way to analyze timestamps of all photos on the camera roll?

I have ~3200 photos on my iPhone over 2 years and would like to create an app that analyzes and plots when I took these pictures (ex: I was very actively photographing for a week, and then stopped). Is there a way to do bulk processing of camera roll photos on iPhone(with user permission) to extract timestamps of photos?
I think if I back up my photos to my mac with the "image capture" app, I can do this kind of metric analysis with a Mac app, but the import process would take hours and I'm looking for something simpler.
Take a look at ALAssetsLibrary
An instance of ALAssetsLibrary provides access to the videos and
photos that are under the control of the Photos application.
Here is sample application PhotosByLocationn.
Demonstrates how to use the AssetsLibrary APIs to provide a custom
image picking UI. The user experience is centered around the idea of
using the assets location and time metadata as a basis for certain
features.
Yes you can use the Assets Library for this.
This fill allow you acces to the image on the users device.

How can I save my video to a special folder in the photo album?

I have an iPhone app that streams video to our Wowza server.
I'd like to implement a new feature that collects my video frames and on completion, saves that recording to a local folder, which will be specially titled and stored in the device's photo album. I have explored AVAssetWriter and UISaveVideoAtPathToSavedPhotosAlbum, but I am not sure how to create a new folder (if there isn't one already) and save the videos there.
A high level answer or code example will work.
You can save video after creating album through using ALAssetsLibrary Class Reference
.The method is writeVideoAtPathToSavedPhotosAlbum:completionBlock:
If you need Example for saving photo after creating album for the same, you can verify this iOS5: Saving photos in custom photo album
You can't create custom albums(Folders) in user's photo app. You only have access to the default album of it which is Camera Roll.

How to manually add auido files in photo gallery in iphone

I am new to iphone programming. Can any body tell me that how to manually add audio files inside the photo gallery? I got some link like we can manually add video inside the simulator but that is only video. I want audio files,too. I have searched in google but I didnt find any where how to add audios files inside photo gallery.
Please can any body tell me.
Thanks
The iPhone's photo gallery does not support audio files.
You can not add audio files to Photo Library. But you can use iPod Library Access Programming Guide for same approach.
Also refer AddMusic demo. AddMusic demonstrates basic use of iPod library access, part of the Media Player framework. You use iPod library access to play songs, audio books, and audio podcasts that are synced from a user's desktop iTunes library. This sample uses the Media Player framework's built-in user interface for choosing music.
AddMusic also demonstrates how to mix application audio with iPod library audio

Creating an app that accesses all images in user's Photos for iOS?

I haven't found any documentation on this or seen this done before, but is there anyway I can, instead of just choosing one image with UIImagePicker, load the user's albums, and then after selecting an image, that image displays, but also allows me to scroll left and ride to see all the images before and after that image?
I know I can use a multiple image picker, but that involves importing all the user's photos, and if the user has hundreds of photos, this would take a lot of time. I'm looking for similar functionality to the real photos app- the performance and everything. Any ideas?
Yes, you can. Look at the documentation for ALAssetsLibrary. This will allow you to enumerate all the user's image (and video) libraries. From this, you get ALAssets, which you can ask for their default ALAssetRepresentation. This one, in turn, you ask for its CGImage, from which you can create a UIImage.
Enumerating Libraries and Assets is done in blocks, which can easily be done in the background.
Use the assets library: http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetsLibrary_Class/Reference/Reference.html
An instance of ALAssetsLibrary provides access to the videos and
photos that are under the control of the Photos application.
The library includes those that are in the Saved Photos album, those
coming from iTunes, and those that were directly imported into the
device. You use it to retrieve the list of all asset groups and to
save images and videos into the Saved Photos album.
note: only available in ios 4+

how can I access iphone videos programitaclly

suppose i load videos to an iPhone using iTunes.
I want to write an app that will allow the selection of videos, and the playing of them.
I am familiar with the MPMoviePlayerController class. but i only played video that i loaded onside my app.
Apple doesn't let you access the movies of the iPod application. You can only access audio files.
From the docs
Use it to find and play user-installed
audio-based media items synced from a
user’s iTunes library. iPod library
access is read-only.
Link