public final class MediaEvents
extends java.lang.Object
Created by Natasha Garner on 10/09/2017.
Modifier and Type | Method and Description |
---|---|
void |
adUserInteraction(InteractionType interactionType)
Notify all media listeners that the user has performed an ad interaction.
|
void |
bufferFinish()
Notify all media listeners that buffering has finished and media playback has resumed.
|
void |
bufferStart()
Notify all media listeners that media playback has stopped and started buffering.
|
void |
complete()
Notify all media listeners that media playback is complete.
|
static MediaEvents |
createMediaEvents(AdSession adSession)
Create media events instance for the associated ad session.
|
void |
firstQuartile()
Notify all media listeners that media playback has reached the first quartile.
|
void |
midpoint()
Notify all media listeners that media playback has reached the midpoint.
|
void |
pause()
Notify all media listeners that media playback has paused after a user interaction.
|
void |
playerStateChange(PlayerState playerState)
Notify all media listeners that media player state has changed.
|
void |
resume()
Notify all media listeners that media playback has resumed (after being paused) after a user
interaction.
|
void |
skipped()
Notify all media listeners that media playback has stopped as a user skip interaction.
|
void |
start(float duration,
float mediaPlayerVolume)
Notify all media listeners that media content has started playing.
|
void |
thirdQuartile()
Notify all media listeners that media playback has reached the third quartile.
|
void |
volumeChange(float mediaPlayerVolume)
Notify all media listeners that the media player volume has changed.
|
public static MediaEvents createMediaEvents(AdSession adSession)
adSession
- associated with the ad events.java.lang.IllegalArgumentException
- if the supplied ad session is null.java.lang.IllegalStateException
- if a media events instance has already been registered with
the ad session.java.lang.IllegalStateException
- if a media events instance has been created after the ad
session has started.AdSession
public void start(float duration, float mediaPlayerVolume)
duration
- of the selected media media (in seconds).mediaPlayerVolume
- from the native media player with a range between 0 and 1.java.lang.IllegalArgumentException
- if an invalid duration or mediaPlayerVolume has been supplied.java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void firstQuartile()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void midpoint()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void thirdQuartile()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void complete()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void pause()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void resume()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void bufferStart()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void bufferFinish()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void skipped()
java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void volumeChange(float mediaPlayerVolume)
mediaPlayerVolume
- from the native media player with a range between 0 and 1.java.lang.IllegalArgumentException
- if an invalid mediaPlayerVolume has been supplied.java.lang.IllegalStateException
- if the ad session has not been started or has finished.public void playerStateChange(PlayerState playerState)
PlayerState
for
list of supported states.playerState
- to signal the latest media player statejava.lang.IllegalArgumentException
- if the supplied player state is null.java.lang.IllegalStateException
- if the ad session has not been started or has finished.PlayerState
public void adUserInteraction(InteractionType interactionType)
InteractionType
for list of supported types.interactionType
- to signal the latest user integrationjava.lang.IllegalArgumentException
- if the supplied interaction type is null.java.lang.IllegalStateException
- if the ad session has not been started or has finished.InteractionType