diff --git a/API.md b/API.md index bf748016..625efeb5 100644 --- a/API.md +++ b/API.md @@ -316,12 +316,14 @@ var styles = StyleSheet.create({ ### Event props + | Name | Platforms Support | |-------------------------------------------------------------------------------------------------|---------------------------| | [onAudioBecomingNoisy](#onaudiobecomingnoisy) | Android, iOS | | [onBandwidthUpdate](#onbandwidthupdate) | Android | | [onBuffer](#onbuffer) | Android, iOS | | [onEnd](#onend) | All | +| [onError](#onerror) | Android, iOS | | [onExternalPlaybackChange](#onexternalplaybackchange) | iOS | | [onFullscreenPlayerWillPresent](#onfullscreenplayerwillpresent) | Android, iOS | | [onFullscreenPlayerDidPresent](#onfullscreenplayerdidpresent) | Android, iOS | @@ -338,7 +340,6 @@ var styles = StyleSheet.create({ | [onSeek](#onseek) | Android, iOS, Windows UWP | | [onTimedMetadata](#ontimedmetadata) | Android, iOS | - ### Methods | Name |Plateforms Support | |--|--| @@ -1026,6 +1027,17 @@ Payload: none Platforms: all +#### onError +Callback function that is called when the player experiences a playback error. + +Payload: + +Property | Type | Description +--- | --- | --- +error | object | Object containing properties with information about the error + +Platforms: all + #### onExternalPlaybackChange Callback function that is called when external playback mode for current playing video has changed. Mostly useful when connecting/disconnecting to Apple TV – it's called on connection/disconnection. @@ -1689,3 +1701,4 @@ allprojects { } ``` If you encounter an error `Could not find com.android.support:support-annotations:27.0.0.` reinstall your Android Support Repository. + diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index 12b1b25d..8e25e158 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -685,7 +685,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH if _controls { let viewController:UIViewController! = self.reactViewController() - viewController.addChild(_playerViewController) + viewController?.addChild(_playerViewController) self.addSubview(_playerViewController.view) } diff --git a/package.json b/package.json index 7ce95b15..bde0ebf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "description": "A