title: Audio keeps playing when exoplayer releases
body: <p>I am using Exoplayer in my dialog. I want the video to play automatically when dialog opens. When
  <code>simpleExoPlayer.prepare()</code> snippet is active I am able to do autoplay but when I close the dialog audio keeps playing. Before activating <code>simpleExoPlayer.prepare()</code> audio stops when I dismiss dialog. Is there another method to autoplay exoplayer or stop the audio when dialog dismiss?</p>
  <pre><code>class VideoViewDialog (context: Context) : BaseDialog&lt;LayoutDialogVideoViewBinding&gt;(context) {
  
  
  private var videoUrl : String = &quot;&quot;
  private lateinit var simpleExoPlayer: ExoPlayer
  
  override fun populateUi() {
      setCanceledOnTouchOutside(true)
      mBinding?.apply {
  
          initializePlayer()
      }
  }
  
  
  private fun initializePlayer() {
      val mediaDataSourceFactory: DataSource.Factory = DefaultDataSource.Factory(context)
  
      val mediaSource = ProgressiveMediaSource.Factory(mediaDataSourceFactory).createMediaSource(
          MediaItem.fromUri(videoUrl))
  
      val mediaSourceFactory: MediaSource.Factory = DefaultMediaSourceFactory(mediaDataSourceFactory)
  
      simpleExoPlayer = ExoPlayer.Builder(context)
          .setMediaSourceFactory(mediaSourceFactory)
          .build()
  
      simpleExoPlayer.addMediaSource(mediaSource)
  
      simpleExoPlayer.playWhenReady = true
      simpleExoPlayer.prepare()
  
      mBinding?.apply {
  
          playerView.player = simpleExoPlayer
          playerView.requestFocus()
  
  
      }
      simpleExoPlayer.play()
  
  }
  
  private fun releasePlayer() {
      simpleExoPlayer.release()
  }
  
  public override fun onStart() {
      super.onStart()
  
      if (Util.SDK_INT &gt; 23) initializePlayer()
  }
  
  public override fun onStop() {
      super.onStop()
  
      if (Util.SDK_INT &gt; 23) releasePlayer()
  }
  
  override fun getLayoutRes(): Int {
      return R.layout.layout_dialog_video_view
  }
  
  
  companion object{
      fun newInstance(
          context: Context,
          videoUrl : String,
      ) : VideoViewDialog{
          val dialog = VideoViewDialog(context)
          dialog.also {
              it.videoUrl = videoUrl
          }
          return dialog
      }
  }
  }
  </code></pre>
  <p>I tried <code>.stop</code>, <code>clearVideoSurface()</code>, <code>playerView.player = null</code> before <code>.release()</code>. Didn't work</p>