Merge "MediaPlayerBase: Add PlayerEventCallback#onPlaybackSpeedChanged()" into pi-dev

This commit is contained in:
Jaewan Kim
2018-03-26 04:57:48 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 0 deletions

View File

@@ -337,6 +337,13 @@ public abstract class MediaPlayerBase implements AutoCloseable {
*/
public void onBufferingStateChanged(@NonNull MediaPlayerBase mpb,
@NonNull DataSourceDesc dsd, @BuffState int state) { }
/**
* Called to indicate that the playback speed has changed.
* @param mpb the player that is buffering
* @param speed the new playback speed.
*/
public void onPlaybackSpeedChanged(@NonNull MediaPlayerBase mpb, float speed) { }
}
}

View File

@@ -829,6 +829,15 @@ public class MediaSession2 implements AutoCloseable {
public void onBufferingStateChanged(@NonNull MediaSession2 session,
@NonNull MediaPlayerBase player, @NonNull MediaItem2 item, @BuffState int state) { }
/**
* Called to indicate that the playback speed has changed.
* @param session the session for this event
* @param player the player for this event
* @param speed the new playback speed.
*/
public void onPlaybackSpeedChanged(@NonNull MediaSession2 session,
@NonNull MediaPlayerBase player, float speed) { }
/**
* Called when a playlist is changed from the {@link MediaPlaylistAgent}.
* <p>