Java Code Examples for com.google.android.exoplayer2.trackselection.TrackSelection#onPlaybackSpeed()
The following examples show how to use
com.google.android.exoplayer2.trackselection.TrackSelection#onPlaybackSpeed() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaPeriodHolder.java From Telegram-FOSS with GNU General Public License v2.0 | 6 votes |
/** * Selects tracks for the period and returns the new result if the selection changed. Must only be * called if {@link #prepared} is {@code true}. * * @param playbackSpeed The current playback speed. * @param timeline The current {@link Timeline}. * @return The {@link TrackSelectorResult} if the result changed. Or null if nothing changed. * @throws ExoPlaybackException If an error occurs during track selection. */ @Nullable public TrackSelectorResult selectTracks(float playbackSpeed, Timeline timeline) throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, getTrackGroups(), info.id, timeline); if (selectorResult.isEquivalent(trackSelectorResult)) { return null; } for (TrackSelection trackSelection : selectorResult.selections.getAll()) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } return selectorResult; }
Example 2
Source File: MediaPeriodHolder.java From Telegram with GNU General Public License v2.0 | 6 votes |
/** * Selects tracks for the period and returns the new result if the selection changed. Must only be * called if {@link #prepared} is {@code true}. * * @param playbackSpeed The current playback speed. * @param timeline The current {@link Timeline}. * @return The {@link TrackSelectorResult} if the result changed. Or null if nothing changed. * @throws ExoPlaybackException If an error occurs during track selection. */ @Nullable public TrackSelectorResult selectTracks(float playbackSpeed, Timeline timeline) throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, getTrackGroups(), info.id, timeline); if (selectorResult.isEquivalent(trackSelectorResult)) { return null; } for (TrackSelection trackSelection : selectorResult.selections.getAll()) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } return selectorResult; }
Example 3
Source File: MediaPeriodHolder.java From MediaSDK with Apache License 2.0 | 5 votes |
/** * Selects tracks for the period. Must only be called if {@link #prepared} is {@code true}. * * <p>The new track selection needs to be applied with {@link * #applyTrackSelection(TrackSelectorResult, long, boolean)} before taking effect. * * @param playbackSpeed The current playback speed. * @param timeline The current {@link Timeline}. * @return The {@link TrackSelectorResult}. * @throws ExoPlaybackException If an error occurs during track selection. */ public TrackSelectorResult selectTracks(float playbackSpeed, Timeline timeline) throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, getTrackGroups(), info.id, timeline); for (TrackSelection trackSelection : selectorResult.selections.getAll()) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } return selectorResult; }
Example 4
Source File: ExoPlayerImplInternal.java From MediaSDK with Apache License 2.0 | 5 votes |
private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getPlayingPeriod(); while (periodHolder != null) { TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } periodHolder = periodHolder.getNext(); } }
Example 5
Source File: MediaPeriodHolder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public boolean selectTracks(float playbackSpeed) throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, trackGroups); if (selectorResult.isEquivalent(periodTrackSelectorResult)) { return false; } trackSelectorResult = selectorResult; for (TrackSelection trackSelection : trackSelectorResult.selections.getAll()) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } return true; }
Example 6
Source File: ExoPlayerImplInternal.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getFrontPeriod(); while (periodHolder != null) { if (periodHolder.trackSelectorResult != null) { TrackSelection[] trackSelections = periodHolder.trackSelectorResult.selections.getAll(); for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } } periodHolder = periodHolder.next; } }
Example 7
Source File: MediaPeriodHolder.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
public boolean selectTracks(float playbackSpeed) throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, trackGroups); if (selectorResult.isEquivalent(periodTrackSelectorResult)) { return false; } trackSelectorResult = selectorResult; for (TrackSelection trackSelection : trackSelectorResult.selections.getAll()) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } return true; }
Example 8
Source File: ExoPlayerImplInternal.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getFrontPeriod(); while (periodHolder != null) { if (periodHolder.trackSelectorResult != null) { TrackSelection[] trackSelections = periodHolder.trackSelectorResult.selections.getAll(); for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } } periodHolder = periodHolder.next; } }
Example 9
Source File: ExoPlayerImplInternal.java From Telegram-FOSS with GNU General Public License v2.0 | 5 votes |
private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getFrontPeriod(); while (periodHolder != null && periodHolder.prepared) { TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } periodHolder = periodHolder.getNext(); } }
Example 10
Source File: ExoPlayerImplInternal.java From Telegram with GNU General Public License v2.0 | 5 votes |
private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getFrontPeriod(); while (periodHolder != null && periodHolder.prepared) { TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } } periodHolder = periodHolder.getNext(); } }