开发者

Can MpMoviePlayer get it's data from an NSInputStream

开发者 https://www.devze.com 2023-03-28 05:04 出处:网络
I have an iPa开发者_StackOverflow中文版d app which has a network connection from another iPad.On the client iPad, I want to be able to take data from a NSInputStream (which comes from the server iPad)

I have an iPa开发者_StackOverflow中文版d app which has a network connection from another iPad. On the client iPad, I want to be able to take data from a NSInputStream (which comes from the server iPad), and play it in MpMoviePlayer as it downloads from the server iPad.

I know that I can download the entire video, save it to a file, and open it in media player, but I want to be able to start playing before the full file has been downloaded.

I have NOT tried saving a chunk of it to the file and playing it, then adding to the file as it becomes available in the stream, because a) the file is likely to get locked, and b) the movieplayer is likely to open the file and read it into an internal cache, so adding to the file later won't (I don't think) play the new content. I'm willing to try it down the road, if nobody has any brilliant ideas, but I give it a very low likelihood of working - I'd guess a 10% chance of success.

If MpMoviePlayer had an initWithData method, I would simply give it a NSMutableData, and add to the data as it became available to the stream, but I don't see a method like that. Does anyone have any ideas for how I can do this?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号