# TritonPlayerDelegate Protocol Reference

Conforms to | NSObject
Declared in | TritonPlayer.h

## Overview

TritonPlayerDelegate defines methods you can implement to handle streaming state notifications and to receive cue point events.

## Handling state changes

### `– player:didChangeState:` required method

Called when the player’s state changed.

`- (void)player:(TritonPlayer *)player didChangeState:(TDPlayerState)state`

#### Parameters

`player` | The player whose state changed
`state` | The new state of the player

#### Declared In

`TritonPlayer.h`

## Receiving player info

### `– player:didReceiveInfo:andExtra:`

Called when the player’s state changed.

`- (void)player:(TritonPlayer *)player didReceiveInfo:(TDPlayerInfo)info andExtra:(NSDictionary *)extra`

#### Parameters

`player` | The player whose state changed
`state` | The new state of the player

#### Declared In

`TritonPlayer.h`

## Handling cue point events

### `– player:didReceiveCuePointEvent:`

Called when there’s a Cue Point available to be processed. A NSDictionary is passed containing the Cue Point metadata. All the available keys are defined in CuePointEvent.h. See STWCue_Metadata_Dictionary.pdf for more details on the available cue point information.

`- (void)player:(TritonPlayer *)player didReceiveCuePointEvent:(CuePointEvent *)cuePointEvent`

#### Parameters

`player` | The player which is receiving cue point events
`cuePointEvent` | A CuePointEvent object containing all cue point information.

#### Declared In

`TritonPlayer.h`

## Handling interruptions

### `– playerBeginInterruption:`

Notifies that an audio interruption is about to start (alarm, phone call, etc.). The application has the opportunity to take the proper actions: stop the player, lower the volume, etc.

`- (void)playerBeginInterruption:(TritonPlayer *)player`

#### Parameters

`player` | The TritonPlayer object which is being interrupted.

#### Declared In

`TritonPlayer.h`

### `– playerEndInterruption:`

Notifies about a finished interruption. It’s the proper moment to resume the player, raise the volume, etc.

`- (void)playerEndInterruption:(TritonPlayer *)player`

#### Parameters

`player` | The TritonPlayer object whose interruption is ending.

#### Declared In

`TritonPlayer.h`