Merge "MediaSession2: Implement fastForward() / rewind()" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-19 10:45:03 +00:00
committed by Android (Google) Code Review
2 changed files with 29 additions and 2 deletions

View File

@@ -129,6 +129,33 @@ public abstract class MediaPlayerBase implements AutoCloseable {
*/
public abstract void seekTo(long pos);
/**
* Fast forwards playback. If playback is already fast forwarding this may increase the rate.
* <p>
* Default implementation sets the playback speed to the 2.0f
* @see #setPlaybackSpeed(float)
* @hide
*/
// TODO(jaewan): Unhide (b/74724709)
public void fastForward() {
setPlaybackSpeed(2.0f);
}
/**
* Rewinds playback. If playback is already rewinding this may increase the rate.
* <p>
* Default implementation sets the playback speed to the -1.0f if
* {@link #isReversePlaybackSupported()} returns {@code true}.
* @see #setPlaybackSpeed(float)
* @hide
*/
// TODO(jaewan): Unhide (b/74724709)
public void rewind() {
if (isReversePlaybackSupported()) {
setPlaybackSpeed(-1.0f);
}
}
public static final long UNKNOWN_TIME = -1;
/**

View File

@@ -1418,14 +1418,14 @@ public class MediaSession2 implements AutoCloseable {
}
/**
* Start fast forwarding. If playback is already fast forwarding this may increase the rate.
* Fast forwards playback. If playback is already fast forwarding this may increase the rate.
*/
public void fastForward() {
mProvider.fastForward_impl();
}
/**
* Start rewinding. If playback is already rewinding this may increase the rate.
* Rewinds playback. If playback is already rewinding this may increase the rate.
*/
public void rewind() {
mProvider.rewind_impl();