title: Detect zoom and done button with youtube-ios-player-helper on iOS
body: <pre><code>class testYoutubeViewController: UIViewController, YTPlayerViewDelegate {
  
      @IBOutlet weak var playerView: YTPlayerView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.playerView.delegate = self
          let playerVars = ["playsinline": 0, "showinfo":0, "controls": 0, "autohide":1]
          playerView.load(withVideoId: "OsINvu5FYKg", playerVars: playerVars)
  
          //playerView.load(withVideoId: "M7lc1UVf-VE")
          //playerView.playVideo()
  
          // Do any additional setup after loading the view.
      }
  
      override func viewDidAppear(_ animated: Bool) {
          playerView.playVideo()
      }
  
      func playerView(_ playerView: YTPlayerView, didChangeTo state: YTPlayerState) {
          switch state {
          case .playing:
              print("Stared Playback")
          case .paused:
              print("Paused")
          case .ended:
              print("Ended")
          case .buffering:
              print("buffering")
          case .unstarted:
              print("unstartd")
          case .queued:
              print("playing queued")
          default:
              break
          }
      }
  
      func playerViewDidBecomeReady(_ playerView: YTPlayerView) {
          playerView.playVideo()
      }
  
  }
  </code></pre>
  
  <p>*I wanted to add an observer to detect when the I press done or zoom on the youtube video player. 
  *The video plays well and am able to control the play, pause, nextVideo, ..etc it well documented on <a href="https://developers.google.com/youtube/js_api_reference#cuePlaylistObj" rel="nofollow noreferrer">https://developers.google.com/youtube/js_api_reference#cuePlaylistObj</a>. However I didn't see an Event example for detecting the done and zoom button. </p>