Skip to content

Commit

Permalink
Revert exoplayer upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfNieuwenhuizen committed Aug 1, 2018
1 parent 952909d commit 941ecc0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 53 deletions.
4 changes: 2 additions & 2 deletions android-exoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
dependencies {
//noinspection GradleDynamicVersion
provided "com.facebook.react:react-native:${_reactNativeVersion}"
compile 'com.google.android.exoplayer:exoplayer:2.8.2'
compile('com.google.android.exoplayer:extension-okhttp:2.8.2') {
compile 'com.google.android.exoplayer:exoplayer:2.7.3'
compile('com.google.android.exoplayer:extension-okhttp:2.7.3') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
compile 'com.squareup.okhttp3:okhttp:3.9.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,57 +727,57 @@ public void setRepeatModifier(boolean repeat) {
}

public void setSelectedTextTrack(String type, Dynamic value) {
// textTrackType = type;
// textTrackValue = value;
//
// int index = getTextTrackRendererIndex();
// if (index == C.INDEX_UNSET) {
// return;
// }
// MappingTrackSelector.MappedTrackInfo info = trackSelector.getCurrentMappedTrackInfo();
// if (info == null) {
// return;
// }
//
// TrackGroupArray groups = info.getTrackGroups(index);
// int trackIndex = C.INDEX_UNSET;
// if (TextUtils.isEmpty(type)) {
// // Do nothing
// } else if (type.equals("disabled")) {
// trackSelector.setSelectionOverride(index, groups, null);
// return;
// } else if (type.equals("language")) {
// for (int i = 0; i < groups.length; ++i) {
// Format format = groups.get(i).getFormat(0);
// if (format.language != null && format.language.equals(value.asString())) {
// trackIndex = i;
// break;
// }
// }
// } else if (type.equals("title")) {
// for (int i = 0; i < groups.length; ++i) {
// Format format = groups.get(i).getFormat(0);
// if (format.id != null && format.id.equals(value.asString())) {
// trackIndex = i;
// break;
// }
// }
// } else if (type.equals("index")) {
// trackIndex = value.asInt();
// } else { // default. invalid type or "system"
// trackSelector.clearSelectionOverrides(index);
// return;
// }
//
// if (trackIndex == C.INDEX_UNSET) {
// trackSelector.clearSelectionOverrides(trackIndex);
// return;
// }
//
// MappingTrackSelector.SelectionOverride override
// = new MappingTrackSelector.SelectionOverride(
// new FixedTrackSelection.Factory(), trackIndex, 0);
// trackSelector.setSelectionOverride(index, groups, override);
textTrackType = type;
textTrackValue = value;

int index = getTextTrackRendererIndex();
if (index == C.INDEX_UNSET) {
return;
}
MappingTrackSelector.MappedTrackInfo info = trackSelector.getCurrentMappedTrackInfo();
if (info == null) {
return;
}

TrackGroupArray groups = info.getTrackGroups(index);
int trackIndex = C.INDEX_UNSET;
if (TextUtils.isEmpty(type)) {
// Do nothing
} else if (type.equals("disabled")) {
trackSelector.setSelectionOverride(index, groups, null);
return;
} else if (type.equals("language")) {
for (int i = 0; i < groups.length; ++i) {
Format format = groups.get(i).getFormat(0);
if (format.language != null && format.language.equals(value.asString())) {
trackIndex = i;
break;
}
}
} else if (type.equals("title")) {
for (int i = 0; i < groups.length; ++i) {
Format format = groups.get(i).getFormat(0);
if (format.id != null && format.id.equals(value.asString())) {
trackIndex = i;
break;
}
}
} else if (type.equals("index")) {
trackIndex = value.asInt();
} else { // default. invalid type or "system"
trackSelector.clearSelectionOverrides(index);
return;
}

if (trackIndex == C.INDEX_UNSET) {
trackSelector.clearSelectionOverrides(trackIndex);
return;
}

MappingTrackSelector.SelectionOverride override
= new MappingTrackSelector.SelectionOverride(
new FixedTrackSelection.Factory(), trackIndex, 0);
trackSelector.setSelectionOverride(index, groups, override);
}

public void setPausedModifier(boolean paused) {
Expand Down

0 comments on commit 941ecc0

Please sign in to comment.