diff --git a/Video.js b/Video.js index 76f27dc3..4529dd44 100644 --- a/Video.js +++ b/Video.js @@ -242,6 +242,7 @@ export default class Video extends Component { onVideoBuffer: this._onBuffer, onTimedMetadata: this._onTimedMetadata, onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy, + onVideoExternalPlaybackChange: this._onExternalPlaybackChange, onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent, onVideoFullscreenPlayerDidPresent: this._onFullscreenPlayerDidPresent, onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss, @@ -252,7 +253,6 @@ export default class Video extends Component { onPlaybackRateChange: this._onPlaybackRateChange, onAudioFocusChanged: this._onAudioFocusChanged, onAudioBecomingNoisy: this._onAudioBecomingNoisy, - onExternalPlaybackChange: this._onExternalPlaybackChange, }); const posterStyle = { @@ -291,6 +291,7 @@ Video.propTypes = { onVideoEnd: PropTypes.func, onTimedMetadata: PropTypes.func, onVideoAudioBecomingNoisy: PropTypes.func, + onVideoExternalPlaybackChange: PropTypes.func, onVideoFullscreenPlayerWillPresent: PropTypes.func, onVideoFullscreenPlayerDidPresent: PropTypes.func, onVideoFullscreenPlayerWillDismiss: PropTypes.func, diff --git a/ios/Video/RCTVideo.h b/ios/Video/RCTVideo.h index 472cb2ff..f857c841 100644 --- a/ios/Video/RCTVideo.h +++ b/ios/Video/RCTVideo.h @@ -35,7 +35,7 @@ @property (nonatomic, copy) RCTBubblingEventBlock onPlaybackStalled; @property (nonatomic, copy) RCTBubblingEventBlock onPlaybackResume; @property (nonatomic, copy) RCTBubblingEventBlock onPlaybackRateChange; -@property (nonatomic, copy) RCTBubblingEventBlock onExternalPlaybackChange; +@property (nonatomic, copy) RCTBubblingEventBlock onVideoExternalPlaybackChange; - (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index 45389799..4ef75d63 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -657,8 +657,8 @@ static int const RCTVideoUnset = -1; } } else if([keyPath isEqualToString:externalPlaybackActive]) { - if(self.onExternalPlaybackChange) { - self.onExternalPlaybackChange(@{@"isExternalPlaybackActive": [NSNumber numberWithBool:_player.isExternalPlaybackActive], + if(self.onVideoExternalPlaybackChange) { + self.onVideoExternalPlaybackChange(@{@"isExternalPlaybackActive": [NSNumber numberWithBool:_player.isExternalPlaybackActive], @"target": self.reactTag}); } } diff --git a/ios/Video/RCTVideoManager.m b/ios/Video/RCTVideoManager.m index 190a1663..a11038fc 100644 --- a/ios/Video/RCTVideoManager.m +++ b/ios/Video/RCTVideoManager.m @@ -56,7 +56,7 @@ RCT_EXPORT_VIEW_PROPERTY(onReadyForDisplay, RCTBubblingEventBlock); RCT_EXPORT_VIEW_PROPERTY(onPlaybackStalled, RCTBubblingEventBlock); RCT_EXPORT_VIEW_PROPERTY(onPlaybackResume, RCTBubblingEventBlock); RCT_EXPORT_VIEW_PROPERTY(onPlaybackRateChange, RCTBubblingEventBlock); -RCT_EXPORT_VIEW_PROPERTY(onExternalPlaybackChange, RCTBubblingEventBlock); +RCT_EXPORT_VIEW_PROPERTY(onVideoExternalPlaybackChange, RCTBubblingEventBlock); - (NSDictionary *)constantsToExport {