ASVideoPlayerNodeDelegate Protocol Reference

Conforms to NSObject
Declared in ASVideoPlayerNode.h

– videoPlayerNodeNeededDefaultControls:

Delegate method invoked before creating controlbar controls @param videoPlayer

- (NSArray *)videoPlayerNodeNeededDefaultControls:(ASVideoPlayerNode *)videoPlayer

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeCustomControls:

Delegate method invoked before creating default controls, asks delegate for custom controls dictionary. This dictionary must constain only ASDisplayNode subclass objects. @param videoPlayer

- (NSDictionary *)videoPlayerNodeCustomControls:(ASVideoPlayerNode *)videoPlayer

Discussion

  • This method is invoked only when developer implements videoPlayerNodeLayoutSpec:forControls:forMaximumSize: and gives ability to add custom constrols to ASVideoPlayerNode, for example mute button.

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeLayoutSpec:forControls:forMaximumSize:

Delegate method invoked in layoutSpecThatFits: @param videoPlayer

- (ASLayoutSpec *)videoPlayerNodeLayoutSpec:(ASVideoPlayerNode *)videoPlayer forControls:(NSDictionary *)controls forMaximumSize:(CGSize)maxSize

Parameters

controls
  • Dictionary of controls which are used in videoPlayer; Dictionary keys are ASVideoPlayerNodeControlType
maxSize
  • Maximum size for ASVideoPlayerNode

Discussion

  • Developer can layout whole ASVideoPlayerNode as he wants. ASVideoNode is locked and it can’t be changed

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeTimeLabelAttributes:timeLabelType:

Delegate method invoked before creating ASVideoPlayerNodeControlTypeElapsedText and ASVideoPlayerNodeControlTypeDurationText @param videoPlayer @param timeLabelType

- (NSDictionary *)videoPlayerNodeTimeLabelAttributes:(ASVideoPlayerNode *)videoPlayerNode timeLabelType:(ASVideoPlayerNodeControlType)timeLabelType

Declared In

ASVideoPlayerNode.h

– didTapVideoPlayerNode:

Delegate method invoked when ASVideoPlayerNode is taped.

- (void)didTapVideoPlayerNode:(ASVideoPlayerNode *)videoPlayer

Parameters

videoPlayerNode

The ASVideoPlayerNode that was tapped.

Declared In

ASVideoPlayerNode.h

– videoPlayerNode:didPlayToTime:

Delegate method invoked when ASVideoNode playback time is updated.

- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didPlayToTime:(CMTime)time

Parameters

second

current playback time.

videoPlayerNode

The video player node

Declared In

ASVideoPlayerNode.h

– videoPlayerNode:willChangeVideoNodeState:toVideoNodeState:

Delegate method invoked when ASVideoNode changes state.

- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer willChangeVideoNodeState:(ASVideoNodePlayerState)state toVideoNodeState:(ASVideoNodePlayerState)toState

Parameters

state

ASVideoNode state before this change.

videoPlayerNode

The ASVideoPlayerNode whose ASVideoNode is changing state.

toSate

ASVideoNode new state.

Discussion

This method is called after each state change

Declared In

ASVideoPlayerNode.h

– videoPlayerNode:shouldChangeVideoNodeStateTo:

Delegate method is invoked when ASVideoNode decides to change state.

- (BOOL)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer shouldChangeVideoNodeStateTo:(ASVideoNodePlayerState)state

Parameters

state

ASVideoNode that is going to be set.

videoPlayerNode

The ASVideoPlayerNode whose ASVideoNode is changing state.

Discussion

Delegate method invoked when player changes it’s state to ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused and asks delegate if state change is valid

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeDidPlayToEnd:

Delegate method invoked when the ASVideoNode has played to its end time.

- (void)videoPlayerNodeDidPlayToEnd:(ASVideoPlayerNode *)videoPlayer

Parameters

videoPlayer

The video node has played to its end time.

Declared In

ASVideoPlayerNode.h

– videoPlayerNode:didSetCurrentItem:

Delegate method invoked when the ASVideoNode has constructed its AVPlayerItem for the asset.

- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didSetCurrentItem:(AVPlayerItem *)currentItem

Parameters

videoPlayer

The video player node.

currentItem

The AVPlayerItem that was constructed from the asset.

Declared In

ASVideoPlayerNode.h

– videoPlayerNode:didStallAtTimeInterval:

Delegate method invoked when the ASVideoNode stalls.

- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didStallAtTimeInterval:(NSTimeInterval)timeInterval

Parameters

videoPlayer

The video player node that has experienced the stall

second

Current playback time when the stall happens

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeDidStartInitialLoading:

Delegate method invoked when the ASVideoNode starts the inital asset loading

- (void)videoPlayerNodeDidStartInitialLoading:(ASVideoPlayerNode *)videoPlayer

Parameters

videoPlayer

The videoPlayer

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeDidFinishInitialLoading:

Delegate method invoked when the ASVideoNode is done loading the asset and can start the playback

- (void)videoPlayerNodeDidFinishInitialLoading:(ASVideoPlayerNode *)videoPlayer

Parameters

videoPlayer

The videoPlayer

Declared In

ASVideoPlayerNode.h

– videoPlayerNodeDidRecoverFromStall:

Delegate method invoked when the ASVideoNode has recovered from the stall

- (void)videoPlayerNodeDidRecoverFromStall:(ASVideoPlayerNode *)videoPlayer

Parameters

videoPlayer

The videoplayer

Declared In

ASVideoPlayerNode.h