# [ima](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima).Player

class static

## Constructor

### Player

new
Player()

## Methods

### adBreakEnded

adBreakEnded(adBreakInfo)

Optional. Called when an ad break had ended.

| #### Parameter ||
|---|---|
| adBreakInfo | [ima.AdBreakInfo](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.AdBreakInfo) Contains information about the ad break. |

### adBreakStarted

adBreakStarted(adBreakInfo)

Optional. Called when an ad break has started.

| #### Parameter ||
|---|---|
| adBreakInfo | [ima.AdBreakInfo](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.AdBreakInfo) Contains information about the ad break. |

### allVideoComplete

allVideoComplete()

Optional. Called when all video is complete.

### loadUrl

loadUrl(streamInfo)

Called when the player should begin playing a url. You must implement
this method to load the stream.

| #### Parameter ||
|---|---|
| streamInfo | [ima.StreamInfo](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.StreamInfo) Contains information needed to play content. |

### streamInitialized

streamInitialized(streamInfo)

Called when a stream has been initialized.

| #### Parameter ||
|---|---|
| streamInfo | [ima.StreamInfo](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.StreamInfo) Contains information needed to play content. |

### createPlayer

static

createPlayer() returns [ima.Player](https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.Player)

Creates an empty IMA `Player` object. You must implement the
`loadUrl` function to play ads. Other functions are optional.

Returns

:   `https://developers.google.com/ad-manager/dynamic-ad-insertion/sdk/roku/reference/ima.Player`