Skip to content

Use SRVideoPlayer in collectionView's cell #8

@Travloper

Description

@Travloper

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??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions