Merge pull request #1267 from react-native-community/chore/external-playback-cleanup
Minor cleanups to onExternalPlaybackChange
This commit is contained in:
		
							
								
								
									
										3
									
								
								Video.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								Video.js
									
									
									
									
									
								
							@@ -242,6 +242,7 @@ export default class Video extends Component {
 | 
				
			|||||||
      onVideoBuffer: this._onBuffer,
 | 
					      onVideoBuffer: this._onBuffer,
 | 
				
			||||||
      onTimedMetadata: this._onTimedMetadata,
 | 
					      onTimedMetadata: this._onTimedMetadata,
 | 
				
			||||||
      onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy,
 | 
					      onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy,
 | 
				
			||||||
 | 
					      onVideoExternalPlaybackChange: this._onExternalPlaybackChange,
 | 
				
			||||||
      onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent,
 | 
					      onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent,
 | 
				
			||||||
      onVideoFullscreenPlayerDidPresent: this._onFullscreenPlayerDidPresent,
 | 
					      onVideoFullscreenPlayerDidPresent: this._onFullscreenPlayerDidPresent,
 | 
				
			||||||
      onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss,
 | 
					      onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss,
 | 
				
			||||||
@@ -252,7 +253,6 @@ export default class Video extends Component {
 | 
				
			|||||||
      onPlaybackRateChange: this._onPlaybackRateChange,
 | 
					      onPlaybackRateChange: this._onPlaybackRateChange,
 | 
				
			||||||
      onAudioFocusChanged: this._onAudioFocusChanged,
 | 
					      onAudioFocusChanged: this._onAudioFocusChanged,
 | 
				
			||||||
      onAudioBecomingNoisy: this._onAudioBecomingNoisy,
 | 
					      onAudioBecomingNoisy: this._onAudioBecomingNoisy,
 | 
				
			||||||
      onExternalPlaybackChange: this._onExternalPlaybackChange,
 | 
					 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const posterStyle = {
 | 
					    const posterStyle = {
 | 
				
			||||||
@@ -291,6 +291,7 @@ Video.propTypes = {
 | 
				
			|||||||
  onVideoEnd: PropTypes.func,
 | 
					  onVideoEnd: PropTypes.func,
 | 
				
			||||||
  onTimedMetadata: PropTypes.func,
 | 
					  onTimedMetadata: PropTypes.func,
 | 
				
			||||||
  onVideoAudioBecomingNoisy: PropTypes.func,
 | 
					  onVideoAudioBecomingNoisy: PropTypes.func,
 | 
				
			||||||
 | 
					  onVideoExternalPlaybackChange: PropTypes.func,
 | 
				
			||||||
  onVideoFullscreenPlayerWillPresent: PropTypes.func,
 | 
					  onVideoFullscreenPlayerWillPresent: PropTypes.func,
 | 
				
			||||||
  onVideoFullscreenPlayerDidPresent: PropTypes.func,
 | 
					  onVideoFullscreenPlayerDidPresent: PropTypes.func,
 | 
				
			||||||
  onVideoFullscreenPlayerWillDismiss: PropTypes.func,
 | 
					  onVideoFullscreenPlayerWillDismiss: PropTypes.func,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@
 | 
				
			|||||||
@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackStalled;
 | 
					@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackStalled;
 | 
				
			||||||
@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackResume;
 | 
					@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackResume;
 | 
				
			||||||
@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackRateChange;
 | 
					@property (nonatomic, copy) RCTBubblingEventBlock onPlaybackRateChange;
 | 
				
			||||||
@property (nonatomic, copy) RCTBubblingEventBlock onExternalPlaybackChange;
 | 
					@property (nonatomic, copy) RCTBubblingEventBlock onVideoExternalPlaybackChange;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;
 | 
					- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -657,8 +657,8 @@ static int const RCTVideoUnset = -1;
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else if([keyPath isEqualToString:externalPlaybackActive]) {
 | 
					    else if([keyPath isEqualToString:externalPlaybackActive]) {
 | 
				
			||||||
        if(self.onExternalPlaybackChange) {
 | 
					        if(self.onVideoExternalPlaybackChange) {
 | 
				
			||||||
          self.onExternalPlaybackChange(@{@"isExternalPlaybackActive": [NSNumber numberWithBool:_player.isExternalPlaybackActive],
 | 
					          self.onVideoExternalPlaybackChange(@{@"isExternalPlaybackActive": [NSNumber numberWithBool:_player.isExternalPlaybackActive],
 | 
				
			||||||
                                          @"target": self.reactTag});
 | 
					                                          @"target": self.reactTag});
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,7 +56,7 @@ RCT_EXPORT_VIEW_PROPERTY(onReadyForDisplay, RCTBubblingEventBlock);
 | 
				
			|||||||
RCT_EXPORT_VIEW_PROPERTY(onPlaybackStalled, RCTBubblingEventBlock);
 | 
					RCT_EXPORT_VIEW_PROPERTY(onPlaybackStalled, RCTBubblingEventBlock);
 | 
				
			||||||
RCT_EXPORT_VIEW_PROPERTY(onPlaybackResume, RCTBubblingEventBlock);
 | 
					RCT_EXPORT_VIEW_PROPERTY(onPlaybackResume, RCTBubblingEventBlock);
 | 
				
			||||||
RCT_EXPORT_VIEW_PROPERTY(onPlaybackRateChange, RCTBubblingEventBlock);
 | 
					RCT_EXPORT_VIEW_PROPERTY(onPlaybackRateChange, RCTBubblingEventBlock);
 | 
				
			||||||
RCT_EXPORT_VIEW_PROPERTY(onExternalPlaybackChange, RCTBubblingEventBlock);
 | 
					RCT_EXPORT_VIEW_PROPERTY(onVideoExternalPlaybackChange, RCTBubblingEventBlock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- (NSDictionary *)constantsToExport
 | 
					- (NSDictionary *)constantsToExport
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user