title: how to detect volumn change in action extension
body: <p>I want to make a youtube player using action extension.But the problem is volumn changes won't be reflected in an action extension while it works in an app.</p>
  <p>my code is like:</p>
  <pre><code>let audioSession = AVAudioSession.sharedInstance()
  
  self.obs = audioSession.observe(\.outputVolume ) {[weak self] (av, change) in
  
       guard let self = self else { return }
  
       print(&quot;volume \(av.outputVolume)&quot;)
  
       self.slide.value = av.outputVolume
  }
  </code></pre>
  <p>and also I tried to hide the system volumn bar using code like this:</p>
  <pre><code>let volumeView = MPVolumeView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
  self.view.addSubview(volumeView)
  </code></pre>
  <p>it also works in an app but not in an action extension.
  Anybody can help me out? Or tell me why they won't work in an action extension?</p>