public class

PlayerView

extends FrameLayout
implements SurfaceHolder.Callback View.OnAttachStateChangeListener View.OnLayoutChangeListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.amazonaws.ivs.player.PlayerView

Class Overview

View for displaying the content of a Player instance. When attached to an activity window creates a Player instance with basic controls for live and vod playback. PlayerView manages the player instance and attaches it to a surface, using SurfaceView for display. THe view will also managed requesting audio focus (defaulting to AUDIOFOCUS_GAIN_TRANSIENT based on the playing state of the content.

Summary

[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PlayerView(Context context)
Creates a new PlayerView with the given context.
PlayerView(Context context, AttributeSet attrs)
Creates a new PlayerView with the given context.
PlayerView(Context context, AttributeSet attrs, int defStyleAttr)
Creates a new PlayerView with the given context.
Public Methods
boolean getCaptionsEnabled()
PlayerControlView getControls()
boolean getControlsEnabled()
Uri getMediaUri()
Player getPlayer()
int getVolumeControlStream()
boolean onKeyDown(int keyCode, KeyEvent event)
void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)
boolean onTouchEvent(MotionEvent event)
void onViewAttachedToWindow(View v)
void onViewDetachedFromWindow(View v)
void setCaptionsEnabled(boolean enabled)
Sets captions display enabled
void setControlsEnabled(boolean enabled)
Enables or disables the media controls overlayed on the video view
void setMediaUri(Uri mediaUri)
Sets the default video media uri for playback.
void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
void surfaceCreated(SurfaceHolder holder)
void surfaceDestroyed(SurfaceHolder holder)
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.SurfaceHolder.Callback
From interface android.view.View.OnAttachStateChangeListener
From interface android.view.View.OnLayoutChangeListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public PlayerView (Context context)

Creates a new PlayerView with the given context.

Parameters
context activity context to use

public PlayerView (Context context, AttributeSet attrs)

Creates a new PlayerView with the given context.

Parameters
context activity context to use
attrs attributes

public PlayerView (Context context, AttributeSet attrs, int defStyleAttr)

Creates a new PlayerView with the given context.

Parameters
context activity context to use
attrs attributes
defStyleAttr style attributes

Public Methods

public boolean getCaptionsEnabled ()

Returns
  • current closed captions setting, true if captions will be displayed, false otherwise the default value is false.

public PlayerControlView getControls ()

Returns

public boolean getControlsEnabled ()

Returns
  • True if the controls will be automatically displayed when touched, false otherwise. The default value is true.

public Uri getMediaUri ()

Returns
  • gets the currently assigned playback URI or null if not set.

public Player getPlayer ()

Returns
  • the Player instance used for this view. Note this view will not explicitly call release(). The using application must call this method when the Activity holding the view is destroyed to ensure proper release of resources.

public int getVolumeControlStream ()

Returns

public boolean onKeyDown (int keyCode, KeyEvent event)

public void onLayoutChange (View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)

public boolean onTouchEvent (MotionEvent event)

public void onViewAttachedToWindow (View v)

public void onViewDetachedFromWindow (View v)

public void setCaptionsEnabled (boolean enabled)

Sets captions display enabled

Parameters
enabled true to enable, false otherwise

public void setControlsEnabled (boolean enabled)

Enables or disables the media controls overlayed on the video view

Parameters
enabled true to enable automatic display of the controls, false otherwise

public void setMediaUri (Uri mediaUri)

Sets the default video media uri for playback. This is the default URI thad is loaded when the PlayerView is attached to a window. URIs can be assigned outside of this api through getPlayer().load()

Parameters
mediaUri uri to load

public void surfaceChanged (SurfaceHolder holder, int format, int width, int height)

public void surfaceCreated (SurfaceHolder holder)

public void surfaceDestroyed (SurfaceHolder holder)