use of com.google.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult in project ExoPlayer by google.
the class CastPlayer method setPlaybackParameters.
@Override
public void setPlaybackParameters(PlaybackParameters playbackParameters) {
if (remoteMediaClient == null) {
return;
}
PlaybackParameters actualPlaybackParameters = new PlaybackParameters(Util.constrainValue(playbackParameters.speed, MIN_SPEED_SUPPORTED, MAX_SPEED_SUPPORTED));
setPlaybackParametersAndNotifyIfChanged(actualPlaybackParameters);
listeners.flushEvents();
PendingResult<MediaChannelResult> pendingResult = remoteMediaClient.setPlaybackRate(actualPlaybackParameters.speed, /* customData= */
null);
this.playbackParameters.pendingResultCallback = new ResultCallback<MediaChannelResult>() {
@Override
public void onResult(MediaChannelResult mediaChannelResult) {
if (remoteMediaClient != null) {
updatePlaybackRateAndNotifyIfChanged(this);
listeners.flushEvents();
}
}
};
pendingResult.setResultCallback(this.playbackParameters.pendingResultCallback);
}
Aggregations