Reputation: 406
I would like to have different local video files play on a TableCell. My issue is where can I place the PlayVideo function (the TableViewController class or the TableViewCell class) and figuring out how to set the frame inside the cell. Thank you.
Upvotes: 0
Views: 1351
Reputation: 1040
How about having your PlayVideo
function in your TableViewCell subclass as part of a protocol's method, and set your TableViewController as the TableViewCell's delegate for that protocol.
That way your TableViewController has access to the video URL in the data source, and to the cell's PlayVideo
method, which you'd call in the TableViewController as something like tableViewCell.playVideo()
You can probably set the video's frame in the TableViewCell class, and the cell's frame in the tableView datasource's cellForItemAtIndexPath
method.
Cheers!
Upvotes: 1