0

I'm working on an iOS and Android app that allows the user to stream/play videos.

I would like to create an offline mode that gives the user the ability to play an already-saved video. To do so, I would like the app to save locally the currently played video if the user has a WiFi connection.
To do that, I would need a mechanism to read and save at the same time a video.

Any ideas to do that on iOS or/and Android?

MartinMoizard
  • 6,600
  • 12
  • 45
  • 75
  • Doesn't saving videos from some of the bigger websites violate the TOS? – Reno Dec 21 '11 at 10:32
  • you can write to a file and read it at the same time. – njzk2 Dec 21 '11 at 10:32
  • i don't see how a tos that says that you can watch it but not save it is even legal. also, the matter is not relevant to the technical question. – njzk2 Dec 21 '11 at 10:33
  • @ njzk2 - Thanks! I've heard about this solution, did you give it already a try? Because I never talked to anyone who successfully did it. It looks like there are some issues with the iOS player to handle the EOF event. I don't know about Android. – MartinMoizard Dec 21 '11 at 10:37

1 Answers1

0

read and save at the same time

I guess you would have to span two different threads : one to read, and another to save. And have the 'read' method try to get data from cache before downloading it.

on iPhone, possible duplicates :

The method described in these answers - caching download on disk, and read video from that file - should be the same for Android.

Community
  • 1
  • 1
Vinzzz
  • 11,746
  • 5
  • 36
  • 42