-
Notifications
You must be signed in to change notification settings - Fork 14
PlayerLowLatencyExtension
Li Lin edited this page Jul 5, 2019
·
5 revisions
StraaS PlayerLowLatencyExtension SDK is an extension for StraaS player library for the purpose of viewing low latency Real-Time streaming live
.
Requires Swift 4.0/Xcode 9.3 or later.
If you need Swift 3.x/Xcode 9.2(or earlier) use the v0.13.0.
Add following lines to your Podfile:
pod 'StraaS-iOS-SDK/PlayerLowLatencyExtension'
Then run pod install
in the command line.
(You might need to do pod repo update
before pod install
.)
Note: Before using the SDK, you should read StraaS Player SDK first.
You should read StraaS Player SDK first for the basic knowledge of playing a stream.
You could call the method loadLiveWithId: lowLatency:
in STSSDKPlayerView
to play a low latency live with setting lowLatency
to true and prepare your own STSLowLatencyPlayer
manually in advance. For example:
- (IBAction)loadLive:(id)sender {
STSSDKPlayerView * playerView = [STSSDKPlayerView new];
playerView.liveEventDelegate = self;
playerView.delegate = self;
[playerView setupLowLatencyPlayerIfNecessary:lowLatency];
[playerView loadLiveWithId:@"<#the_Live_id_you_want_to_play#>" lowLatency:lowLatency];
}
- (void)setupLowLatencyPlayerIfNecessary:(BOOL)isLowLatency {
if (isLowLatency && !self.playerView.lowLatencyPlayer) {
STSLowLatencyPlayer * lowLatencyPlayer = [STSLowLatencyPlayer new];
self.playerView.lowLatencyPlayer = (id<STSPlayerPlayback>)lowLatencyPlayer;
}
}