Merge branch 'react-native-video:master' into feat/expo-fullscreen
This commit is contained in:
commit
3e4e4e6a12
4
API.md
4
API.md
@ -214,7 +214,7 @@ Follow the manual linking instuctions for React Native Windows 0.62 above, but s
|
|||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
Run `yarn xbasic install` before running any of the examples.
|
Run `yarn xbasic install` in the root directory before running any of the examples.
|
||||||
|
|
||||||
### iOS Example
|
### iOS Example
|
||||||
```
|
```
|
||||||
@ -434,6 +434,8 @@ Determines whether video audio should override background music/audio in Android
|
|||||||
* **false (default)** - Override background audio/music
|
* **false (default)** - Override background audio/music
|
||||||
* **true** - Let background audio/music from other apps play
|
* **true** - Let background audio/music from other apps play
|
||||||
|
|
||||||
|
Note: Allows multiple videos to play if set to `true`. If `false`, when one video is playing and another is started, the first video will be paused.
|
||||||
|
|
||||||
Platforms: Android
|
Platforms: Android
|
||||||
|
|
||||||
#### disableDisconnectError
|
#### disableDisconnectError
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
### Version 6.0.0-alpha3
|
||||||
|
- Upgrade ExoPlayer to 2.18.1 [#2846](https://github.com/react-native-video/react-native-video/pull/2846)
|
||||||
|
|
||||||
### Version 6.0.0-alpha.2
|
### Version 6.0.0-alpha.2
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
|
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
|
||||||
implementation('com.google.android.exoplayer:exoplayer:2.17.1') {
|
implementation('com.google.android.exoplayer:exoplayer:2.18.1') {
|
||||||
exclude group: 'com.android.support'
|
exclude group: 'com.android.support'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ dependencies {
|
|||||||
implementation "androidx.media:media:1.1.0"
|
implementation "androidx.media:media:1.1.0"
|
||||||
implementation 'androidx.activity:activity:1.4.0'
|
implementation 'androidx.activity:activity:1.4.0'
|
||||||
|
|
||||||
implementation('com.google.android.exoplayer:extension-okhttp:2.17.1') {
|
implementation('com.google.android.exoplayer:extension-okhttp:2.18.1') {
|
||||||
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
|
||||||
}
|
}
|
||||||
implementation 'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'
|
implementation 'com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}'
|
||||||
|
@ -19,7 +19,7 @@ import com.google.android.exoplayer2.PlaybackParameters;
|
|||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.Timeline;
|
import com.google.android.exoplayer2.Timeline;
|
||||||
import com.google.android.exoplayer2.TracksInfo;
|
import com.google.android.exoplayer2.Tracks;
|
||||||
import com.google.android.exoplayer2.text.Cue;
|
import com.google.android.exoplayer2.text.Cue;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
||||||
import com.google.android.exoplayer2.ui.SubtitleView;
|
import com.google.android.exoplayer2.ui.SubtitleView;
|
||||||
@ -241,7 +241,7 @@ public final class ExoPlayerView extends FrameLayout {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCues(List<Cue> cues) {
|
public void onCues(List<Cue> cues) {
|
||||||
subtitleLayout.onCues(cues);
|
subtitleLayout.setCues(cues);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExoPlayer.VideoListener implementation
|
// ExoPlayer.VideoListener implementation
|
||||||
@ -295,7 +295,7 @@ public final class ExoPlayerView extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTracksInfoChanged(TracksInfo tracksInfo) {
|
public void onTracksChanged(Tracks tracks) {
|
||||||
updateForCurrentTrackSelections();
|
updateForCurrentTrackSelections();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,9 @@ import com.google.android.exoplayer2.PlaybackParameters;
|
|||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.Timeline;
|
import com.google.android.exoplayer2.Timeline;
|
||||||
import com.google.android.exoplayer2.TracksInfo;
|
import com.google.android.exoplayer2.Tracks;
|
||||||
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
|
import com.google.android.exoplayer2.drm.DefaultDrmSessionManager;
|
||||||
|
import com.google.android.exoplayer2.drm.DefaultDrmSessionManagerProvider;
|
||||||
import com.google.android.exoplayer2.drm.DrmSessionEventListener;
|
import com.google.android.exoplayer2.drm.DrmSessionEventListener;
|
||||||
import com.google.android.exoplayer2.drm.DrmSessionManager;
|
import com.google.android.exoplayer2.drm.DrmSessionManager;
|
||||||
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
|
import com.google.android.exoplayer2.drm.DrmSessionManagerProvider;
|
||||||
@ -74,8 +75,8 @@ import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
|
|||||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
||||||
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
|
import com.google.android.exoplayer2.trackselection.ExoTrackSelection;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelectionOverrides;
|
import com.google.android.exoplayer2.trackselection.TrackSelectionParameters;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelectionOverrides.TrackSelectionOverride;
|
import com.google.android.exoplayer2.trackselection.TrackSelectionOverride;
|
||||||
import com.google.android.exoplayer2.ui.PlayerControlView;
|
import com.google.android.exoplayer2.ui.PlayerControlView;
|
||||||
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
import com.google.android.exoplayer2.upstream.BandwidthMeter;
|
||||||
import com.google.android.exoplayer2.upstream.DataSource;
|
import com.google.android.exoplayer2.upstream.DataSource;
|
||||||
@ -575,7 +576,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
|
|
||||||
private void initializePlayerCore(ReactExoplayerView self) {
|
private void initializePlayerCore(ReactExoplayerView self) {
|
||||||
ExoTrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory();
|
ExoTrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory();
|
||||||
self.trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
|
self.trackSelector = new DefaultTrackSelector(getContext(), videoTrackSelectionFactory);
|
||||||
self.trackSelector.setParameters(trackSelector.buildUponParameters()
|
self.trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||||
.setMaxVideoBitrate(maxBitRate == 0 ? Integer.MAX_VALUE : maxBitRate));
|
.setMaxVideoBitrate(maxBitRate == 0 ? Integer.MAX_VALUE : maxBitRate));
|
||||||
|
|
||||||
@ -731,6 +732,8 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
return drmSessionManager;
|
return drmSessionManager;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
drmProvider = new DefaultDrmSessionManagerProvider();
|
||||||
}
|
}
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case C.TYPE_SS:
|
case C.TYPE_SS:
|
||||||
@ -1296,7 +1299,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTracksInfoChanged(TracksInfo tracksInfo) {
|
public void onTracksChanged(Tracks tracks) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1610,7 +1613,7 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
DefaultTrackSelector.Parameters selectionParameters = trackSelector.getParameters()
|
DefaultTrackSelector.Parameters selectionParameters = trackSelector.getParameters()
|
||||||
.buildUpon()
|
.buildUpon()
|
||||||
.setRendererDisabled(rendererIndex, false)
|
.setRendererDisabled(rendererIndex, false)
|
||||||
.setTrackSelectionOverrides(new TrackSelectionOverrides.Builder().addOverride(selectionOverride).build())
|
.addOverride(selectionOverride)
|
||||||
.build();
|
.build();
|
||||||
trackSelector.setParameters(selectionParameters);
|
trackSelector.setParameters(selectionParameters);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user