how can I access iphone videos programitaclly - iphone

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

Related

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

Play a video from video gallery in iPhone app

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

iPhone iOS5 what are my options for playing audio I do not have bundled in?

I currently have 3 ways to play audio within my app:
Using AudioServicesPlaySystemSound for vibration and simple
sounds
Using Audio Toolbox for bundled files (3rd party class)
Using AudioServices with AudioFX
What I'm currently investigating is, if I can play other kinds of audio that are already present on the iPhone. I would like to reduce my app's download size, as well as offer more flexibility in terms of the kind of sound that the user can play.
Can I play from within my app:
Audio recordings from the Voice Memos app, or do I have to
create my own recordings? Items from an iPod playlist or Music app?
Items from youtube by pre-loading them, or will I have to stream them every time?
Existing ringtone for the phone?
I am a complete beginner when it comes down to playing audio on an iPhone and am already using two 3rd party classes for audio tasks.
Is there an easy way to accomplish some of the tasks listed above?
1) Audio recordings from the Voice Memos app
It's been asked before and I don't believe it's possible from your app sandbox.
iPhone: Access voice memos programmatically
2) Items from an iPod playlist or Music app
There's an API for that, the iPod Access Library:
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/iPodLibraryAccess_Guide/Introduction/Introduction.html
3) Items from youtube
Should be possible, using a UIWebView.
http://iphoneincubator.com/blog/audio-video/how-to-play-youtube-videos-within-an-application
4) Existing ringtone for the phone
No, you can't access the current ringtone programatically.
How can I programmatically determine the default ringtone on an iPhone?
You can download sound files on first start (not in your didFinishLaunchingWithOptions method or your app will likely be killed) and save them locally, then you can just play them when needed. You can play files in their iTunes library, but won't know what they have in the library.
To play from their library, this is a handy example:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-music-library-access/
You can also record user input from your app with AVAudioRecorder, save that and then play it whenever.

Possible to move downloaded mp3s from application to iPod?

I was looking to code an iPhone application however, i was not sure if the following is possible :
Download an mp3 from an external site (through the application)
Once the mp3 has been downloaded, automatically add it to the usual iPod application, so it is visible in the user ipod songs list.
Same for videos too (download video[mp4] and directly transfer it to the usual videos app)
If the above is not possible, can i directly play the downloaded mp3 in my application ? What would i require to play an mp3 in my application ? Are there open source mp3 players available that i can integrate with my application ?
Thanks for any help, i really appreciate it.
Once the mp3 has been downloaded, automatically add it to the usual iPod application, so it is visible in the user ipod songs list.
No, that's not possible. The iPod library is not writable by third-party apps.
Same for videos too (download video[mp4] and directly transfer it to the usual videos app)
Not possible, either.

iPhone Music Library Access

I would like to develop an application for iPhone that classifies the user's music according to user-defined genres. The application should be able to have access to iPhone's Music Library and work on the files, this is, fetching an mp3 file, apply some DSP ( like MFCC coefficients ) and then save the results on the file itself.
Is it possible to obtain a song as a file and work on it?
No. You have access to the music library database and can launch a music player to play a certain song but under the SDK you have neither access to the song files themselves nor to the actual PCM data of the music.
Also, access to the music library database on the device is strictly read-only, so you can't modify genres etc. if that was your plan.
I know this is not the answer you are looking for, but given that you can't access the music data from the iPhone, you might consider having a desktop app that accesses the user's music on their Mac/PC, and encodes something into the genre of the music there. Then you could write a music player app for the iPhone that can understand your genre descriptor and function accordingly. You could even go as far as having your iPhone app and desktop app communicate via WiFi to synch up data.