title: Play/Pause YoutubePlayer programmatically after activity resume from background
body: <p>My application has activity A for playing Youtube video (using YoutubePlayerFragment) This activity A has an own button B to control playback. When activity loaded and is playing a video, I can use B button to control playback. Then I press Home button. When I resume activity A from recent task menu, the button B does not work anymore. I can only play video from its own Play button (inside YoutubePlayerFragment).
  Currently I store YoutubePlayer instance when <code>onInitializationSuccess</code> is called:</p>
  
  <pre><code>private val onInitializedListener = object : YouTubePlayer.OnInitializedListener {
      override fun onInitializationSuccess(provider: YouTubePlayer.Provider, youTubePlayer: YouTubePlayer, wasRestored: Boolean) {
          Log.d(DEBUG_TAG, "YoutubePlayer - onInitializationSuccess")
          if (!wasRestored) {
              mYoutubePlayer = youTubePlayer
              mYoutubePlayer!!.setPlayerStateChangeListener(playerStateChangeListener)
              mYoutubePlayer!!.setPlaybackEventListener(mPlaybackEventListener)
              mYoutubePlayer!!.setShowFullscreenButton(false)
              mYoutubePlayer!!.loadVideo(mCurrentVideoId)
          } else {
              Log.d(DEBUG_TAG, "Restored from a previously saved state")
          }
      }
  
      override fun onInitializationFailure(provider: YouTubePlayer.Provider, youTubeInitializationResult: YouTubeInitializationResult) {
          if (youTubeInitializationResult.isUserRecoverableError) {
              youTubeInitializationResult.getErrorDialog(this@KActivityPlayVideo, 1).show()
          } else {
              Toast.makeText(this@KActivityPlayVideo,
                      "Failed to initialize video, please try again!",
                      Toast.LENGTH_LONG).show()
          }
      }
  }
  </code></pre>
  
  <p>Button B uses this YoutubePlayer instance to call Play/Pause upon request. But when activity A goes to background and resume, this does not work anymore. Could anyone suggest me what is the problem here please? Thank you very much.</p>