Package com.jwplayer.pub.api.background
Class MediaSessionHelper
java.lang.Object
com.jwplayer.pub.api.background.MediaSessionHelper
- All Implemented Interfaces:
EventListener,AdvertisingEvents.OnAdCompleteListener,AdvertisingEvents.OnAdErrorListener,AdvertisingEvents.OnAdPlayListener,AdvertisingEvents.OnAdSkippedListener,VideoPlayerEvents.OnBufferListener,VideoPlayerEvents.OnErrorListener,VideoPlayerEvents.OnPauseListener,VideoPlayerEvents.OnPlaylistCompleteListener,VideoPlayerEvents.OnPlayListener,VideoPlayerEvents.OnPlaylistItemListener
public class MediaSessionHelper
extends Object
implements VideoPlayerEvents.OnPlayListener, VideoPlayerEvents.OnPauseListener, VideoPlayerEvents.OnBufferListener, VideoPlayerEvents.OnErrorListener, VideoPlayerEvents.OnPlaylistItemListener, VideoPlayerEvents.OnPlaylistCompleteListener, AdvertisingEvents.OnAdPlayListener, AdvertisingEvents.OnAdErrorListener, AdvertisingEvents.OnAdSkippedListener, AdvertisingEvents.OnAdCompleteListener
-
Constructor Summary
ConstructorsModifierConstructorDescriptionMediaSessionHelper(Context context, NotificationHelper notificationHelper, ServiceMediaApi serviceMediaApi) protectedMediaSessionHelper(Context context, NotificationHelper notificationHelper, ServiceMediaApi serviceMediaApi, BGAFactory bgaFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidonAdComplete(AdCompleteEvent adCompleteEvent) Fired whenever an ad has completed playback.voidonAdError(AdErrorEvent adErrorEvent) Fired whenever an error prevents the ad from playing.voidonAdPlay(AdPlayEvent adPlayEvent) Fired whenever an ad starts playing or when an ad is unpaused.voidonAdSkipped(AdSkippedEvent adSkippedEvent) Fired whenever an ad has been skipped.voidonBuffer(BufferEvent bufferEvent) Fired when the player enters the BUFFERING state.voidonError(ErrorEvent errorEvent) Fired when a media error has occurred, causing the player to stop playback and go into IDLE mode.voidonPause(PauseEvent pauseEvent) Fired when the player enters the PAUSED state.voidFired when the player enters the PLAYING state.voidonPlaylistComplete(PlaylistCompleteEvent playlistCompleteEvent) Fired when the player is done playing all items in the playlist.voidonPlaylistItem(PlaylistItemEvent playlistItemEvent) Fired when the playlist index changes to a new playlist item.protected voidupdateMediaSessionWith(JWPlayer player)
-
Constructor Details
-
MediaSessionHelper
public MediaSessionHelper(Context context, NotificationHelper notificationHelper, ServiceMediaApi serviceMediaApi) -
MediaSessionHelper
protected MediaSessionHelper(Context context, NotificationHelper notificationHelper, ServiceMediaApi serviceMediaApi, BGAFactory bgaFactory)
-
-
Method Details
-
updateMediaSessionWith
-
onPlaylistItem
Description copied from interface:VideoPlayerEvents.OnPlaylistItemListenerFired when the playlist index changes to a new playlist item. This event occurs before the player begins playing the new playlist item.- Specified by:
onPlaylistItemin interfaceVideoPlayerEvents.OnPlaylistItemListener- Parameters:
playlistItemEvent- The payload that accompanies the onPlaylistItem() event.
-
onError
Description copied from interface:VideoPlayerEvents.OnErrorListenerFired when a media error has occurred, causing the player to stop playback and go into IDLE mode.- Specified by:
onErrorin interfaceVideoPlayerEvents.OnErrorListener- Parameters:
errorEvent- The payload that accompanies the onError() event.
-
onAdComplete
Description copied from interface:AdvertisingEvents.OnAdCompleteListenerFired whenever an ad has completed playback.Supported for VAST and IMA.
- Specified by:
onAdCompletein interfaceAdvertisingEvents.OnAdCompleteListener- Parameters:
adCompleteEvent- The payload that accompanies the onAdComplete() event.
-
onAdSkipped
Description copied from interface:AdvertisingEvents.OnAdSkippedListenerFired whenever an ad has been skipped.Supported for VAST and IMA.
- Specified by:
onAdSkippedin interfaceAdvertisingEvents.OnAdSkippedListener- Parameters:
adSkippedEvent- The payload that accompanies the onAdSkipped() event.
-
onAdPlay
Description copied from interface:AdvertisingEvents.OnAdPlayListenerFired whenever an ad starts playing or when an ad is unpaused.- Specified by:
onAdPlayin interfaceAdvertisingEvents.OnAdPlayListener- Parameters:
adPlayEvent- The payload that accompanies the onAdPlay() event.
-
onAdError
Description copied from interface:AdvertisingEvents.OnAdErrorListenerFired whenever an error prevents the ad from playing.Supported for VAST and IMA.
- Specified by:
onAdErrorin interfaceAdvertisingEvents.OnAdErrorListener- Parameters:
adErrorEvent- The payload that accompanies the onAdError() event.
-
onBuffer
Description copied from interface:VideoPlayerEvents.OnBufferListenerFired when the player enters the BUFFERING state.- Specified by:
onBufferin interfaceVideoPlayerEvents.OnBufferListener- Parameters:
bufferEvent- The payload that accompanies the onBuffer() event.
-
onPause
Description copied from interface:VideoPlayerEvents.OnPauseListenerFired when the player enters the PAUSED state.- Specified by:
onPausein interfaceVideoPlayerEvents.OnPauseListener- Parameters:
pauseEvent- The payload that accompanies the onPause() event.
-
onPlay
Description copied from interface:VideoPlayerEvents.OnPlayListenerFired when the player enters the PLAYING state.- Specified by:
onPlayin interfaceVideoPlayerEvents.OnPlayListener- Parameters:
playEvent- The payload that accompanies the onPlay() event.
-
onPlaylistComplete
Description copied from interface:VideoPlayerEvents.OnPlaylistCompleteListenerFired when the player is done playing all items in the playlist. However, if the repeat option is set true, this is never fired.- Specified by:
onPlaylistCompletein interfaceVideoPlayerEvents.OnPlaylistCompleteListener- Parameters:
playlistCompleteEvent- The payload that accompanies the onPlaylistComplete() event.
-