3

Im trying to play a video in a custom table view cell. I am trying to accomplish a feed like Facebook where the video starts playing when cell becomes fully visible.

Im using a back-end service (parse.com) and I'm grabbing the url for the video that has been uploaded.

Should i use the AVframework or the MPMoviePlayerController or implement a web-view?

Thomas rocks
  • 111
  • 1
  • 1
  • 13

1 Answers1

0

Defintely don't want to use a WebView. What you can do:

  1. check if cell is visible in cellForRowAtIndexPath using: if ([self.tableView.indexPathsForVisibleRows containsObject:indexPath]) {}

  2. download data using one of these: How to download video from url and save it in to document directory in iOS?. Cache this data using one of these: How to play video from NSData

  3. display using either MPMoviePlayerController or AVFramework. The main difference between the two, is that MPMoviePlayerController is much easier to use, and has a lot of convenience method. However, this comes at the cost of giving up more fine-tuned control.

Hope this helps

Community
  • 1
  • 1
trdavidson
  • 1,051
  • 12
  • 25