Merge branch 'master' into cr-android-improvements
This commit is contained in:
@@ -9,7 +9,7 @@ https://github.com/google/ExoPlayer
|
||||
## Benefits over `react-native-video@0.9.0`:
|
||||
|
||||
- Android Video library built by Google, with a lot of support
|
||||
- Supports DASH, HlS, & SmoothStreaming adaptive streams
|
||||
- Supports DASH, HLS, & SmoothStreaming adaptive streams
|
||||
- Supports formats such as MP4, M4A, FMP4, WebM, MKV, MP3, Ogg, WAV, MPEG-TS, MPEG-PS, FLV and ADTS (AAC).
|
||||
- Fewer device specific issues
|
||||
- Highly customisable
|
||||
|
@@ -26,9 +26,14 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Remove this repository line after google releases to google() or mavenCentral()
|
||||
maven { url "https://dl.google.com/android/maven2" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
|
||||
implementation('com.google.android.exoplayer:exoplayer:2.13.2') {
|
||||
implementation('com.google.android.exoplayer:exoplayer:2.13.3') {
|
||||
exclude group: 'com.android.support'
|
||||
}
|
||||
|
||||
@@ -37,9 +42,9 @@ dependencies {
|
||||
implementation "androidx.core:core:1.1.0"
|
||||
implementation "androidx.media:media:1.1.0"
|
||||
|
||||
implementation('com.google.android.exoplayer:extension-okhttp:2.13.2') {
|
||||
implementation('com.google.android.exoplayer:extension-okhttp:2.13.3') {
|
||||
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||
}
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.14.3'
|
||||
implementation 'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'
|
||||
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ public final class ExoPlayerView extends FrameLayout {
|
||||
clearVideoView();
|
||||
}
|
||||
this.player = player;
|
||||
shutterView.setVisibility(VISIBLE);
|
||||
shutterView.setVisibility(this.hideShutterView ? View.INVISIBLE : View.VISIBLE);
|
||||
if (player != null) {
|
||||
setVideoView();
|
||||
player.addVideoListener(componentListener);
|
||||
@@ -222,7 +222,7 @@ public final class ExoPlayerView extends FrameLayout {
|
||||
}
|
||||
}
|
||||
// Video disabled so the shutter must be closed.
|
||||
shutterView.setVisibility(VISIBLE);
|
||||
shutterView.setVisibility(this.hideShutterView ? View.INVISIBLE : View.VISIBLE);
|
||||
}
|
||||
|
||||
public void invalidateAspectRatio() {
|
||||
|
@@ -605,7 +605,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
|
||||
PlaybackParameters params = new PlaybackParameters(rate, 1f);
|
||||
player.setPlaybackParameters(params);
|
||||
|
||||
}
|
||||
|
||||
private DrmSessionManager initializePlayerDrm(ReactExoplayerView self) {
|
||||
@@ -1284,7 +1283,8 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
// Special case for decoder initialization failures.
|
||||
MediaCodecRenderer.DecoderInitializationException decoderInitializationException =
|
||||
(MediaCodecRenderer.DecoderInitializationException) cause;
|
||||
if (decoderInitializationException.codecInfo.name == null) {
|
||||
if (decoderInitializationException.codecInfo == null
|
||||
|| decoderInitializationException.codecInfo.name == null) {
|
||||
if (decoderInitializationException.getCause() instanceof MediaCodecUtil.DecoderQueryException) {
|
||||
errorCode = "2011";
|
||||
errorString = getResources().getString(R.string.error_querying_decoders);
|
||||
@@ -1581,7 +1581,7 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
tracks[0] = closestTrackIndex;
|
||||
}
|
||||
}
|
||||
} else if (rendererIndex == C.TRACK_TYPE_TEXT && Util.SDK_INT > 18) { // Text default
|
||||
} else if (trackType == C.TRACK_TYPE_TEXT && Util.SDK_INT > 18) { // Text default
|
||||
// Use system settings if possible
|
||||
CaptioningManager captioningManager
|
||||
= (CaptioningManager)themedReactContext.getSystemService(Context.CAPTIONING_SERVICE);
|
||||
@@ -1706,13 +1706,11 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
|
||||
public void setMutedModifier(boolean muted) {
|
||||
this.muted = muted;
|
||||
audioVolume = muted ? 0.f : 1.f;
|
||||
if (player != null) {
|
||||
player.setVolume(audioVolume);
|
||||
player.setVolume(muted ? 0.f : audioVolume);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setVolumeModifier(float volume) {
|
||||
audioVolume = volume;
|
||||
if (player != null) {
|
||||
|
Reference in New Issue
Block a user