title: LockScreen Player is not appearing once the screen is locked in actual device.
body: <p>I'm new to swift and I have a AVPlayer which is playing fine on a particular screen. My objective is to play the same audio on lock-screen mode. So far this is what I have done and the code as bellow. for some reason I don't see the player widget on lock-screen mood at all. What am I doing wrong here.</p>
  
  <pre><code>class MyAudiosViewController: UIViewController,UITableViewDelegate,UITableViewDataSource,AVAudioPlayerDelegate {
  
  
  @IBAction func playButtonPressed(_ sender: Any) {
          if(currentRowSelected != nil ){
              if AudioPlayer.isPlaying() {
                  AudioPlayer.pause()
                  playButton.setImage(UIImage(named: "play_button"), for: UIControlState.normal)
              } else {
                  AudioPlayer.play()
                  playButton.setImage(UIImage(named: "pause_button"), for: UIControlState.normal)
              }
  
              setUpBackgroundMode()
  
          }else{
              "Track is not selected from list"
          }
  
      }
  
  }
  
  
   extension MyAudiosViewController {
  
      override func remoteControlReceived(with event: UIEvent?) {
          if let receivedEvent = event {
              if (receivedEvent.type == .remoteControl) {
                  switch receivedEvent.subtype {
                  case .remoteControlTogglePlayPause:
                     playButtonPressed(AudioPlayer.isPlaying())
                  case .remoteControlPlay:
                  playButtonPressed(AudioPlayer.player?.play())
                  case .remoteControlPause:
                     playButtonPressed(AudioPlayer.player?.pause())
                  case .remoteControlNextTrack:
                       print("next pressed")
                  case .remoteControlPreviousTrack:
                       print("previous pressed")
                  default:
                      print("received sub type \(receivedEvent.subtype) Ignoring")
                  }
              }
          }
      }
  
      func setUpBackgroundMode() {
          if  let positionSong = AudioPlayer.getPlayingIndex() {
              let song = songDetailsArray[positionSong]
              let songData = song.audioDetails
  
          MPNowPlayingInfoCenter.default().nowPlayingInfo = [
              MPMediaItemPropertyTitle: songData?.title ?? "",
              MPMediaItemPropertyArtist: songData?.healerName ?? "",
              MPMediaItemPropertyPlaybackDuration: 
              self.player?.currentItem?.asset.duration
          ]
              UIApplication.shared.beginReceivingRemoteControlEvents()
  
          becomeFirstResponder()
         }
        }
    }
  </code></pre>