Support for HLS maximum bit rate adaptive streaming
This commit is contained in:
@@ -51,6 +51,8 @@ static int const RCTVideoUnset = -1;
|
||||
/* Keep track of any modifiers, need to be applied after each play */
|
||||
float _volume;
|
||||
float _rate;
|
||||
float _maximumBitRate;
|
||||
|
||||
BOOL _muted;
|
||||
BOOL _paused;
|
||||
BOOL _repeat;
|
||||
@@ -338,6 +340,8 @@ static int const RCTVideoUnset = -1;
|
||||
[self addPlayerItemObservers];
|
||||
[self setFilter:_filterName];
|
||||
|
||||
_playerItem.preferredPeakBitRate = _maximumBitRate;
|
||||
|
||||
[_player pause];
|
||||
[_playerViewController.view removeFromSuperview];
|
||||
_playerViewController = nil;
|
||||
@@ -378,6 +382,11 @@ static int const RCTVideoUnset = -1;
|
||||
_videoLoadStarted = YES;
|
||||
}
|
||||
|
||||
- (void)setMaximumBitRate:(float) maximumBitRate {
|
||||
_maximumBitRate = maximumBitRate;
|
||||
[self applyModifiers];
|
||||
}
|
||||
|
||||
- (NSURL*) urlFilePath:(NSString*) filepath {
|
||||
if ([filepath containsString:@"file://"]) {
|
||||
return [NSURL URLWithString:filepath];
|
||||
|
@@ -19,6 +19,7 @@ RCT_EXPORT_MODULE();
|
||||
}
|
||||
|
||||
RCT_EXPORT_VIEW_PROPERTY(src, NSDictionary);
|
||||
RCT_EXPORT_VIEW_PROPERTY(maximumBitRate, float);
|
||||
RCT_EXPORT_VIEW_PROPERTY(resizeMode, NSString);
|
||||
RCT_EXPORT_VIEW_PROPERTY(repeat, BOOL);
|
||||
RCT_EXPORT_VIEW_PROPERTY(allowsExternalPlayback, BOOL);
|
||||
|
Reference in New Issue
Block a user