【问题标题】:Add/change button overlay of video record when using AVFoundation使用 AVFoundation 时添加/更改视频记录的按钮覆盖
【发布时间】:2013-01-21 16:53:34
【问题描述】:

我目前正在将视频功能实现到 iPhone 应用程序中,该应用程序要求用户能够使用 AVFoundation API 来“选择和播放”视频以及“录制和播放”视频。类似于教程here中显示的内容。

到目前为止,实现该功能没有问题,但是我现在需要更改显示的按钮,例如录制视频 - 从而创建自定义叠加层。例如需要更改录制按钮。

【问题讨论】:

  • 您可能希望包含一些代码示例或您尝试过的内容的演练。你有进步吗?
  • 我不知道从哪里开始这是问题......

标签: iphone ios overlay avfoundation video-recording


【解决方案1】:

我之前这样做的方法是禁用 MPMovePlayerController 中的控件,然后将带有控件的 UIImageView 放在顶部,然后将带有 UITapGestureRecognizer 的 UIView 放在其顶部以检测何时按下控件。

禁用控件:

[_videoPlayer setControlStyle:MPMovieControlStyleNone];

手势识别器:

touchLayer = [[UIView alloc] initWithFrame:self.frame];

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapVideoControlOverlay:)];
[tapRecognizer setNumberOfTapsRequired:1];

[touchLayer addGestureRecognizer:tapRecognizer];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-29
    • 1970-01-01
    相关资源
    最近更新 更多