APSMediaEventProtocol
Objective-C
@protocol APSMediaEventProtocol <NSObject>
Swift
protocol APSMediaEventProtocol : NSObjectProtocol
The APSMediaEventProtocol
protocol describes methods that objects extending the associated APSMediaEvent
class must or can implement.
-
This code will be executed once the event is triggered by the player.
Declaration
Objective-C
- (void)onTrigger;
Swift
func onTrigger()
-
This method will be invoked on a different thread by the player, before the event start point, as set by the [APSMediaEvent preTriggerInterval] property.
Declaration
Objective-C
- (void)onPreload;
Swift
optional func onPreload()
-
This method will be invoked by the player periodically, giving the event the opportunity to respond to updated playback information.
Declaration
Objective-C
- (void)onUpdate;
Swift
optional func onUpdate()
-
This method will be invoked by the player once the event has reached the end point and will be deallocated.
Declaration
Objective-C
- (void)onUnload;
Swift
optional func onUnload()
-
This method allow setting event’s state without triggering KVO observers To be used inside - observeValueForKeyPath:ofObject:change:context:
Declaration
Objective-C
- (void)setStateWithoutTriggeringKVO:(APSMediaEventState)state;
Swift
optional func setStateWithoutTriggeringKVO(_ state: APSMediaEventState)