Method Summary
| getId ( ) → id |
Get the session identifier. |
|
getParameters
(
|
Get the values of several parameters. |
| getState ( ) → state |
Returns the current state of the media session. |
| getStreamInfo ( ) → info |
Returns information about the stream handled by the session. |
| getType ( ) → type |
Get the session type bitmask. Note that a session can combine the different type constants. |
| getUrl ( ) → url |
Get the source URL of the session. |
| releaseInstance ( ) |
This method releases the resources used by this object and removes all registered observers. Upon return this object will no longer be available and must not be called. Note that this method does not close the associated session. This can only be done by calling ToiMediaPlayer#close . |
|
setParameters
(
|
Set the values of multiple parameters at once. If an exception is raised, no parameters will be set. |
Inherited Methods
|
addEventListener
(
|
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners. |
|
removeEventListener
(
|
This method removes an event listener for a specific event. |
Type Definitions
|
Parameter nems |
|
|
|
|
|
The media session identifier type. |
|
|
Data type used for identifying media session types. This type should be used as a bitmask as defined below. |
|
|
State identifier used to identify the media session state. |
|
|
The status of a parameter. |
|
|
Data type used to identify a stream. |
|
|
|
|
Events
Methods
This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to subscribe to.
listenerToiEventListener The JavaScript function that will receive events.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
Get the values of several parameters.
Parameters:
-
Name Type Description namesArray.<ToiMediaSession.ToiParameterName> A list of parameter names.
Throws:
-
ToiSessionViolationException Raised if the session is not open or is being closed.
Returns:
-
Type: Array.<ToiMediaSession.ToiParameterInfo>
A list of the returned parameters. If a parameter does not exist (is not set), the status of the corresponding parameter is set to ToiMediaSession.STATUS_NO_PARAMETER.
Returns the current state of the media session.
Throws:
-
ToiSessionViolationException If the session no longer exist a session violation exception is raised.
Returns:
-
Type: ToiMediaSession.ToiState
The current session state.
Returns information about the stream handled by the session.
Throws:
-
ToiNoDataException If no information is yet available a no data exception is raised.
ToiSessionViolationException If the session no longer exist a session violation exception is raised.
Returns:
-
Type: ToiMediaSession.ToiStreamInfo
Information about the stream.
Get the session type bitmask. Note that a session can combine the different type constants.
Throws:
-
ToiSessionViolationException If the session no longer exist a session violation exception is raised.
Returns:
-
Type: ToiMediaSession.ToiSessionType
The type of the session, e.g. ToiMediaSession.TYPE_PLAYER. This field is a bitmask.
Get the source URL of the session.
Throws:
-
ToiSessionViolationException If the session no longer exist a session violation exception is raised.
Returns:
-
Type: string
The source URL of the session.
This method releases the resources used by this object and removes all registered observers. Upon return this object will no longer be available and must not be called.
Note that this method does not close the associated session.
This can only be done by calling ToiMediaPlayer#close .
This method removes an event listener for a specific event.
Inherited From:
Parameters:
-
Name Type Description typenumber The event type of the event to remove the listener from.
listenerToiEventListener The JavaScript function that was previously added as an event listener.
Throws:
-
ToiInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener has not previously been added.
Set the values of multiple parameters at once. If an exception is raised, no parameters will be set.
Parameters:
-
Name Type Description parametersArray.<ToiMediaSession.ToiParameter> A list of parameters with name and value.
Throws:
-
ToiInvalidArgumentException Raised if an empty string is used as parameter name or a parameter value exceeds the maximum size.
ToiPermissionDeniedException Raised if attempting to set an internal parameter.
ToiSessionViolationException Raised if the session is not open or is being closed.
Members
The invalid media session identifier definition.
In ToiMediaSession.STATE_CLOSED the media session has been closed and will not be opened again.
In ToiMediaSession.STATE_CONNECTING the media session is trying to connect to a media source. The session will not leave this state until it has received enough data to start playback, producing or recording. It is possible for a session to later return to this state if the source becomes temporarily unavailable, for instance due to network congestion.
In ToiMediaSession.STATE_FAILED the media session has permanently failed.
In ToiMediaSession.STATE_RUNNING the media session is fully connected and has received enough data. Note that this state does not reveal any information about the playback position or pace.
Parameter doesn't exists.
Parameter exists and has value.
Session is used for consuming a stream.
Session is used for playing a stream.
Session is used for producing a stream or local asset.
Session is used for recording a stream.
Data structure with parameter and its status.
Struct fields
| Name | Description |
|---|---|
| parameter | The parameter. Type: ToiMediaSession.ToiParameter |
| status | The parameter status. Type: ToiMediaSession.ToiStatus |
Data structure with information about the stream handled by the session.
Struct fields
| Name | Description |
|---|---|
| programNumber | The selected program number. It can be non-zero even for single-program streams. Type: number |
| transportStreamId | The Transport Stream Id; possible values are 0 - 65535. Type: ToiMediaSession.ToiStreamId |