Detecting UIWebView finish to play youtube video on iPad

后端 未结 4 1008
深忆病人
深忆病人 2020-12-08 06:13

I\'m using UIWebView to play YouTube videos in an iPad.

How can I detect when a YouTube video is finished playing? I see the play icon in the status ba

4条回答
  •  悲哀的现实
    2020-12-08 06:32

    please refere to:

    https://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVPlayerItem_Class/Reference/Reference.html

    there is an notification available iOS 4.0 , which you can use to detect youtube video finish playing

     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubePlayed:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
    

提交回复
热议问题