STSPlayerLiveEventDelegate
@protocol STSPlayerLiveEventDelegate <NSObject>
Implements the STSPlayerLiveEventDelegate protocol to respond to live event.
-
Called when the player view starts loading a live.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView startLoadingLive:(nonnull NSString *)liveId;
Swift
func playerView(_ playerView: STSSDKPlayerView!, startLoadingLive liveId: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the loading video.
-
Called when a live has loaded.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView didLoadLive:(nonnull NSString *)liveId;
Swift
func playerView(_ playerView: STSSDKPlayerView!, didLoadLive liveId: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the loaded live.
-
Called when the broadcast state of the live changed.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView live:(nonnull NSString *)liveId broadcastStateChanged:(STSLiveBroadcastState)broadcastState;
Swift
func playerView(_ playerView: STSSDKPlayerView!, live liveId: Any!, broadcastStateChanged broadcastState: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the live whose broadcast state changed.
broadcastState
The new broadcast state of the live.
-
Called when CCU of the live changed.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView liveCCUChanged:(nonnull NSString *)liveId value:(nonnull NSNumber *)ccu;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, liveCCUChanged liveId: Any!, value ccu: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The live event id who’s CCU changed.
ccu
Current CCU of the live event;
-
Called when hit count of the live changed.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView liveHitCountChanged:(nonnull NSString *)liveId value:(nonnull NSNumber *)hitCount;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, liveHitCountChanged liveId: Any!, value hitCount: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The live event id who’s hit count changed.
hitCount
Current hit count of the live event;
-
Called when the broadcast start time of the live stream changed. The time may change when the stream starts or stops.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView broadcastStartTimeChanged:(nonnull NSString *)liveId value:(NSNumber *_Nullable)broadcastStartTimeInMS;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, broadcastStartTimeChanged liveId: Any!, value broadcastStartTimeInMS: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The live event id who’s broadcast start time changed.
broadcastStartTimeInMS
The broadcast start time in millisecond.
nil
if the stream is stopped. -
Called when the live stream playback mode changed.
This method will only be called when the player view is playing a live.
Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView liveId:(nonnull NSString *)liveId playbackModeChanged:(BOOL)isInDvrMode;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, liveId: Any!, playbackModeChanged isInDvrMode: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the live event that its playback mode changed.
isInDvrMode
A boolean value indicates whether the live stream is in live DVR mod
-
Called when the stream of a live event starts. This method has been deprecated. Use
playerView:live:broadcastStateChanged:
instead.Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView streamDidStart:(nonnull NSString *)liveId;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, streamDidStart liveId: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the started live stream.
-
Called when the stream of a live event stops. This method has been deprecated. Use
playerView:live:broadcastStateChanged:
instead.Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView streamDidStop:(nonnull NSString *)liveId;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, streamDidStop liveId: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the stopped live stream.
-
Called when a live is waiting for stream. This method has been deprecated. Use
playerView:live:broadcastStateChanged:
instead.Declaration
Objective-C
- (void)playerView:(nonnull STSSDKPlayerView *)playerView waitingForStream:(nonnull NSString *)liveId;
Swift
optional func playerView(_ playerView: STSSDKPlayerView!, waitingForStream liveId: Any!)
Parameters
playerView
The player view that sent the message.
liveId
The StraaS live id of the live event that is waiting for stream.