Package com.iizix.api.ui
Class UIMediaEvent
- All Implemented Interfaces:
IMessageBox
The UI Media Event is fired when the Media component for Audio or Video issues an event.} enum:
The following events are fired, and are defined in the
invalid @link
{@link @Type- loadstart
- progress
- suspend
- abort
- error
- emptied
- stalled
- loadedmetadata
- loadeddata
- canplay
- canplaythrough
- playing
- waiting
- seeking
- seeked
- ended
- durationchange
- timeupdate
- play
- pause
- ratechange
- resize
- volumechange
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass for a TimeRange.static classClass for a TimeRanges value, used for "buffered" and "played" time ranges.static enumEnum for event type.Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox
IMessageBox.IconField Summary
FieldsModifier and TypeFieldDescriptionstatic final intReady state value (=2): data for the current playback position is available, but not enough data to play next frame/millisecond.static final intReady state value (=4): enough data available to start playing.static final intReady state value (=3): data for the current and at least the next frame/milliseconds is available.static final intReady state value (=1): metadata for the audio/video is ready.static final intRead state value (=0): no information whether or not the audio/video is ready.static final intNetwork state value (=0): audio/video has not yet been initialized.static final intNetwork state value (=1): audio/video is active and has selected a resource, but is not using the network.static final intNetwork state value (=2): downloading data.static final intNetwork state value (=3): no audio/video source found.Fields inherited from interface com.iizix.gyro.IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNINGConstructor Summary
ConstructorsConstructorDescriptionUIMediaEvent(UIMedia source, PropCnr params) Constructs the event for a change without a trigger source.Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if two objects are equal.booleanGets the autoplay flag for the media player.Gets the buffered TimeRanges.Gets the current source URL assigned to the media player.doubleGets the current time of the media player.doubleGets the duration of the media in seconds.Gets the event error in case of API error.intGets the network state of the media player.Gets the played TimeRanges.booleanGets the preload flag for the media player.intGets the ready state of the media player.Gets the UI media component that is the source of the event.getType()Gets the event type.intGets the height of the video.intGets the width of the video.doubleGets the volume between 0 and 1.booleanGets if the media player has controls displayed or not.inthashCode()Returns a hash code value for the object.booleanisMuted()Gets the muted media flag.booleanisPaused()Gets the paused media flag.booleanGets the media seeking flag.protected StringReturns the paramString.Methods inherited from class com.iizix.api.ui.UIBaseEvent
getAppSessionGyro, getClientSessionGyro, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIPanel, getVirtualSpaceMethods inherited from class com.iizix.api.BaseEvent
getAction, getAction2, getActionNull, getActionNull2, getField, getField2, getFieldNull, getFieldNull2, getGroup, getGroup2, getGroupNull, getGroupNull2, getTable, getTable2, getTableNull, getTableNull2, getTime, getVirtualizedVirtualSpace, getVSComponent, getVSComponent2, getVSComponentNull, getVSComponentNull2, messageBox, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.iizix.gyro.IMessageBox
messageBox, messageBox, messageBox
Field Details
HAVE_NOTHING
public static final int HAVE_NOTHINGRead state value (=0): no information whether or not the audio/video is ready.- See Also:
HAVE_METADATA
public static final int HAVE_METADATAReady state value (=1): metadata for the audio/video is ready.- See Also:
HAVE_CURRENT_DATA
public static final int HAVE_CURRENT_DATAReady state value (=2): data for the current playback position is available, but not enough data to play next frame/millisecond.- See Also:
HAVE_FUTURE_DATA
public static final int HAVE_FUTURE_DATAReady state value (=3): data for the current and at least the next frame/milliseconds is available.- See Also:
HAVE_ENOUGH_DATA
public static final int HAVE_ENOUGH_DATAReady state value (=4): enough data available to start playing.- See Also:
NETWORK_EMPTY
public static final int NETWORK_EMPTYNetwork state value (=0): audio/video has not yet been initialized.- See Also:
NETWORK_IDLE
public static final int NETWORK_IDLENetwork state value (=1): audio/video is active and has selected a resource, but is not using the network.- See Also:
NETWORK_LOADING
public static final int NETWORK_LOADINGNetwork state value (=2): downloading data.- See Also:
NETWORK_NO_SOURCE
public static final int NETWORK_NO_SOURCENetwork state value (=3): no audio/video source found.- See Also:
Constructor Details
UIMediaEvent
Constructs the event for a change without a trigger source.- Parameters:
source- The source media UI component.params- The property container with event details.- Throws:
NullPointerException- If the source or params is null.
Method Details
getType
Gets the event type.- Returns:
- The media event type, or
nullif not a listener event, but rather an event induced by the remote player to the server in response to a remote request.
getSource
Gets the UI media component that is the source of the event.getEventError
Gets the event error in case of API error. Do not confuse this with the UI media component 'error' state.- Returns:
- The event error, of
nullfor none.
getVolume
public double getVolume()Gets the volume between 0 and 1.- Returns:
- The volume, or -1d for none.
getDuration
public double getDuration()Gets the duration of the media in seconds.- Returns:
- The duration, or -1d for none.
getCurrentTime
public double getCurrentTime()Gets the current time of the media player.- Returns:
- The current time in seconds, or -1d for none.
isPaused
public boolean isPaused()Gets the paused media flag.- Returns:
- The paused flag.
isMuted
public boolean isMuted()Gets the muted media flag.- Returns:
- The muted flag.
isSeeking
public boolean isSeeking()Gets the media seeking flag.- Returns:
- The seeking flag.
getReadyState
public int getReadyState()Gets the ready state of the media player.The values returned are:
HAVE_NOTHING= 0: no information whether or not the audio/video is ready.HAVE_METADATA= 1: metadata for the audio/video is ready.HAVE_CURRENT_DATA= 2: data for the current playback position is available, but not enough data to play next frame/millisecond.HAVE_FUTURE_DATA= 3: data for the current and at least the next frame/milliseconds is available.HAVE_ENOUGH_DATA= 4: enough data available to start playing.
Typically, this value is changed upon the events
UIMediaEvent.Type:- playing
- waiting
- ended
- emptied
- stalled
- Returns:
- The ready state, or zero for none.
getNetworkState
public int getNetworkState()Gets the network state of the media player.The values returned are:
NETWORK_EMPTY= 0: audio/video has not yet been initialized.NETWORK_IDLE= 1: audio/video is active and has selected a resource, but is not using the network.NETWORK_LOADING= 2: downloading data.NETWORK_NO_SOURCE= 3: no audio/video source found.
Typically, this value is changed upon the events
UIMediaEvent.Type:- playing
- waiting
- ended
- emptied
- stalled
- Returns:
- The network state.
hasControls
public boolean hasControls()Gets if the media player has controls displayed or not.- Returns:
- The controls usage flag.
getAutoPlay
public boolean getAutoPlay()Gets the autoplay flag for the media player.- Returns:
- The autoplay flag.
getPreLoad
public boolean getPreLoad()Gets the preload flag for the media player.- Returns:
- The preload flag.
getCurrentSource
Gets the current source URL assigned to the media player.- Returns:
- The URL or empty string for none.
getVideoWidth
public int getVideoWidth()Gets the width of the video.- Returns:
- The width, or zero for none.
getVideoHeight
public int getVideoHeight()Gets the height of the video.- Returns:
- The height, or zero for none.
getBuffered
Gets the buffered TimeRanges.- Returns:
- The time ranges instance, or
nullfor none.
getPlayed
Gets the played TimeRanges.- Returns:
- The time ranges instance, or
nullfor none.
equals
Checks if two objects are equal.hashCode
public int hashCode()Returns a hash code value for the object.paramString
Returns the paramString.- Overrides:
paramStringin classBaseEvent<UIMedia>