SRVideoPlayer icon indicating copy to clipboard operation
SRVideoPlayer copied to clipboard

Use SRVideoPlayer in collectionView's cell

Open Travloper opened this issue 6 years ago • 0 comments

It gives me following error -

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <SRVideoPlayerLayerView: 0x7fa64dc59640; frame = (0 0; 0 0); layer = <AVPlayerLayer: 0x600001fe7280>>: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs.'

What i Did -

  • Took a view in xib of cell and made an outlet
  • In cell for row at index path method - SRVideoPlayer *videoPlayer = [SRVideoPlayer playerWithVideoURL:[NSURL URLWithString:dict[@"video"]] playerView:cell.vVideoPlayer playerSuperView:cell.contentView.superview]; videoPlayer.videoName = @"Here Is The Video Name"; videoPlayer.playerEndAction = SRVideoPlayerEndActionLoop; [videoPlayer play];

HOW CAN I USE IT??

Travloper avatar Feb 09 '19 18:02 Travloper