Merge "MediaSession2: Implement fastForward() / rewind()" into pi-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d65bb20283
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user