AVPlayercontroller - Adding Overlay Subviews
<p>Depends upon the PlaybackControl Visibity How to show and hide the Custom Subview added in contentOverlayView?</p>

<p>I want to do like Youtube TVOS app did.</p>

<p>I tried with UIPressesEvent but it is not giving me the exact touch events. It is giving me these:</p>

<pre><code>  override func pressesBegan(presses: Set&lt;UIPress&gt;, withEvent event: UIPressesEvent?) {
    for item in presses {
        switch item.type {
        case .Menu:
            self.customViews.alpha = 0
        case .PlayPause:
            self.player?.pause()
            self.customViews.alpha = 0
        default:
            self.setVisibilityToPreviewView()
        }
      }
    }

 func setVisibilityToPreviewView () { //This wont work in all cases.
      if self.previewView.alpha == 1 {
         self.previewView.alpha = 0
      } else {
         self.previewView.alpha = 1
      }
    }
</code></pre>

<p>But with this Touch events i can only show and hide the subviews.
It should be hidden when the <strong>playbackcontrol</strong> is <strong>Hidden</strong>.</p>

<p>If I get the <strong>PlayBackControl Visibility</strong> values I don't need to worry about hiding these subviews.  </p>

<p>Apple is Using <strong>AVNowPlayingPlaybackControlsViewController</strong>. It is not open for developers. </p>

<p>So I need to find some other better way to do this. </p>

<p>Please guide me how to do it. </p>