Add allowsExternalPlayback property to control external playback
This commit is contained in:
parent
5203d1b238
commit
e79e447375
@ -40,6 +40,7 @@ static NSString *const timedMetadata = @"timedMetadata";
|
|||||||
BOOL _muted;
|
BOOL _muted;
|
||||||
BOOL _paused;
|
BOOL _paused;
|
||||||
BOOL _repeat;
|
BOOL _repeat;
|
||||||
|
BOOL _allowsExternalPlayback;
|
||||||
BOOL _playbackStalled;
|
BOOL _playbackStalled;
|
||||||
BOOL _playInBackground;
|
BOOL _playInBackground;
|
||||||
BOOL _playWhenInactive;
|
BOOL _playWhenInactive;
|
||||||
@ -66,6 +67,7 @@ static NSString *const timedMetadata = @"timedMetadata";
|
|||||||
_controls = NO;
|
_controls = NO;
|
||||||
_playerBufferEmpty = YES;
|
_playerBufferEmpty = YES;
|
||||||
_playInBackground = false;
|
_playInBackground = false;
|
||||||
|
_allowsExternalPlayback = YES;
|
||||||
_playWhenInactive = false;
|
_playWhenInactive = false;
|
||||||
_ignoreSilentSwitch = @"inherit"; // inherit, ignore, obey
|
_ignoreSilentSwitch = @"inherit"; // inherit, ignore, obey
|
||||||
|
|
||||||
@ -522,6 +524,12 @@ static NSString *const timedMetadata = @"timedMetadata";
|
|||||||
_playInBackground = playInBackground;
|
_playInBackground = playInBackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setAllowsExternalPlayback:(BOOL)allowsExternalPlayback
|
||||||
|
{
|
||||||
|
_allowsExternalPlayback = allowsExternalPlayback;
|
||||||
|
_player.allowsExternalPlayback = _allowsExternalPlayback;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setPlayWhenInactive:(BOOL)playWhenInactive
|
- (void)setPlayWhenInactive:(BOOL)playWhenInactive
|
||||||
{
|
{
|
||||||
_playWhenInactive = playWhenInactive;
|
_playWhenInactive = playWhenInactive;
|
||||||
@ -633,6 +641,7 @@ static NSString *const timedMetadata = @"timedMetadata";
|
|||||||
[self setRepeat:_repeat];
|
[self setRepeat:_repeat];
|
||||||
[self setPaused:_paused];
|
[self setPaused:_paused];
|
||||||
[self setControls:_controls];
|
[self setControls:_controls];
|
||||||
|
[self setAllowsExternalPlayback:_allowsExternalPlayback];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setRepeat:(BOOL)repeat {
|
- (void)setRepeat:(BOOL)repeat {
|
||||||
|
@ -22,6 +22,7 @@ RCT_EXPORT_MODULE();
|
|||||||
RCT_EXPORT_VIEW_PROPERTY(src, NSDictionary);
|
RCT_EXPORT_VIEW_PROPERTY(src, NSDictionary);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
|
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
|
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
|
||||||
|
RCT_EXPORT_VIEW_PROPERTY(allowsExternalPlayback, BOOL);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(paused, BOOL);
|
RCT_EXPORT_VIEW_PROPERTY(paused, BOOL);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(muted, BOOL);
|
RCT_EXPORT_VIEW_PROPERTY(muted, BOOL);
|
||||||
RCT_EXPORT_VIEW_PROPERTY(controls, BOOL);
|
RCT_EXPORT_VIEW_PROPERTY(controls, BOOL);
|
||||||
|
Loading…
Reference in New Issue
Block a user