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.
The following events are fired, and are defined in the {@link @Type} enum:
- 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
Modifier and TypeClassDescriptionstatic class
Class for a TimeRange.static class
Class for a TimeRanges value, used for "buffered" and "played" time ranges.static enum
Enum for event type.Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox
IMessageBox.Icon
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Ready state value (=2): data for the current playback position is available, but not enough data to play next frame/millisecond.static final int
Ready state value (=4): enough data available to start playing.static final int
Ready state value (=3): data for the current and at least the next frame/milliseconds is available.static final int
Ready state value (=1): metadata for the audio/video is ready.static final int
Read state value (=0): no information whether or not the audio/video is ready.static final int
Network state value (=0): audio/video has not yet been initialized.static final int
Network state value (=1): audio/video is active and has selected a resource, but is not using the network.static final int
Network state value (=2): downloading data.static final int
Network 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_WARNING
Constructor Summary
ConstructorDescriptionUIMediaEvent
(UIMedia source, PropCnr params) Constructs the event for a change without a trigger source.Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if two objects are equal.boolean
Gets the autoplay flag for the media player.Gets the buffered TimeRanges.Gets the current source URL assigned to the media player.double
Gets the current time of the media player.double
Gets the duration of the media in seconds.Gets the event error in case of API error.int
Gets the network state of the media player.Gets the played TimeRanges.boolean
Gets the preload flag for the media player.int
Gets the ready state of the media player.Gets the UI media component that is the source of the event.getType()
Gets the event type.int
Gets the height of the video.int
Gets the width of the video.double
Gets the volume between 0 and 1.boolean
Gets if the media player has controls displayed or not.int
hashCode()
Returns a hash code value for the object.boolean
isMuted()
Gets the muted media flag.boolean
isPaused()
Gets the paused media flag.boolean
Gets the media seeking flag.protected String
Returns the paramString.Methods inherited from class com.iizix.api.ui.UIBaseEvent
getAppSessionGyro, getClientSessionGyro, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIPanel, getVirtualSpace
Methods 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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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
null
if 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
null
for 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
null
for none.
getPlayed
Gets the played TimeRanges.- Returns:
- The time ranges instance, or
null
for 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:
paramString
in classBaseEvent<UIMedia>