Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Recommended usage in UITableView #39

Open
ebalassanian opened this issue Mar 7, 2016 · 2 comments
Open

Recommended usage in UITableView #39

ebalassanian opened this issue Mar 7, 2016 · 2 comments

Comments

@ebalassanian
Copy link

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?

@cameronehrlich
Copy link

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.

@ebalassanian
Copy link
Author

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants