3

My code borrows heavily from this question: AVPlayer stalling on large video files using resource loader delegate and the code that question mentions, here: https://gist.github.com/anonymous/83a93746d1ea52e9d23f

My problem though is that, even though my video DOES download, and I can progressively track it, it never plays. my code is nearly identical to the questions above, except it's in a tableview cell.

It's a lot of code (about 100 lines), so I just created a gist for simplicity: https://gist.github.com/JoeyBodnar/7be323b066058667851b

So, how can I pass the data back to the AVURLAsset as it loads, so that the video will play as it loads? My code is nearly identical (as far as I can tell) to the aforementioned questions, and those authors claim the video/audio does play back as it is downloaded. What am I doing wrong?

Community
  • 1
  • 1
jjjjjjjj
  • 4,203
  • 11
  • 53
  • 72
  • not sure this works with an .mov file. never tried it. it's possible the moov atoms are not set up correctly for the file to stream. make sure you are actually starting the video playback. I was doing that in the - (void)observeValueForKeyPath where I listen for the playbackLikelyToKeepUp event and calling the play function on the video player – Paul Cottrell Mar 28 '16 at 18:28
  • thanks for the response. I am calling [self.player play] in the code. I also tried with a sample video from this site: http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4 but it doesn't work with mp4 either. So using your code mentioned in the question, you were able to do exactly as I am talking about (play and cache at same time), correct? – jjjjjjjj Mar 28 '16 at 18:47
  • @Paul Cottrell, could you give me a valid URL that your method worked for with you? I have used the code to get everything working with audio just fine, it's only with my videos that it's not working, and I'm wondering if it's the test URL i'm using that is giving me problems. – jjjjjjjj Mar 28 '16 at 19:33
  • yes, play and cache at the same time is working. I can't give you any video url's - sorry. proprietary content. That bunny video should work though. I suggest you download it and check the moov atoms using Atomic Parsley to make sure – Paul Cottrell Mar 28 '16 at 20:59
  • Do you got any solution? – Maulik shah Feb 23 '18 at 07:50

0 Answers0