float getVolume() { assertIsInPlaybackState(); return volume; } }
int getBufferPercentage() throws IllegalStateException { assertIsInPlaybackState(); return currentBufferPercentage; }
void pause() throws IllegalStateException { assertIsInPlaybackState(); if (isPlaying()) { mediaPlayer.pause(); currentState = PAUSED; } }
boolean clearAudioTrackSelection() { assertIsInPlaybackState(); NoPlayerLog.w("Tried to clear audio track selection but has not been implemented for MediaPlayer."); return false; }
List<PlayerSubtitleTrack> getSubtitleTracks() throws IllegalStateException { assertIsInPlaybackState(); NoPlayerLog.w("Tried to get subtitle tracks but has not been implemented for MediaPlayer."); return Collections.emptyList(); }
void setVolume(float volume) { assertIsInPlaybackState(); this.volume = volume; mediaPlayer.setVolume(volume, volume); }
void start(Either<Surface, SurfaceHolder> surface) throws IllegalStateException { assertIsInPlaybackState(); attachSurface(mediaPlayer, surface); currentState = PLAYING; mediaPlayer.start(); }
List<PlayerVideoTrack> getVideoTracks() { assertIsInPlaybackState(); NoPlayerLog.w("Tried to get video tracks but has not been implemented for MediaPlayer."); return Collections.emptyList(); }
boolean clearVideoTrackSelection() { assertIsInPlaybackState(); NoPlayerLog.w("Tried to clear video track selection but has not been implemented for MediaPlayer."); return false; }
boolean clearSubtitleTrack() throws IllegalStateException { assertIsInPlaybackState(); NoPlayerLog.w("Tried to hide subtitle track but has not been implemented for MediaPlayer."); return false; }
boolean selectSubtitleTrack(PlayerSubtitleTrack subtitleTrack) throws IllegalStateException { assertIsInPlaybackState(); NoPlayerLog.w("Tried to select subtitle track but has not been implemented for MediaPlayer."); return false; }
boolean selectVideoTrack(PlayerVideoTrack videoTrack) { assertIsInPlaybackState(); NoPlayerLog.w("Tried to select a video track but has not been implemented for MediaPlayer."); return false; }
int mediaDurationInMillis() throws IllegalStateException { assertIsInPlaybackState(); return mediaPlayer.getDuration(); }
boolean selectAudioTrack(PlayerAudioTrack playerAudioTrack) throws IllegalStateException { assertIsInPlaybackState(); return trackSelector.selectAudioTrack(mediaPlayer, playerAudioTrack); }
void seekTo(long positionInMillis) throws IllegalStateException { assertIsInPlaybackState(); mediaPlayer.seekTo((int) positionInMillis); }
int currentPositionInMillis() throws IllegalStateException { assertIsInPlaybackState(); return mediaPlayer.getCurrentPosition(); }
void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener seekToResettingSeekListener) throws IllegalStateException { assertIsInPlaybackState(); mediaPlayer.setOnSeekCompleteListener(seekToResettingSeekListener); }
AudioTracks getAudioTracks() throws IllegalStateException { assertIsInPlaybackState(); return trackSelector.getAudioTracks(mediaPlayer); }
void setRepeating(boolean repeating) { assertIsInPlaybackState(); mediaPlayer.setLooping(repeating); }
Optional<PlayerVideoTrack> getSelectedVideoTrack() { assertIsInPlaybackState(); NoPlayerLog.w("Tried to get the currently playing video track but has not been implemented for MediaPlayer."); return Optional.absent(); }