Merge branch 'master' of https://github.com/nfb-onf/react-native-video
# Conflicts: # ios/RCTVideoPlayerViewController.m # ios/Video/RCTVideo.m
This commit is contained in:
commit
0580f2710f
8
Video.js
8
Video.js
@ -151,12 +151,6 @@ export default class Video extends Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_onCaptionsDeviceSetting = (event) => {
|
|
||||||
if (this.props.onCaptionsDeviceSetting) {
|
|
||||||
this.props.onCaptionsDeviceSetting(event.nativeEvent);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
_onPlaybackStalled = (event) => {
|
_onPlaybackStalled = (event) => {
|
||||||
if (this.props.onPlaybackStalled) {
|
if (this.props.onPlaybackStalled) {
|
||||||
this.props.onPlaybackStalled(event.nativeEvent);
|
this.props.onPlaybackStalled(event.nativeEvent);
|
||||||
@ -247,7 +241,6 @@ export default class Video extends Component {
|
|||||||
onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss,
|
onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss,
|
||||||
onVideoFullscreenPlayerDidDismiss: this._onFullscreenPlayerDidDismiss,
|
onVideoFullscreenPlayerDidDismiss: this._onFullscreenPlayerDidDismiss,
|
||||||
onReadyForDisplay: this._onReadyForDisplay,
|
onReadyForDisplay: this._onReadyForDisplay,
|
||||||
onCaptionsDeviceSetting: this._onCaptionsDeviceSetting,
|
|
||||||
onPlaybackStalled: this._onPlaybackStalled,
|
onPlaybackStalled: this._onPlaybackStalled,
|
||||||
onPlaybackResume: this._onPlaybackResume,
|
onPlaybackResume: this._onPlaybackResume,
|
||||||
onPlaybackRateChange: this._onPlaybackRateChange,
|
onPlaybackRateChange: this._onPlaybackRateChange,
|
||||||
@ -386,7 +379,6 @@ Video.propTypes = {
|
|||||||
onFullscreenPlayerWillDismiss: PropTypes.func,
|
onFullscreenPlayerWillDismiss: PropTypes.func,
|
||||||
onFullscreenPlayerDidDismiss: PropTypes.func,
|
onFullscreenPlayerDidDismiss: PropTypes.func,
|
||||||
onReadyForDisplay: PropTypes.func,
|
onReadyForDisplay: PropTypes.func,
|
||||||
onCaptionsDeviceSetting: PropTypes.func,
|
|
||||||
onPlaybackStalled: PropTypes.func,
|
onPlaybackStalled: PropTypes.func,
|
||||||
onPlaybackResume: PropTypes.func,
|
onPlaybackResume: PropTypes.func,
|
||||||
onPlaybackRateChange: PropTypes.func,
|
onPlaybackRateChange: PropTypes.func,
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
@property (nonatomic, copy) RCTBubblingEventBlock onVideoFullscreenPlayerWillDismiss;
|
@property (nonatomic, copy) RCTBubblingEventBlock onVideoFullscreenPlayerWillDismiss;
|
||||||
@property (nonatomic, copy) RCTBubblingEventBlock onVideoFullscreenPlayerDidDismiss;
|
@property (nonatomic, copy) RCTBubblingEventBlock onVideoFullscreenPlayerDidDismiss;
|
||||||
@property (nonatomic, copy) RCTBubblingEventBlock onReadyForDisplay;
|
@property (nonatomic, copy) RCTBubblingEventBlock onReadyForDisplay;
|
||||||
@property (nonatomic, copy) RCTBubblingEventBlock onCaptionsDeviceSetting;
|
|
||||||
@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;
|
||||||
|
@ -68,7 +68,6 @@ static int const RCTVideoUnset = -1;
|
|||||||
#if __has_include(<react-native-video/RCTVideoCache.h>)
|
#if __has_include(<react-native-video/RCTVideoCache.h>)
|
||||||
RCTVideoCache * _videoCache;
|
RCTVideoCache * _videoCache;
|
||||||
#endif
|
#endif
|
||||||
BOOL _deviceCaptionsEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
|
- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher
|
||||||
@ -365,12 +364,6 @@ static int const RCTVideoUnset = -1;
|
|||||||
@"target": self.reactTag
|
@"target": self.reactTag
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.onCaptionsDeviceSetting) {
|
|
||||||
self.onCaptionsDeviceSetting(@{@"deviceCaptionsEnabled": [NSNumber numberWithBool:_deviceCaptionsEnabled],
|
|
||||||
@"target": self.reactTag
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}];
|
}];
|
||||||
});
|
});
|
||||||
_videoLoadStarted = YES;
|
_videoLoadStarted = YES;
|
||||||
@ -973,7 +966,9 @@ static int const RCTVideoUnset = -1;
|
|||||||
|
|
||||||
// in the situation that a selected text track is not available (eg. specifies a textTrack not available)
|
// in the situation that a selected text track is not available (eg. specifies a textTrack not available)
|
||||||
if (![type isEqualToString:@"disabled"] && selectedTrackIndex == RCTVideoUnset) {
|
if (![type isEqualToString:@"disabled"] && selectedTrackIndex == RCTVideoUnset) {
|
||||||
if (_deviceCaptionsEnabled) {
|
CFArrayRef captioningMediaCharacteristics = MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics(kMACaptionAppearanceDomainUser);
|
||||||
|
NSArray *captionSettings = (__bridge NSArray*)captioningMediaCharacteristics;
|
||||||
|
if ([captionSettings containsObject:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility]) {
|
||||||
selectedTrackIndex = 0; // If we can't find a match, use the first available track
|
selectedTrackIndex = 0; // If we can't find a match, use the first available track
|
||||||
NSString *systemLanguage = [[NSLocale preferredLanguages] firstObject];
|
NSString *systemLanguage = [[NSLocale preferredLanguages] firstObject];
|
||||||
for (int i = 0; i < textTracks.count; ++i) {
|
for (int i = 0; i < textTracks.count; ++i) {
|
||||||
|
@ -54,7 +54,6 @@ RCT_EXPORT_VIEW_PROPERTY(onVideoFullscreenPlayerDidPresent, RCTBubblingEventBloc
|
|||||||
RCT_EXPORT_VIEW_PROPERTY(onVideoFullscreenPlayerWillDismiss, RCTBubblingEventBlock);
|
RCT_EXPORT_VIEW_PROPERTY(onVideoFullscreenPlayerWillDismiss, RCTBubblingEventBlock);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(onVideoFullscreenPlayerDidDismiss, RCTBubblingEventBlock);
|
RCT_EXPORT_VIEW_PROPERTY(onVideoFullscreenPlayerDidDismiss, RCTBubblingEventBlock);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(onReadyForDisplay, RCTBubblingEventBlock);
|
RCT_EXPORT_VIEW_PROPERTY(onReadyForDisplay, RCTBubblingEventBlock);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(onCaptionsDeviceSetting, 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);
|
||||||
|
Loading…
Reference in New Issue
Block a user