Skip to content

Commit

Permalink
feat(android): videoPlayer speed property
Browse files Browse the repository at this point in the history
  • Loading branch information
m1ga committed Mar 15, 2024
1 parent e963c72 commit c9437ac
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnErrorListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.PlaybackParams;
import android.net.Uri;
import android.os.Build;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
Expand Down Expand Up @@ -330,6 +332,13 @@ public void release()
@Override
public void onPrepared(MediaPlayer mp)
{

if (proxy.hasPropertyAndNotNull(TiC.PROPERTY_SPEED) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PlaybackParams myPlayBackParams = new PlaybackParams();
myPlayBackParams.setSpeed(TiConvert.toFloat(proxy.getProperty(TiC.PROPERTY_SPEED)));
mp.setPlaybackParams(myPlayBackParams);
}

getPlayerProxy().onPlaybackReady(mp.getDuration());
}

Expand Down

0 comments on commit c9437ac

Please sign in to comment.