mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-05-13 08:20:51 -05:00
refactor
This commit is contained in:
+1
@@ -158,6 +158,7 @@ public class ExoPlayerController implements EventListener, PlayerController {
|
||||
|
||||
for (TrackSelection selection : trackSelections.getAll()) {
|
||||
if (selection != null) {
|
||||
Log.d(TAG, "onTracksChanged: format: " + selection.getSelectedFormat());
|
||||
mEventListener.onTrackChanged(ExoFormatItem.from(selection.getSelectedFormat()));
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -8,6 +8,7 @@ import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||
import com.google.android.exoplayer2.trackselection.TrackSelection;
|
||||
import com.google.android.exoplayer2.trackselection.TrackSelection.Definition;
|
||||
import com.google.android.exoplayer2.trackselection.TrackSelection.Factory;
|
||||
import com.liskovsoft.sharedutils.mylogger.Log;
|
||||
|
||||
public class RestoreTrackSelector extends DefaultTrackSelector {
|
||||
private static final String TAG = RestoreTrackSelector.class.getSimpleName();
|
||||
@@ -52,12 +53,15 @@ public class RestoreTrackSelector extends DefaultTrackSelector {
|
||||
protected TrackSelection.Definition selectVideoTrack(TrackGroupArray groups, int[][] formatSupports, int mixedMimeTypeAdaptationSupports,
|
||||
Parameters params, boolean enableAdaptiveTrackSelection) throws ExoPlaybackException {
|
||||
if (mCallback != null) {
|
||||
Log.d(TAG, "selectVideoTrack: choose custom processing");
|
||||
TrackSelection.Definition definition = mCallback.onSelectVideoTrack(groups, params);
|
||||
if (definition != null) {
|
||||
return definition;
|
||||
}
|
||||
}
|
||||
|
||||
Log.d(TAG, "selectVideoTrack: choose default processing");
|
||||
|
||||
Definition definition = super.selectVideoTrack(groups, formatSupports, mixedMimeTypeAdaptationSupports, params, enableAdaptiveTrackSelection);
|
||||
|
||||
// Don't invoke if track already has been selected by the app
|
||||
|
||||
Reference in New Issue
Block a user