AVPlayerViewController 视频播放禁止双指缩放及拖动手势操作

- (void) handlePinch:(UIPinchGestureRecognizer*)gesture
{
    NSLog(@"handlePinch 双指缩放不做任何处理");
}
- (void) handlePan:(UIPanGestureRecognizer*)gesture
{
    NSLog(@"handlePan 拖动不做任何处理");
}

// 创建手势处理器,指定使用该控制器的handlePinch:方法处理手势
UIPinchGestureRecognizer* gesture1 = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
UIPanGestureRecognizer* gesture2 = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];

// moviePlayer.view 添加手势处理器。
[moviePlayer.view addGestureRecognizer:gesture1];
[moviePlayer.view addGestureRecognizer:gesture2];
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容