简体   繁体   中英

Perform action when play button is tapped in AVPlayerViewController

I am using AVPlayerViewController to play video. When play button is tapped in AVPlayerViewController I need to perform some action. But I can't detect whether play button is tapped. Here is a picture for better understanding. 在此输入图像描述

Any assistance would be a great help.

Officially there is not any Done Button click event.

What you could do is associate a UITapGestureRecognizer with the view of the AVPlayerViewController, allowing the "menu" press type, and cancelling touches in view. Your selector callback will then be responsible for handling the pausing of playback and the dismissal of the AVPlayerViewController, but it would also allow you to perform any other cleanup required specific to your implementation.

Alternatively you can follow it . Its smart workaround.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM