0

I want to play .ts files which are stored in my local disk. I can play the .ts file using .m3u8 by streaming.

But i want to play these stored local ts files directly(with my AVPlayer) without streaming. I mean i want to play without using m3u8.

is it possible in iOS? If possible please explain how to achieve this?

1 Answers1

1

If file:// URLs don't work, I guess you could run a minimal HTTP server inside your app and have that serve the files to AVPlayer.

Steven Kramer
  • 8,473
  • 2
  • 37
  • 43
  • Hi steven Kramer, I can play ts in my iOS by streaming from server. But i have ts file stored locally like mp4 or mp3 in a directory. is it possible to play ts directly as mp4 plays by giving the file path. And i'm using iOS Simulator to test this. – AKash G Guttedar Jun 03 '11 at 13:24
  • I understood that. I suggest you try to put these files in your resources, and then use a file URL to play them. Try something like `[[NSBundle mainBundle] URLForResource: @"playlist.m3u8" withExtension: nil]` to get the URL. Pass that on to AVPlayer. Failing that, I think you'll have to embed a small HTTP server inside your app that will feed the data to AVPlayer, allowing you to use a normal HTTP url. – Steven Kramer Jun 03 '11 at 13:45
  • Hi Steven Kramer, Thanks for your reply, ya i followed your above said steps. 1. I used [[NSBundle mainBundle] URLForResource: @"List.m3u8" withExtension: nil] then i passed the fileURL to AVplayer, But it did not play. 2. I added mini [MongooseDaemon](http://stackoverflow.com/questions/5358493/mini-server-implementation-in-objective-c) HTTP server in my app to feed the data to AVplayer. Its launching my application and suddenly exiting without error or exception. So can you explain how to trace this. –  Jun 04 '11 at 06:42
  • @StevenKramer minimal HTTP server embedded, do you have any documents ? – onmyway133 Nov 03 '14 at 02:58
  • Sorry, can't help you with that, I didn't investigate any further. – Steven Kramer Nov 04 '14 at 08:18
  • How to create HTTP server inside my app that will feed the data to AVPlayer? – Kiran Jasvanee Oct 27 '17 at 09:14