Added VideoPlayerService#getPlayBackSpeed

This commit is contained in:
Florian CUNY 2020-07-04 22:30:00 +02:00
parent 9f892a5065
commit 8d7063ee78

View File

@ -178,11 +178,18 @@ public class VideoPlayerService extends Service {
//Playback speed control //Playback speed control
public void setPlayBackSpeed(float speed) { public void setPlayBackSpeed(float speed) {
Log.v(TAG, "setPlayBackSpeed..."); Log.v(TAG, "setPlayBackSpeed...");
player.setPlaybackParameters(new PlaybackParameters(speed)); player.setPlaybackParameters(new PlaybackParameters(speed));
} }
/**
* Returns the current playback speed of the player.
* @return the current playback speed of the player.
*/
public float getPlayBackSpeed() {
return player.getPlaybackParameters().speed;
}
public void playVideo() { public void playVideo() {
Context context = this; Context context = this;