Unverified Commit a43f9c7c authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge branch 'master' into maximumBitRate-adaptive-streaming

parents 5ab8165c b65bdb6a
Loading
Loading
Loading
Loading
+9 −0
Changes for CHANGELOG.md: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
## Changelog

### Version 4.1.1
* Don't initialize filters on iOS unless a filter is set. This was causing a startup performance regression [#1360](https://github.com/react-native-community/react-native-video/pull/1360)

### Version 4.1.0
* Generate onSeek on Android ExoPlayer & MediaPlayer after seek completes [#1351](https://github.com/react-native-community/react-native-video/pull/1351)
* Remove unneeded onVideoSaved event [#1350](https://github.com/react-native-community/react-native-video/pull/1350)
* Disable AirPlay if sidecar text tracks are enabled [#1304](https://github.com/react-native-community/react-native-video/pull/1304)
* Add possibility to remove black screen while video is loading in Exoplayer [#1355](https://github.com/react-native-community/react-native-video/pull/1355)

### Version 4.0.1
* Add missing files to package.json [#1342](https://github.com/react-native-community/react-native-video/pull/1342)

+36 −1
Changes for README.md: 36 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -264,6 +264,7 @@ var styles = StyleSheet.create({
* [fullscreenAutorotate](#fullscreenautorotate)
* [fullscreenOrientation](#fullscreenorientation)
* [headers](#headers)
* [hideShutterView](#hideshutterview)
* [id](#id)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [maxBitRate](#maxbitrate)
@@ -296,6 +297,7 @@ var styles = StyleSheet.create({
* [onLoad](#onload)
* [onLoadStart](#onloadstart)
* [onProgress](#onprogress)
* [onSeek](#onseek)
* [onTimedMetadata](#ontimedmetadata)

### Methods
@@ -417,6 +419,14 @@ headers={{

Platforms: Android ExoPlayer

#### hideShutterView
Controls whether the ExoPlayer shutter view (black screen while loading) is enabled.

* **false (default)** - Show shutter view 
* **true** - Hide shutter view

Platforms: Android ExoPlayer

#### id
Set the DOM id element so you can use document.getElementById on web platforms. Accepts string values.

@@ -667,6 +677,8 @@ uri | URL for the text track. Currently, only tracks hosted on a webserver are s

On iOS, sidecar text tracks are only supported for individual files, not HLS playlists. For HLS, you should include the text tracks as part of the playlist.

Note: Due to iOS limitations, sidecar text tracks are not compatible with Airplay. If textTracks are specified, AirPlay support will be automatically disabled.

Example:
```
import { TextTrackType }, Video from 'react-native-video';
@@ -860,6 +872,29 @@ Example:

Platforms: all

#### onSeek
Callback function that is called when a seek completes.

Payload:

Property | Type | Description
--- | --- | ---
currentTime | number | The current time after the seek
seekTime | number | The requested time

Example:
```
{
  currentTime: 100.5
  seekTime: 100
}
```

Both the currentTime & seekTime are reported because the video player may not seek to the exact requested position in order to improve seek performance.


Platforms: Android ExoPlayer, Android MediaPlayer, iOS, Windows UWP

#### onTimedMetadata
Callback function that is called when timed metadata becomes available

@@ -953,7 +988,7 @@ Platforms: iOS

Seek to the specified position represented by seconds. seconds is a float value.

`seek()` can only be called after the `onLoad` event has fired.
`seek()` can only be called after the `onLoad` event has fired. Once completed, the [onSeek](#onseek) event will be called.

Example:
```
+1 −0
Changes for Video.js: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -384,6 +384,7 @@ Video.propTypes = {
  fullscreenOrientation: PropTypes.oneOf(['all','landscape','portrait']),
  progressUpdateInterval: PropTypes.number,
  useTextureView: PropTypes.bool,
  hideShutterView: PropTypes.bool,
  onLoadStart: PropTypes.func,
  onLoad: PropTypes.func,
  onBuffer: PropTypes.func,
+10 −0
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public final class ExoPlayerView extends FrameLayout {
    private ViewGroup.LayoutParams layoutParams;

    private boolean useTextureView = false;
    private boolean hideShutterView = false;

    public ExoPlayerView(Context context) {
        this(context, null);
@@ -106,6 +107,10 @@ public final class ExoPlayerView extends FrameLayout {
        }
    }

    private void updateShutterViewVisibility() {
        shutterView.setVisibility(this.hideShutterView ? View.INVISIBLE : View.VISIBLE);
    }

    /**
     * Set the {@link SimpleExoPlayer} to use. The {@link SimpleExoPlayer#setTextOutput} and
     * {@link SimpleExoPlayer#setVideoListener} method of the player will be called and previous
@@ -161,6 +166,11 @@ public final class ExoPlayerView extends FrameLayout {
        updateSurfaceView();
    }

    public void setHideShutterView(boolean hideShutterView) {
        this.hideShutterView = hideShutterView;
        updateShutterViewVisibility();
    }

    private final Runnable measureAndLayout = new Runnable() {
        @Override
        public void run() {
+9 −2
Changes for android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java: 9 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -111,6 +111,7 @@ class ReactExoplayerView extends FrameLayout implements
    private float rate = 1f;
    private float audioVolume = 1f;
    private int maxBitRate = 0;
    private long seekTime = C.TIME_UNSET;

    private int minBufferMs = DefaultLoadControl.DEFAULT_MIN_BUFFER_MS;
    private int maxBufferMs = DefaultLoadControl.DEFAULT_MAX_BUFFER_MS;
@@ -131,6 +132,7 @@ class ReactExoplayerView extends FrameLayout implements
    private float mProgressUpdateInterval = 250.0f;
    private boolean playInBackground = false;
    private boolean useTextureView = false;
    private boolean hideShutterView = false;
    private Map<String, String> requestHeaders;
    // \ End props

@@ -609,7 +611,8 @@ class ReactExoplayerView extends FrameLayout implements

    @Override
    public void onSeekProcessed() {
        // Do nothing.
        eventEmitter.seek(player.getCurrentPosition(), seekTime);
        seekTime = C.TIME_UNSET;
    }

    @Override
@@ -896,7 +899,7 @@ class ReactExoplayerView extends FrameLayout implements

    public void seekTo(long positionMs) {
        if (player != null) {
            eventEmitter.seek(player.getCurrentPosition(), positionMs);
            seekTime = positionMs;
            player.seekTo(positionMs);
        }
    }
@@ -966,6 +969,10 @@ class ReactExoplayerView extends FrameLayout implements
        exoPlayerView.setUseTextureView(useTextureView);
    }

    public void setHideShutterView(boolean hideShutterView) {
        exoPlayerView.setHideShutterView(hideShutterView);
    }

    public void setBufferConfig(int newMinBufferMs, int newMaxBufferMs, int newBufferForPlaybackMs, int newBufferForPlaybackAfterRebufferMs) {
        minBufferMs = newMinBufferMs;
        maxBufferMs = newMaxBufferMs;
Loading