How to play a .ts file in iPhone? - iphone

I want to play .ts file in iPhone, so
I have been trying to copy it to iTunes but it is not allowing to copy to iTunes movies, then I converted it to .mp4 and tried again, it copied.
So converted file is working but file should not be converted.
I sent it through mail and tried to download it, but it is showing "These types of attachment cant be accessed on this device."
Does iPhone supports the file type or not?

Related

AVPlayer, Play a local file URL that is currently being written to?

I have been trying to use a custom AVPlayerItem that lets me copy the currently playing media to file after it has been downloaded while it is streaming into the AVPlayer, essentially letting me cache the displayed video while showing the video as soon as possible.
Unfortunately, my application sometimes needs to download mp4 files from a server (that I don't control) that is giving the mime type as image/gif although the downloaded file IS an mp4 file. Because of this, my AVPlayer is not "streaming" in the video as it's downloaded, and only shows it once the file is completely downloaded and it realizes the file really is an MP4.
My thought is now to just download the file directly to a local file with a .mp4 extension that a standard AVPlayerItem can stream in, and write to this file while reading from it with the AVPlayerItem. Is this possible? Will the AVPlayerItem pause when it is still downloading/buffering the incomplete data or will it just produce an error without displaying anything? Is there a better way I can be doing this?

Load XML file as asset in iPhone - objective c

Is there a way to open an XML file as a mail attachment or web download and load it into an iPhone app?
I want my app to be able to open a XML file as a mail attachment and then parse. I know how to do the parsing, but I don't know how to load the XML file.
Thanks
You will want to look into Document Interaction you can register your app to receive files of certain types, yours being .xml.
Opening Supported File Types

Titanium Saving the Recorded Audio Files in a folder, Uploading audio files to Web Server,

How to save the file which is recorded in sound_record.js File from Appcellrator Titanium KitchenSick Demo.
file = recording.stop(); // file container TiFile Object
sound = Titanium.Media.createSound({sound:file}); // Sound Contains. TiMedia Object
I found these two lines which has the data, which is recorded, But i didnt get that, How to save these recorded data into iphone, so that they can have an access to these files which is recorded.
And also Uploading the Audio files to Web Server, Every where we have how to upload the Image which comes from Gallery, But there is no where its mentioned how we can upload the audio files such as .wav file which is recorded using sound_record.js.
I would checkout the KitchenSink, you'll find a lot of examples there. For saving I would checkout the filesystem.js and for upload the xhr_fileupload.js.

Reading iTunesMovies file in iPhone?

In iPhone, the iPod app saves the media files (audio, video) with strange names and in weird folders (F00,F01 etc). There is a file named iTunesMovies in iPhone, which contains all the information about the metadata of those video files and how they are to be displayed in iPod app. I copied that to my Mac also, and when i tried to open that file in textEdit, it showed some alien characters which made me believe that it is encrypted may be(Thats just a wild guess).
I want to read/change the contents of that iTunesMovies file. Can i do that? Is there any Framework which deals with that iTunesMovies file?
Thanks in advance
I don't think there's a framework to do this, but you can probably do it yourself by reading the file into an NSData object, then manipulating how you would like. Your app will have to be running outside the sandbox, as well. Something I don't know how to do.
Keep in mind that this isn't allowed by Apple, so any apps you make that use this would have be distributed through other means.

Where are downloaded sound files saved?

When I download a sound file in my iPhone, in which directory is it stored?
There is no 'sound file directory'.
Safari cannot download files to the iPhone and if you download a sound file from code you will receive the data in an NSData object. From there it is up to you where you write the file (or even if you write a file, you could use the data without saving it). However you will still not have many options on where to save the file because of the iPhone sandbox.