TPLPlayerDelegate
@protocol TPLPlayerDelegate <NSObject>
This delegate receives state changes and events relevant to playback on TPLPlayer. All are invoked on the main queue.
-
State of the player changed.
See
TPLPlayer.state, which supports Key-Value Observation as an alternative to this delegate method.Declaration
Objective-C
- (void)player:(nonnull TPLPlayer *)player didChangePlayerState:(TPLPlayerState)state;Parameters
playerThe player instance that changed state.
stateThe new player state.
-
The playback quality changed. This may be due to user action or an internal adaptive-quality switch.
See
TPLPlayer.quality, which supports Key-Value Observation as an alternative to this delegate method.Declaration
Objective-C
- (void)player:(nonnull TPLPlayer *)player didChangeQuality:(nullable TPLPlayerQuality *)quality;Parameters
playerThe player instance that switched quality.
qualityThe new quality.
-
The player encountered a fatal error.
Declaration
Objective-C
- (void)player:(nonnull TPLPlayer *)player didFailWithError:(nonnull NSError *)error;Parameters
playerThe player instance that encountered an error.
errorThe error. See TPLErrors.h for expected userInfo keys.
-
The player encountered a timed metadata.
Declaration
Objective-C
- (void)player:(nonnull TPLPlayer *)player didReceiveTimedMetadata:(nonnull TPLTimedMetadata *)metadata;Parameters
playerThe player instance managing the stream.
metadataAn object with timing information and other details varying by type.
-
The player exhausted its internal buffers while playing. This is not invoked for user actions such as seeking or starting/resuming playback.
Declaration
Objective-C
- (void)playerWillRebuffer:(nonnull TPLPlayer *)player;Parameters
playerThe player instance that will rebuffer.
-
The native video size for the media changed.
See
TPLPlayer.videoSize, which supports Key-Value Observation as an alternative to this delegate method.Declaration
Objective-C
- (void)player:(nonnull TPLPlayer *)player videoSizeChanged:(CGSize)videoSize;Parameters
playerThe player instance managing the media that changed.
videoSizeThe new size in pixels.
-
The network lost while playing a stream. If the network outage is detected while playing a stream, SDK will pause the stream and invoke this callback. The SDK will resume the playback if the network becomes available before timeout.
Declaration
Objective-C
- (void)playerNetworkDidBecomeUnavailable:(nonnull TPLPlayer *)player;Parameters
playerThe player instance affected by the network outage.
View on GitHub
TPLPlayerDelegate Protocol Reference