diff --git a/android/modules/media/src/java/ti/modules/titanium/media/TiUIVideoView.java b/android/modules/media/src/java/ti/modules/titanium/media/TiUIVideoView.java index b3e1edaee54..2b7c6f91b7a 100644 --- a/android/modules/media/src/java/ti/modules/titanium/media/TiUIVideoView.java +++ b/android/modules/media/src/java/ti/modules/titanium/media/TiUIVideoView.java @@ -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; @@ -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()); } diff --git a/apidoc/Titanium/Media/VideoPlayer.yml b/apidoc/Titanium/Media/VideoPlayer.yml index 1dffa9c0787..d723797acb9 100644 --- a/apidoc/Titanium/Media/VideoPlayer.yml +++ b/apidoc/Titanium/Media/VideoPlayer.yml @@ -575,6 +575,15 @@ properties: platforms: [iphone, ipad, macos] type: MovieSize + - name: speed + summary: Playback speed of the video. + description: | + Playback speed of the video. Android: only available for API level >= 23. + type: Number + platforms: [android] + since: 12.4.0 + availability: creation + - name: overlayView summary: Use the overlay view to add additional custom views between the video content and the controls. description: |