-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I have implemented player in UITableViewCells. Its not working properly as it has to. When cell is reuse i need its state as its previously has. When i reload the tableview the video layer of one cell is copied to another cells video layer.
Below is the screen when tableview is not reloaded yet.
After reload i insert some records (objects) in tableview and reload. The UI is disturbed and SRVideoPlayer's objects are misplaced.

TableViewCell are XIB's
Code in VideoCell.h
@property (nonatomic, strong) SRVideoPlayer *videoPlayer;
Code in ViewController cellForRowAtIndexPath
if (cell.videoPlayer == nil) {
cell.videoPlayer = [SRVideoPlayer playerWithVideoURL:[NSURL URLWithString:videoUrl] playerView:cell.viewVideoLayer playerSuperView:cell.viewVideoLayer.superview];
cell.videoPlayer.videoName = [[arrData objectAtIndex:indexPath.row] objectForKey:MessageUserFullName];
cell.videoPlayer.playerEndAction = SRVideoPlayerEndActionLoop;
[cell.videoPlayer play];
[cell.vwContents bringSubviewToFront:cell.viewVideoLayer];
}
If I'm going wrong anywhere please update.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
