title: Android 6.0 - Set video speed with PlaybackParams
body: <p>I have problems about how to implement <a href="https://developer.android.com/reference/android/media/PlaybackParams.html" rel="noreferrer"><strong>PlaybackParams</strong></a> to set video speed:</p>
  
  <blockquote>
    <p><code>public PlaybackParams getPlaybackParams ()</code></p>
    
    <p>Added in API level 23 <br>
     Gets the playback rate using PlaybackParams.</p>
  </blockquote>
  
  <pre><code>PlaybackParams setSpeed (float speed) //Sets the speed factor.
  </code></pre>
  
  <blockquote>
    <p><strong>Returns</strong>: <br>
    the playback rate being used. <br>
    <strong>Throws IllegalStateException</strong>: <br>
    if the internal sync engine or the audio track has not been initialized.</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() 
  {
      @Override
      public void onPrepared(MediaPlayer mp) 
      {
          mp.setPlaybackParams(new PlaybackParams().setSpeed(1.f));
  
          if (mPlaybackState == PlaybackState.PLAYING) { mVideoView.start();}
      }
  });
  </code></pre>