title: Media Controls in Picture in Picture ExoPlayer
body: <p>I am using ExoPlayer to play my streams. I have implemented Picture in Picture which works pretty good but i haven't been able to implement play, pause controls on PiP window until now. I know that by defaul Exoplayer + Picture in Picture does not give us the Picture in Picture media controls we see in the Youtube player for instance.</p>
  
  <p>Anyway i searched a lot about this issue, and found out a code that may help me but the problem is that the code is in Kotlin and i am using Java, as a beginner i wasn't able to find the alternative code for Java to make it work.</p>
  
  <p>This is the recommendation i got:</p>
  
  <pre><code>    val mediaSession = MediaSessionCompat(this, packageName)
  val mediaSessionConnector = MediaSessionConnector(mediaSession)
  mediaSessionConnector.setPlayer(player, null)
  mediaSession.isActive = true
  </code></pre>
  
  <p>I know that i should implement it onStart() after handling Exoplayer. I thinked about converting my project in Kotlin but as a beginner i would like to focus in Java and instead find a way to fix this.</p>