VIMVideoPlayer
VIMVideoPlayer copied to clipboard
Recommended usage in UITableView
What is the recommended usage for showing videos in UITableViews where multiple cells can have video shown in them? In my case, only one video should be playing at a given time. Is it better to associate a VIMVideoPlayer per cell or to have one VIMVideoPlayer associated with the UITableView that reset it's URL based on the UITableViewCell?
You could obtain a reference to an VIMVideoPlayer ivar self.currentPlayer
, then when any subsequent video is triggered to play, you can call [self.currentPlayer pause]
or [self.currentPlayer reset]
from within the method that triggers the next video and reassign self.currentPlayer = newPlayerFromCell
.
Also, make sure you properly override - prepareForReuse
in your UITableViewCell subclass.
A follow up question to this... is there a best practice to preload videos so when cells are visible the video does not have to wait for buffering to playback? e.g. is there a way to have the vimplayer preload the data for playback?