public class JWPlayerView
extends android.widget.FrameLayout
Users from this class must forward several important lifecycle methods. It's important that you forward the following methods:
Modifier and Type | Class and Description |
---|---|
static interface |
JWPlayerView.Listener |
android.widget.FrameLayout.LayoutParams
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description |
---|
JWPlayerView(android.content.Context context,
android.util.AttributeSet attrs)
Constructor that is called when inflating a view from XML.
|
JWPlayerView(android.content.Context context,
PlayerConfig playerConfig)
Constructor used to programmatically initialize a JWPlayerView.
|
Modifier and Type | Method and Description |
---|---|
void |
addOnAdBreakEndListener(AdvertisingEvents.OnAdBreakEndListener listener)
Adds a listener to the OnAdBreakEnd event.
|
void |
addOnAdBreakStartListener(AdvertisingEvents.OnAdBreakStartListener listener)
Adds a listener to the OnAdBreakStart event.
|
void |
addOnAdClickListener(AdvertisingEvents.OnAdClickListener listener)
Adds a listener for the OnAdClick event.
|
void |
addOnAdCompanionsListener(AdvertisingEvents.OnAdCompanionsListener listener)
Adds an OnAdCompanionsListener.
|
void |
addOnAdCompleteListener(AdvertisingEvents.OnAdCompleteListener listener)
Adds a listener for the OnAddComplete event.
|
void |
addOnAdErrorListener(AdvertisingEvents.OnAdErrorListener listener)
Adds a listener for the OnAdError Event.
|
void |
addOnAdImpressionListener(AdvertisingEvents.OnAdImpressionListener listener)
Adds a listener for the OnAdImpression Event.
|
void |
addOnAdMetaListener(AdvertisingEvents.OnAdMetaListener listener)
Adds an OnAdMetaListener.
|
void |
addOnAdPauseListener(AdvertisingEvents.OnAdPauseListener listener)
Adds a listener to the OnAdPause event.
|
void |
addOnAdPlayListener(AdvertisingEvents.OnAdPlayListener listener)
Adds a listener for the OnAdPlay event.
|
void |
addOnAdRequestListener(AdvertisingEvents.OnAdRequestListener listener)
Adds an OnAdRequestListener.
|
void |
addOnAdScheduleListener(AdvertisingEvents.OnAdScheduleListener listener)
Adds a listener for the OnAdSchedule event.
|
void |
addOnAdSkippedListener(AdvertisingEvents.OnAdSkippedListener listener)
Adds a listener for the OnAdSkipped event.
|
void |
addOnAdStartedListener(AdvertisingEvents.OnAdStartedListener listener)
Adds an OnAdStartedListener.
|
void |
addOnAdTimeListener(AdvertisingEvents.OnAdTimeListener listener)
Adds a listener to the OnAdTime event.
|
void |
addOnAdViewableImpressionListener(AdvertisingEvents.OnAdViewableImpressionListener listener)
Adds a listener for the OnAdViewableImpression Event.
|
void |
addOnAudioTrackChangedListener(VideoPlayerEvents.OnAudioTrackChangedListener listener)
Adds an OnAudioTracksChangedListener.
|
void |
addOnAudioTracksListener(VideoPlayerEvents.OnAudioTracksListener listener)
Adds an OnAudioTracksListener.
|
void |
addOnBeforeCompleteListener(AdvertisingEvents.OnBeforeCompleteListener listener)
Adds an OnBeforeCompleteListener.
|
void |
addOnBeforePlayListener(AdvertisingEvents.OnBeforePlayListener listener)
Adds an OnBeforePlayListener.
|
void |
addOnBufferChangeListener(VideoPlayerEvents.OnBufferChangeListener listener)
Adds an OnBufferChangeListener.
|
void |
addOnBufferListener(VideoPlayerEvents.OnBufferListener listener)
Adds an OnBufferListener.
|
void |
addOnCaptionsChangedListener(VideoPlayerEvents.OnCaptionsChangedListener listener)
Adds an OnCaptionsChangedListener.
|
void |
addOnCaptionsListListener(VideoPlayerEvents.OnCaptionsListListener listener)
Adds an listener for the CaptionsList event.
|
void |
addOnCompleteListener(VideoPlayerEvents.OnCompleteListener listener)
Adds an OnCompleteListener.
|
void |
addOnControlBarVisibilityListener(VideoPlayerEvents.OnControlBarVisibilityListener listener)
Adds an OnControlBarVisibilityListener.
|
void |
addOnControlsListener(VideoPlayerEvents.OnControlsListener listener)
Adds an OnControlsListener.
|
void |
addOnDisplayClickListener(VideoPlayerEvents.OnDisplayClickListener listener)
Adds an OnDisplayClickListener.
|
void |
addOnErrorListener(VideoPlayerEvents.OnErrorListener listener)
Adds an OnErrorListener.
|
void |
addOnFirstFrameListener(VideoPlayerEvents.OnFirstFrameListener listener)
Adds an OnFirstFrameListener.
|
void |
addOnFullscreenListener(VideoPlayerEvents.OnFullscreenListener listener)
Adds an listener for the OnFullScreen event.
|
void |
addOnIdleListener(VideoPlayerEvents.OnIdleListener listener)
Adds an OnIdleListener.
|
void |
addOnLevelsChangedListener(VideoPlayerEvents.OnLevelsChangedListener listener)
Adds an OnLevelsChangedListener.
|
void |
addOnLevelsListener(VideoPlayerEvents.OnLevelsListener listener)
Adds an OnLevelsListener.
|
void |
addOnMetaListener(VideoPlayerEvents.OnMetaListener listener)
Adds an OnMetaListener.
|
void |
addOnMuteListener(VideoPlayerEvents.OnMuteListener listener)
Adds an OnMuteListener.
|
void |
addOnPauseListener(VideoPlayerEvents.OnPauseListener listener)
Adds an OnPauseListener.
|
void |
addOnPlaybackRateChangedListener(VideoPlayerEvents.OnPlaybackRateChangedListener listener)
Adds an OnPlaybackRateChangedListener.
|
void |
addOnPlaylistCompleteListener(VideoPlayerEvents.OnPlaylistCompleteListener listener)
Adds an OnPlaylistCompleteListener.
|
void |
addOnPlayListener(VideoPlayerEvents.OnPlayListener listener)
Adds an OnPlayListener.
|
void |
addOnPlaylistItemListener(VideoPlayerEvents.OnPlaylistItemListener listener)
Adds an OnPlaylistItemListener.
|
void |
addOnPlaylistListener(VideoPlayerEvents.OnPlaylistListener listener)
Adds an OnPlaylistListener.
|
void |
addOnReadyListener(VideoPlayerEvents.OnReadyListener listener)
Adds an OnReadyListener.
|
void |
addOnRelatedCloseListener(RelatedPluginEvents.OnRelatedCloseListener listener)
Adds an OnRelatedCloseListener.
|
void |
addOnRelatedOpenListener(RelatedPluginEvents.OnRelatedOpenListener listener)
Adds an OnRelatedOpenListener.
|
void |
addOnRelatedPlayListener(RelatedPluginEvents.OnRelatedPlayListener listener)
Adds an OnRelatedPlayListener.
|
void |
addOnSeekedListener(VideoPlayerEvents.OnSeekedListener listener)
Adds an OnSeekedListener.
|
void |
addOnSeekListener(VideoPlayerEvents.OnSeekListener listener)
Adds an OnSeekListener.
|
void |
addOnSetupErrorListener(VideoPlayerEvents.OnSetupErrorListener listener)
Adds an OnSetupErrorListener.
|
void |
addOnSharingClickListener(SharingPluginEvents.OnSharingClickListener listener)
Adds an OnSharingClickListener.
|
void |
addOnSharingCloseListener(SharingPluginEvents.OnSharingCloseListener listener)
Adds an OnSharingCloseListener.
|
void |
addOnSharingOpenListener(SharingPluginEvents.OnSharingOpenListener listener)
Adds an OnSharingOpenListener.
|
void |
addOnTimeListener(VideoPlayerEvents.OnTimeListener listener)
Adds an OnTimeListener.
|
void |
addOnViewableListener(VideoPlayerEvents.OnViewableListener listener)
Adds an OnViewableListener.
|
void |
addOnVisualQualityListener(VideoPlayerEvents.OnVisualQualityListener listener)
Adds an OnVisualQualityListener.
|
void |
addOnWarningListener(VideoPlayerEvents.OnWarningListener listener)
Adds an OnWarningListener.
|
void |
closeRelatedOverlay()
Closes the related videos overlay if the current video/playlist has a related feed enabled and is shown
|
void |
closeSharingOverlay()
Closes the sharing plugin if it is opened.
|
void |
destroySurface()
Destroys the video surface the JW Player is rendering too.
|
double |
getAdPosition()
Returns the current ad playback position.
|
java.util.List<AudioTrack> |
getAudioTracks()
Returns a List with audio tracks from the player.
|
int |
getBuffer()
Gets the current buffer percentage of the loaded media.
|
java.util.List<Caption> |
getCaptionsList()
Returns a List with captions tracks from the player.
|
PlayerConfig |
getConfig()
Returns the current configuration being used by the player.
|
boolean |
getControls()
Returns whether or not the built-in controls are currently enabled
|
int |
getCurrentAudioTrack()
Returns the index of the currently active audio track.
|
int |
getCurrentCaptions()
Returns the index of the currently active captions track.
|
int |
getCurrentQuality()
Returns the index of the currently active quality level.
|
double |
getDuration()
Returns the duration of the current media.
|
ExoPlayerSettings |
getExoPlayerSettings()
Returns
ExoPlayerSettings reference to manage ExoPlayer's settings |
com.longtailvideo.jwplayer.ExperimentalAPI |
getExperimentalAPI()
Returns
ExperimentalAPI reference to access the Experimental API |
boolean |
getFullscreen()
Returns whether the player is currently in fullscreen.
|
JWFriendlyAdObstructions |
getJWFriendlyAdObstructions() |
boolean |
getMute()
Returns whether the player is currently muted or not
|
float |
getPlaybackRate()
Returns current playback rate
|
java.util.List<PlaylistItem> |
getPlaylist()
Returns the player's current playlist List.
|
int |
getPlaylistIndex()
Returns the index of the currently active item in the playlist.
|
PlaylistItem |
getPlaylistItem()
Returns the currently playing
PlaylistItem . |
PlaylistItem |
getPlaylistItem(int index)
Retrieves the same information as getPlaylist(), but for a single playlist item
|
double |
getPosition()
Returns the current playback position.
|
java.util.List<QualityLevel> |
getQualityLevels()
Returns a list with quality levels from the player.
|
com.longtailvideo.jwplayer.core.PlayerState |
getState()
Returns the player's current playback state.
|
java.lang.String |
getVersionCode()
Returns the SDK version.
|
VisualQualityEvent |
getVisualQuality()
Returns a VisualQuality object containing information about the current quality of a video stream.
|
void |
initializeSurface()
Initializes the video surface the JW Player renders to.
|
boolean |
isControlBarVisible()
Returns whether or not the built-in control bar is visible.
|
void |
load(java.util.List<PlaylistItem> playlist)
Loads a new playlist into the player.
|
void |
load(java.util.List<PlaylistItem> playlist,
AdvertisingBase advertising)
Loads a new playlist into the player.
|
void |
load(PlaylistItem playlistItem)
Loads media into the player.
|
void |
next()
Tells JW Player to immediately play the next playlist item.
|
protected void |
onAttachedToWindow() |
void |
onDestroy()
Called by Activity.onDestroy
to allow the player to release resources.
|
void |
onPause()
Called by Activity.onPause()
to allow the player to prepare for the activity pausing/backgrounding.
|
void |
onResume()
Called by Activity.onResume()
to allow the player to handle activity resuming/foregrounding.
|
void |
onStart()
Called by Activity.onStart()
to allow the player to handle activity resuming/foregrounding.
|
void |
onStop()
Called by Activity.onStop()
to allow the player to prepare for the activity pausing/backgrounding.
|
void |
openRelatedOverlay()
Opens the related videos overlay if the current video/playlist has a related feed enabled
If the video is still playing it will pause
|
void |
openSharingOverlay()
Opens the sharing plugin.
|
void |
pause()
Pauses playback, changing the state of JW Player from playing to paused.
|
void |
pauseAd()
Pauses ad playback.
|
void |
pauseAd(boolean state)
Used to pause or resume ad playback.
|
void |
play()
Sets the play state of the JW Player.
|
void |
playAd(AdSource adSource,
java.lang.String... vasts)
Used to play an ad right now, which is primarily useful for situations where the built-in ad.
|
void |
playAd(java.lang.String... vasts)
Used to play an ad right now, which is primarily useful for situations where the built-in ad.
|
void |
playlistItem(int index)
Start playback of the playlist item at the specified index.
|
boolean |
removeOnAdBreakEndListener(AdvertisingEvents.OnAdBreakEndListener listener)
Removes a listener from the OnAdBreakEnd event.
|
boolean |
removeOnAdBreakStartListener(AdvertisingEvents.OnAdBreakStartListener listener)
Removes a listener from the OnAdBreakStart event.
|
boolean |
removeOnAdClickListener(AdvertisingEvents.OnAdClickListener listener)
Removes the listener from the OnAdClick event.
|
boolean |
removeOnAdCompanionsListener(AdvertisingEvents.OnAdCompanionsListener listener)
Removes an OnAdCompanionsListener.
|
boolean |
removeOnAdCompleteListener(AdvertisingEvents.OnAdCompleteListener listener)
Removes a listener for the OnAddComplete event.
|
boolean |
removeOnAdErrorListener(AdvertisingEvents.OnAdErrorListener listener)
Removes an OnAdError listener.
|
boolean |
removeOnAdImpressionListener(AdvertisingEvents.OnAdImpressionListener listener)
Removes a listener from the OnAdImpression event.
|
boolean |
removeOnAdMetaListener(AdvertisingEvents.OnAdMetaListener listener)
Removes an OnAdMetaListener.
|
boolean |
removeOnAdPauseListener(AdvertisingEvents.OnAdPauseListener listener)
Removes a listener from the OnAdPause event.
|
boolean |
removeOnAdPlayListener(AdvertisingEvents.OnAdPlayListener listener)
Removes an OnAdPlayListener.
|
boolean |
removeOnAdRequestListener(AdvertisingEvents.OnAdRequestListener listener)
Removes an OnAdRequestListener.
|
boolean |
removeOnAdScheduleListener(AdvertisingEvents.OnAdScheduleListener listener)
Removes an OnAdScheduleListener.
|
boolean |
removeOnAdSkippedListener(AdvertisingEvents.OnAdSkippedListener listener)
Removes a listener for the OnAdSkipped event.
|
boolean |
removeOnAdStartedListener(AdvertisingEvents.OnAdStartedListener listener)
Removes an OnAdStartedListener.
|
boolean |
removeOnAdTimeListener(AdvertisingEvents.OnAdTimeListener listener)
Removes a listener from the OnAdTime event.
|
boolean |
removeOnAdViewableImpressionListener(AdvertisingEvents.OnAdViewableImpressionListener listener)
Removes a listener from the OnAdViewableImpression event.
|
boolean |
removeOnAudioTrackChangedListener(VideoPlayerEvents.OnAudioTrackChangedListener listener)
Removes the given OnAudioTrackChanged listener.
|
boolean |
removeOnAudioTracksListener(VideoPlayerEvents.OnAudioTracksListener listener)
Removes an OnAudioTracksListener.
|
boolean |
removeOnBeforeCompleteListener(AdvertisingEvents.OnBeforeCompleteListener listener)
Removes an OnBeforeCompleteListener.
|
boolean |
removeOnBeforePlayListener(AdvertisingEvents.OnBeforePlayListener listener)
Removes an OnBeforePlayListener.
|
boolean |
removeOnBufferChangeListener(VideoPlayerEvents.OnBufferChangeListener listener)
Removes an OnBufferChangeListener.
|
boolean |
removeOnBufferListener(VideoPlayerEvents.OnBufferListener listener)
Removes an OnBufferListener.
|
boolean |
removeOnCaptionsChangedListener(VideoPlayerEvents.OnCaptionsChangedListener listener)
Removes an OnCaptionsChangedListener.
|
boolean |
removeOnCaptionsListListener(VideoPlayerEvents.OnCaptionsListListener listener)
Removes an OnCaptionsListListener.
|
boolean |
removeOnCompleteListener(VideoPlayerEvents.OnCompleteListener listener)
Removes an OnCompleteListener.
|
boolean |
removeOnControlBarVisibilityListener(VideoPlayerEvents.OnControlBarVisibilityListener listener)
Removes an OnControlsListener.
|
boolean |
removeOnControlsListener(VideoPlayerEvents.OnControlsListener listener)
Removes an OnControlsListener.
|
boolean |
removeOnDisplayClickListener(VideoPlayerEvents.OnDisplayClickListener listener)
Removes an OnDisplayClickListener.
|
boolean |
removeOnErrorListener(VideoPlayerEvents.OnErrorListener listener)
Removes an OnErrorListener.
|
boolean |
removeOnFirstFrameListener(VideoPlayerEvents.OnFirstFrameListener listener)
Removes an OnFirstFrameListener.
|
boolean |
removeOnFullscreenListener(VideoPlayerEvents.OnFullscreenListener listener)
Removes an OnFullScreenListener.
|
boolean |
removeOnIdleListener(VideoPlayerEvents.OnIdleListener listener)
Removes an OnIdleListener.
|
boolean |
removeOnLevelsChangedListener(VideoPlayerEvents.OnLevelsChangedListener listener)
Removes an OnLevelsChangedListener.
|
boolean |
removeOnLevelsListener(VideoPlayerEvents.OnLevelsListener listener)
Removes an OnLevelsListener.
|
boolean |
removeOnMetaListener(VideoPlayerEvents.OnMetaListener listener)
Removes an OnMetaListener.
|
boolean |
removeOnMuteListener(VideoPlayerEvents.OnMuteListener listener)
Removes a listener for the OnMute event.
|
boolean |
removeOnPauseListener(VideoPlayerEvents.OnPauseListener listener)
Removes an OnPauseListener.
|
void |
removeOnPlaybackRateChangedListener(VideoPlayerEvents.OnPlaybackRateChangedListener listener)
Removes a listener for the OnMute event.
|
boolean |
removeOnPlaylistCompleteListener(VideoPlayerEvents.OnPlaylistCompleteListener listener)
Adds an listener to the OnPlaylistComplete event.
|
boolean |
removeOnPlayListener(VideoPlayerEvents.OnPlayListener listener)
Removes an OnPlayListener.
|
boolean |
removeOnPlaylistItemListener(VideoPlayerEvents.OnPlaylistItemListener listener)
Removes an OnPlaylistItemListener.
|
boolean |
removeOnPlaylistListener(VideoPlayerEvents.OnPlaylistListener listener)
Removes an OnPlaylistListener.
|
boolean |
removeOnReadyListener(VideoPlayerEvents.OnReadyListener listener)
Removes the ready listener.
|
boolean |
removeOnRelatedCloseListener(RelatedPluginEvents.OnRelatedCloseListener listener)
Removes an OnRelatedCloseListener.
|
boolean |
removeOnRelatedOpenListener(RelatedPluginEvents.OnRelatedOpenListener listener)
Removes an OnRelatedOpenListener.
|
boolean |
removeOnRelatedPlayListener(RelatedPluginEvents.OnRelatedPlayListener listener)
Removes an OnRelatedPlayListener.
|
boolean |
removeOnSeekedListener(VideoPlayerEvents.OnSeekedListener listener)
Removes an OnSeekedListener.
|
boolean |
removeOnSeekListener(VideoPlayerEvents.OnSeekListener listener)
Removes an OnSeekListener.
|
boolean |
removeOnSetupErrorListener(VideoPlayerEvents.OnSetupErrorListener listener)
Removes the setup error listener.
|
boolean |
removeOnSharingClickListener(SharingPluginEvents.OnSharingClickListener listener)
Removes an OnSharingClickListener.
|
boolean |
removeOnSharingCloseListener(SharingPluginEvents.OnSharingCloseListener listener)
Removes an OnSharingCloseListener.
|
boolean |
removeOnSharingOpenListener(SharingPluginEvents.OnSharingOpenListener listener)
Removes an OnSharingOpenListener.
|
boolean |
removeOnTimeListener(VideoPlayerEvents.OnTimeListener listener)
Removes an OnTimeListener.
|
boolean |
removeOnViewableListener(VideoPlayerEvents.OnViewableListener listener)
Removes an OnViewableListener.
|
boolean |
removeOnVisualQualityListener(VideoPlayerEvents.OnVisualQualityListener listener)
Removes an OnVisualQualityListener.
|
boolean |
removeOnWarningListener(VideoPlayerEvents.OnWarningListener listener)
Removes an OnWarningListener.
|
void |
seek(double position)
Seeks the currently playing media to the specified position.
|
void |
setAnalyticsListener(com.google.android.exoplayer2.analytics.AnalyticsListener listener)
Sets an
AnalyticsListener to receive analytics events. |
void |
setBackgroundAudio(boolean enableBackgroundAudio)
Sets whether the player is allowed to play audio in the background.
|
void |
setControls(boolean controls)
Enable the built-in controls by setting them true, disable the controls by setting them false.
|
void |
setCurrentAudioTrack(int index)
Change the audio track to the provided index.
|
void |
setCurrentCaptions(int index)
Change the visible captions track to the provided index.
|
void |
setCurrentQuality(int index)
Change the quality level to the provided index.
|
void |
setFullscreen(boolean state,
boolean allowRotation)
Enables or disables fullscreen mode.
|
void |
setFullscreenHandler(FullscreenHandler fullscreenHandler)
Replaces the default FullscreenHandler with the one provided.
|
void |
setLayoutParams(android.view.ViewGroup.LayoutParams params) |
static void |
setLicenseKey(android.content.Context context,
java.lang.String license)
Sets the license key for JW Player programmatically.
|
void |
setMute()
Toggles the mute state of the player.
|
void |
setMute(boolean state)
Sets the mute state of the player.
|
void |
setPlaybackRate(float playbackRate)
Sets playback rate
|
void |
setup(PlayerConfig playerConfig)
Sets up JW Player with a new
PlayerConfig . |
protected void |
setUseFullscreenLayoutFlags(boolean useFullscreenLayoutFlags)
Determines whether the View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flags are used during fullscreen.
|
void |
setWindowOpenHandler(WindowOpenHandler windowOpenHandler)
Sets the WindowOpenHandler, you can use this to override the default behavior of opening the browser when a url is requested.
|
void |
stop()
Stops the player, returning it to the idle state.
|
void |
updateHttpHeaders(java.util.Map<java.lang.String,java.lang.String> httpHeaders)
Updates HTTP headers included in content network requests
|
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, onLayout, onMeasure, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
public JWPlayerView(android.content.Context context, android.util.AttributeSet attrs)
context
- The view context.attrs
- The attributes to the view.public JWPlayerView(android.content.Context context, PlayerConfig playerConfig)
context
- the activity the JWPlayerView runs in.playerConfig
- the player configuration.public java.lang.String getVersionCode()
public void setup(PlayerConfig playerConfig)
PlayerConfig
. This can be used to load media and change options (e.g. captions styling) without creating a new instance of the player.playerConfig
- The player configuration to use with this JWPlayerView
.public void next()
public void load(java.util.List<PlaylistItem> playlist, AdvertisingBase advertising)
If you want to play a local file on the device the url of the media should be in the form of: "file:///path/to/file.mp4".
In order to play a local file on Android 6+ (API 23) you need to ask for the permission "READ_EXTERNAL_STORE" at runtime, and check if the user has granted that permission. If the user denied permission to read the external storage the JW Player will not be able to play the local file.
For more information about permissions in Android 6 see Permissions.
playlist
- List of PlaylistItem
objects that make up the playlist.advertising
- AdvertisingBase
settings to load for the entire playlist.public void load(PlaylistItem playlistItem)
If you want to play a local file on the device the url of the media should be in the form of: "file:///path/to/file.mp4".
In order to play a local file on Android 6+ (API 23) you need to ask for the permission "READ_EXTERNAL_STORE" at runtime, and check if the user has granted that permission. If the user denied permission to read the external storage the JW Player will not be able to play the local file.
For more information about permissions in Android 6 see Permissions.
playlistItem
- PlaylistItem
object to play.public void load(java.util.List<PlaylistItem> playlist)
If you want to play a local file on the device the url of the media should be in the form of: "file:///path/to/file.mp4".
In order to play a local file on Android 6+ (API 23) you need to ask for the permission "READ_EXTERNAL_STORE" at runtime, and check if the user has granted that permission. If the user denied permission to read the external storage the JW Player will not be able to play the local file.
For more information about permissions in Android 6 see Permissions.
playlist
- List of PlaylistItem
objects that make up the playlist.public PlayerConfig getConfig()
public com.longtailvideo.jwplayer.core.PlayerState getState()
public void play()
public void pause()
public void stop()
public double getPosition()
public double getAdPosition()
public double getDuration()
public void seek(double position)
position
- The position to seek to in seconds from the beginning.public boolean getFullscreen()
public void setFullscreen(boolean state, boolean allowRotation)
state
- Whether the video player should run in fullscreen mode.allowRotation
- Whether to allow rotation to enter or exit fullscreen, false to only allow portrait/landscape change via setFullscreen().public void setControls(boolean controls)
controls
- whether to enable or disable the controls.public void playAd(java.lang.String... vasts)
Supported for VAST only. Use playAd(AdSource, String...)
if you want to play IMA ads.
vasts
- The ad tags to play.public void playAd(AdSource adSource, java.lang.String... vasts)
VMAP's are not supported by this method.
vasts
- The ad tags to play.public void pauseAd()
public void pauseAd(boolean state)
state
- Set whether or not the ad playback should be paused.public void setWindowOpenHandler(WindowOpenHandler windowOpenHandler)
windowOpenHandler
- the WindowOpenHandler
to use for opening URLs.public void openRelatedOverlay()
public void closeRelatedOverlay()
public void openSharingOverlay()
public void closeSharingOverlay()
public java.util.List<PlaylistItem> getPlaylist()
public int getPlaylistIndex()
public PlaylistItem getPlaylistItem(int index)
public PlaylistItem getPlaylistItem()
PlaylistItem
.PlaylistItem
.public void playlistItem(int index)
index
- The index of a playlist item you wish to play.public int getBuffer()
public java.util.List<QualityLevel> getQualityLevels()
public int getCurrentQuality()
public void setCurrentQuality(int index)
index
- Index of the quality level to switch to.public float getPlaybackRate()
public void setPlaybackRate(float playbackRate)
playbackRate
- The playback rate to be setpublic VisualQualityEvent getVisualQuality()
public java.util.List<Caption> getCaptionsList()
public int getCurrentCaptions()
public void setCurrentCaptions(int index)
Note an index of 0 always turns the captions Off.
index
- The index of the caption track to switch to.public void setCurrentAudioTrack(int index)
index
- Index of the audio track to switch to.public int getCurrentAudioTrack()
public java.util.List<AudioTrack> getAudioTracks()
public boolean getMute()
public boolean getControls()
@NonNull public ExoPlayerSettings getExoPlayerSettings()
ExoPlayerSettings
reference to manage ExoPlayer's settings@NonNull public com.longtailvideo.jwplayer.ExperimentalAPI getExperimentalAPI()
ExperimentalAPI
reference to access the Experimental APIpublic boolean isControlBarVisible()
Note: this might not give the expected result if you are using a custom CSS skin that alters the behavior of the control bar.
public void setMute()
public void setMute(boolean state)
state
- If true, mute the player. If false, unmute the player.public void setFullscreenHandler(FullscreenHandler fullscreenHandler)
fullscreenHandler
- the fullscreen handler that should take care of fullscreening.protected void setUseFullscreenLayoutFlags(boolean useFullscreenLayoutFlags)
These flags create an issue on Android 4.1, 4.2, and 4.3 devices when using the SupportActionBar, set this to false to disable using these flags.
public static void setLicenseKey(android.content.Context context, java.lang.String license)
This must be called before JWPlayerView is instantiated.
context
- The application's contextlicense
- The JW Player license to usepublic void setAnalyticsListener(com.google.android.exoplayer2.analytics.AnalyticsListener listener)
AnalyticsListener
to receive analytics events.listener
- The listener to be added.public void updateHttpHeaders(java.util.Map<java.lang.String,java.lang.String> httpHeaders)
httpHeaders
- mapping of headers to add to content network requestspublic void onStart()
public void onResume()
public void onPause()
public void onStop()
public void onDestroy()
protected void onAttachedToWindow()
onAttachedToWindow
in class android.view.ViewGroup
public void setLayoutParams(android.view.ViewGroup.LayoutParams params)
setLayoutParams
in class android.view.View
public void initializeSurface()
public void destroySurface()
public void setBackgroundAudio(boolean enableBackgroundAudio)
enableBackgroundAudio
- true if the player should play audio in the background, false if it should not.public void addOnReadyListener(VideoPlayerEvents.OnReadyListener listener)
listener
- The listener to add for the onSetupError event.public boolean removeOnReadyListener(VideoPlayerEvents.OnReadyListener listener)
listener
- the listener to remove.public void addOnSetupErrorListener(VideoPlayerEvents.OnSetupErrorListener listener)
listener
- The listener to add for the onSetupError event.public boolean removeOnSetupErrorListener(VideoPlayerEvents.OnSetupErrorListener listener)
listener
- the listener to remove.public void addOnPlaylistListener(VideoPlayerEvents.OnPlaylistListener listener)
listener
- The listener for the onPlaylist event.public boolean removeOnPlaylistListener(VideoPlayerEvents.OnPlaylistListener listener)
listener
- the listener to remove.public void addOnPlaylistItemListener(VideoPlayerEvents.OnPlaylistItemListener listener)
listener
- The listener for the onPlaylistItem event.public boolean removeOnPlaylistItemListener(VideoPlayerEvents.OnPlaylistItemListener listener)
listener
- the listener to remove.public void addOnPlayListener(VideoPlayerEvents.OnPlayListener listener)
listener
- The listener to add for the onPlay event.public boolean removeOnPlayListener(VideoPlayerEvents.OnPlayListener listener)
listener
- the listener to remove for the OnPlay event.public void addOnPauseListener(VideoPlayerEvents.OnPauseListener listener)
listener
- The listener to add for the onPause event.public boolean removeOnPauseListener(VideoPlayerEvents.OnPauseListener listener)
listener
- The listener to remove for the onPauseListener.public void addOnBufferListener(VideoPlayerEvents.OnBufferListener listener)
listener
- The listener to add for the onBuffer event.public boolean removeOnBufferListener(VideoPlayerEvents.OnBufferListener listener)
listener
- the listener to remove.public void addOnIdleListener(VideoPlayerEvents.OnIdleListener listener)
listener
- The listener to add for the onIdle event.public boolean removeOnIdleListener(VideoPlayerEvents.OnIdleListener listener)
listener
- the listener to remove for the OnIdle event.public void addOnErrorListener(VideoPlayerEvents.OnErrorListener listener)
listener
- The listener to add for the onError event.public boolean removeOnErrorListener(VideoPlayerEvents.OnErrorListener listener)
listener
- the listener to remove for the onError event.public void addOnWarningListener(VideoPlayerEvents.OnWarningListener listener)
listener
- The listener to add for the onWarning event.public boolean removeOnWarningListener(VideoPlayerEvents.OnWarningListener listener)
listener
- the listener to remove for the onError event.public void addOnSeekListener(VideoPlayerEvents.OnSeekListener listener)
listener
- The listener to ad for the onSeek event.public boolean removeOnSeekListener(VideoPlayerEvents.OnSeekListener listener)
listener
- the listener to remove for the onSeek event.public void addOnTimeListener(VideoPlayerEvents.OnTimeListener listener)
listener
- The listener for the onTime event.public boolean removeOnTimeListener(VideoPlayerEvents.OnTimeListener listener)
listener
- The listener to remove for the onTime event.public void addOnFullscreenListener(VideoPlayerEvents.OnFullscreenListener listener)
listener
- The listener to add for the onFullscreen event.public boolean removeOnFullscreenListener(VideoPlayerEvents.OnFullscreenListener listener)
listener
- the listener to remove.public void addOnLevelsListener(VideoPlayerEvents.OnLevelsListener listener)
listener
- The listener to add for the onLevels event.public boolean removeOnLevelsListener(VideoPlayerEvents.OnLevelsListener listener)
listener
- The listener to add for the onLevels event.public void addOnLevelsChangedListener(VideoPlayerEvents.OnLevelsChangedListener listener)
listener
- The listener to add for the onLevelsChanged event.public boolean removeOnLevelsChangedListener(VideoPlayerEvents.OnLevelsChangedListener listener)
listener
- the listener to remove for the OnLevelsChanged event.public void addOnAudioTracksListener(VideoPlayerEvents.OnAudioTracksListener listener)
listener
- The listener to add for the onAudioTracks event.public boolean removeOnAudioTracksListener(VideoPlayerEvents.OnAudioTracksListener listener)
listener
- The listener to add for the OnAudioTracks Event.public void addOnAudioTrackChangedListener(VideoPlayerEvents.OnAudioTrackChangedListener listener)
listener
- The listener to add for the OnAudioTrackChange event.public boolean removeOnAudioTrackChangedListener(VideoPlayerEvents.OnAudioTrackChangedListener listener)
listener
- the listener to remove for the OnAudioTrackChanged event.public void addOnMuteListener(VideoPlayerEvents.OnMuteListener listener)
listener
- the listener to add for the OnMute event.public boolean removeOnMuteListener(VideoPlayerEvents.OnMuteListener listener)
listener
- the listener to remove for the OnMute event.public void addOnPlaybackRateChangedListener(VideoPlayerEvents.OnPlaybackRateChangedListener listener)
listener
- the listener to add for the OnPlaybackRateChanged event.public void removeOnPlaybackRateChangedListener(VideoPlayerEvents.OnPlaybackRateChangedListener listener)
listener
- the listener to remove for the OnPlaybackRateChanged event.public void addOnCaptionsListListener(VideoPlayerEvents.OnCaptionsListListener listener)
listener
- The listener to add for the onCaptionsList event.public boolean removeOnCaptionsListListener(VideoPlayerEvents.OnCaptionsListListener listener)
listener
- the listener to remove from the OnCaptionsList event.public void addOnCaptionsChangedListener(VideoPlayerEvents.OnCaptionsChangedListener listener)
listener
- The listener to add for the onCaptionsChanged event.public boolean removeOnCaptionsChangedListener(VideoPlayerEvents.OnCaptionsChangedListener listener)
listener
- the listener to remove from the OnCaptionsChanged event.public void addOnAdClickListener(AdvertisingEvents.OnAdClickListener listener)
listener
- The listener to add for the onAdClick event.public boolean removeOnAdClickListener(AdvertisingEvents.OnAdClickListener listener)
listener
- the listener to remove from the OnAdClick event.public void addOnAdCompleteListener(AdvertisingEvents.OnAdCompleteListener listener)
listener
- The listener to add for the onAdComplete event.public boolean removeOnAdCompleteListener(AdvertisingEvents.OnAdCompleteListener listener)
listener
- the listener to remove for the OnAddComplete event.public void addOnAdSkippedListener(AdvertisingEvents.OnAdSkippedListener listener)
listener
- The listener to add for the onAdSkipped event.public boolean removeOnAdSkippedListener(AdvertisingEvents.OnAdSkippedListener listener)
listener
- the listener to remove for the OnAdSkipped event.public void addOnAdErrorListener(AdvertisingEvents.OnAdErrorListener listener)
listener
- The listener to add for the onAdError event.public boolean removeOnAdErrorListener(AdvertisingEvents.OnAdErrorListener listener)
listener
- the listener to remove.public void addOnAdImpressionListener(AdvertisingEvents.OnAdImpressionListener listener)
listener
- The listener to add for the onAdImpression event.public boolean removeOnAdImpressionListener(AdvertisingEvents.OnAdImpressionListener listener)
listener
- the listener to remove for the OnAdImpression event.public void addOnAdViewableImpressionListener(AdvertisingEvents.OnAdViewableImpressionListener listener)
listener
- The listener to add for the onAdViewableImpression event.public boolean removeOnAdViewableImpressionListener(AdvertisingEvents.OnAdViewableImpressionListener listener)
listener
- the listener to remove for the OnAdViewableImpression event.public void addOnAdTimeListener(AdvertisingEvents.OnAdTimeListener listener)
listener
- The listener to add for the onAdTime event.public boolean removeOnAdTimeListener(AdvertisingEvents.OnAdTimeListener listener)
listener
- the listener to add to the OnAdTime event.public void addOnAdBreakStartListener(AdvertisingEvents.OnAdBreakStartListener listener)
listener
- The listener to add for the onAdBreakStart event.public boolean removeOnAdBreakStartListener(AdvertisingEvents.OnAdBreakStartListener listener)
listener
- the listener to add to the OnAdBreakStart event.public void addOnAdBreakEndListener(AdvertisingEvents.OnAdBreakEndListener listener)
listener
- The listener to add for the onAdBreakEnd event.public boolean removeOnAdBreakEndListener(AdvertisingEvents.OnAdBreakEndListener listener)
listener
- the listener to add to the OnAdBreakEnd event.public void addOnAdPauseListener(AdvertisingEvents.OnAdPauseListener listener)
listener
- The listener to add for the onAdPause event.public boolean removeOnAdPauseListener(AdvertisingEvents.OnAdPauseListener listener)
listener
- the listener to remove from the OnAdPause event.public void addOnAdPlayListener(AdvertisingEvents.OnAdPlayListener listener)
listener
- The listener to add for the onAdPlay event.public boolean removeOnAdPlayListener(AdvertisingEvents.OnAdPlayListener listener)
listener
- The listener to remove from the OnAdPlay event.public void addOnAdScheduleListener(AdvertisingEvents.OnAdScheduleListener listener)
listener
- The listener to add for the onAdSchedule event.public boolean removeOnAdScheduleListener(AdvertisingEvents.OnAdScheduleListener listener)
listener
- The listener to remove from the OnAdSchedule event.public void addOnMetaListener(VideoPlayerEvents.OnMetaListener listener)
listener
- The listener for the onMeta event.public boolean removeOnMetaListener(VideoPlayerEvents.OnMetaListener listener)
listener
- the listener to remove.public void addOnPlaylistCompleteListener(VideoPlayerEvents.OnPlaylistCompleteListener listener)
listener
- The listener for the onPlaylistComplete event.public boolean removeOnPlaylistCompleteListener(VideoPlayerEvents.OnPlaylistCompleteListener listener)
listener
- the listener to remove from the event.public void addOnCompleteListener(VideoPlayerEvents.OnCompleteListener listener)
listener
- The listener for the onComplete event.public boolean removeOnCompleteListener(VideoPlayerEvents.OnCompleteListener listener)
listener
- the listener to remove.public void addOnBeforePlayListener(AdvertisingEvents.OnBeforePlayListener listener)
listener
- The listener for the onBeforePlay event.public boolean removeOnBeforePlayListener(AdvertisingEvents.OnBeforePlayListener listener)
listener
- the listener to remove.public void addOnBeforeCompleteListener(AdvertisingEvents.OnBeforeCompleteListener listener)
listener
- The listener to add for the onBeforeComplete event.public boolean removeOnBeforeCompleteListener(AdvertisingEvents.OnBeforeCompleteListener listener)
listener
- the listener to remove.public void addOnFirstFrameListener(VideoPlayerEvents.OnFirstFrameListener listener)
listener
- The listener to add for the onFirstFrame event.public boolean removeOnFirstFrameListener(VideoPlayerEvents.OnFirstFrameListener listener)
listener
- the listener to remove.public void addOnViewableListener(VideoPlayerEvents.OnViewableListener listener)
listener
- The listener to add for the onFirstFrame event.public boolean removeOnViewableListener(VideoPlayerEvents.OnViewableListener listener)
listener
- the listener to remove.public void addOnAdMetaListener(AdvertisingEvents.OnAdMetaListener listener)
listener
- The listener to add for the onAdMeta event.public boolean removeOnAdMetaListener(AdvertisingEvents.OnAdMetaListener listener)
listener
- the listener to remove.public void addOnSeekedListener(VideoPlayerEvents.OnSeekedListener listener)
listener
- The listener to add for the onSeeked event.public boolean removeOnSeekedListener(VideoPlayerEvents.OnSeekedListener listener)
listener
- the listener to remove.public void addOnVisualQualityListener(VideoPlayerEvents.OnVisualQualityListener listener)
listener
- The listener to add for the onVisualQuality event.public boolean removeOnVisualQualityListener(VideoPlayerEvents.OnVisualQualityListener listener)
listener
- the listener to remove.public void addOnDisplayClickListener(VideoPlayerEvents.OnDisplayClickListener listener)
listener
- The listener to add for the onDisplayClick event.public boolean removeOnDisplayClickListener(VideoPlayerEvents.OnDisplayClickListener listener)
listener
- the listener to remove.public void addOnAdRequestListener(AdvertisingEvents.OnAdRequestListener listener)
listener
- The listener to add for the onAdRequest event.public boolean removeOnAdRequestListener(AdvertisingEvents.OnAdRequestListener listener)
listener
- the listener to remove.public void addOnAdStartedListener(AdvertisingEvents.OnAdStartedListener listener)
listener
- The listener to add for the onAdStarted event.public boolean removeOnAdStartedListener(AdvertisingEvents.OnAdStartedListener listener)
listener
- the listener to remove.public void addOnControlsListener(VideoPlayerEvents.OnControlsListener listener)
listener
- The listener for the onControls event.public boolean removeOnControlsListener(VideoPlayerEvents.OnControlsListener listener)
listener
- the listener to remove.public void addOnControlBarVisibilityListener(VideoPlayerEvents.OnControlBarVisibilityListener listener)
listener
- The listener for the onControlBarVisibility event.public boolean removeOnControlBarVisibilityListener(VideoPlayerEvents.OnControlBarVisibilityListener listener)
listener
- the listener to remove.public void addOnBufferChangeListener(VideoPlayerEvents.OnBufferChangeListener listener)
listener
- The listener for the onBufferChange event.public boolean removeOnBufferChangeListener(VideoPlayerEvents.OnBufferChangeListener listener)
listener
- the listener to remove.public void addOnAdCompanionsListener(AdvertisingEvents.OnAdCompanionsListener listener)
listener
- the Listener for the onAdCompanions event.public boolean removeOnAdCompanionsListener(AdvertisingEvents.OnAdCompanionsListener listener)
listener
- the listener to remove.public void addOnRelatedOpenListener(RelatedPluginEvents.OnRelatedOpenListener listener)
listener
- The listener for the onRelatedOpen event.public boolean removeOnRelatedOpenListener(RelatedPluginEvents.OnRelatedOpenListener listener)
listener
- the listener to remove.public void addOnRelatedCloseListener(RelatedPluginEvents.OnRelatedCloseListener listener)
listener
- The listener for the onRelatedClose event.public boolean removeOnRelatedCloseListener(RelatedPluginEvents.OnRelatedCloseListener listener)
listener
- the listener to remove.public void addOnRelatedPlayListener(RelatedPluginEvents.OnRelatedPlayListener listener)
listener
- The listener for the onRelatedPlay event.public boolean removeOnRelatedPlayListener(RelatedPluginEvents.OnRelatedPlayListener listener)
listener
- the listener to remove.public void addOnSharingOpenListener(SharingPluginEvents.OnSharingOpenListener listener)
listener
- The listener for the onSharingOpen event.public boolean removeOnSharingOpenListener(SharingPluginEvents.OnSharingOpenListener listener)
listener
- the listener to remove.public void addOnSharingCloseListener(SharingPluginEvents.OnSharingCloseListener listener)
listener
- The listener for the onSharingClose event.public boolean removeOnSharingCloseListener(SharingPluginEvents.OnSharingCloseListener listener)
listener
- the listener to remove.public void addOnSharingClickListener(SharingPluginEvents.OnSharingClickListener listener)
listener
- The listener for the onSharingClick event.public boolean removeOnSharingClickListener(SharingPluginEvents.OnSharingClickListener listener)
listener
- the listener to remove.public JWFriendlyAdObstructions getJWFriendlyAdObstructions()
JWFriendlyAdObstructions
object associated to this player