ToiMediaService is the main interface of the Media Service. It is used by applications to create media consumers, players and recorders. Each player, recorder and consumer generates a media session which can be accessed by any application through the (C++) OpenSession() function. This allows other applications than the actual owner to get stream information, extract stream data, set decryption keys etc.
import "ToiMediaService.idl";
Public Member Functions | |
ToiMediaPlayer | createPlayerInstance () raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException) |
ToiMediaPlayer | createPipPlayerInstance () raises (TToiInvalidArgumentException, TToiOperationNotSupportedException, TToiPermissionDeniedException) |
ToiMediaRecorder | createRecorderInstance () raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiOperationNotSupportedException) |
void | addEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException) |
void | removeEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException) |
Public Attributes | |
const string | REASON_UNKNOWN = "Unknown" |
const string | REASON_COMMAND_OPEN = "CommandOpen" |
const string | REASON_COMMAND_CLOSE = "CommandClose" |
const string | REASON_COMMAND_PAUSE = "CommandPause" |
const string | REASON_COMMAND_PLAY = "CommandPlay" |
const string | REASON_COMMAND_FASTFORWARD = "CommandFastForward" |
const string | REASON_COMMAND_REWIND = "CommandRewind" |
const string | REASON_COMMAND_PLAYFROMPOSITION = "CommandPlayFromPosition" |
const string | REASON_COMMAND_RECORD = "CommandRecord" |
const string | REASON_COMMAND_CONSUME = "CommandConsume" |
const string | REASON_POSITION_END = "PositionEnd" |
const string | REASON_POSITION_START = "PositionStart" |
const string | REASON_TIMESHIFT_BUFFER_OPEN = "TimeshiftBufferOpen" |
const string | REASON_TIMESHIFT_BUFFER_FULL = "TimeshiftBufferFull" |
const string | REASON_TIMESHIFT_BUFFER_DISCARDED = "TimeshiftBufferDiscarded" |
const string | REASON_ERROR_COMMAND_NOT_SUPPORTED = "ErrorCommandNotSupported" |
const string | REASON_ERROR_STREAM_CLIENT = "ErrorStreamClient" |
const string | REASON_ERROR_CONNECTION_FAILED = "ErrorConnectionFailed" |
const string | REASON_ERROR_INVALID_PRECONDITION = "ErrorInvalidPrecondition" |
const string | REASON_ERROR_PERMISSION_DENIED = "ErrorPermissionDenied" |
const string | REASON_ERROR_INVALID_DISKASSET = "ErrorInvalidDiskasset" |
const string | REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION = "ErrorUnsupportedDiskAssetVersion" |
const string | REASON_ERROR_DISK_FULL = "ErrorStorageFull" |
const string | REASON_ERROR_LOWLEVEL_IO_FAILURE = "ErrorLowlevelIOFailure" |
const string | REASON_ERROR_POSITION_INVALID = "ErrorPositionInvalid" |
const string | REASON_ERROR_DISK_OVERHEATED = "ErrorStorageOverheated" |
const string | REASON_ERROR_HOST_UNREACHABLE = "ErrorHostUnreachable" |
const string | REASON_ERROR_UNEXISTING_RESOURCE = "ErrorUnexistingResource" |
const string | REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL = "ErrorNoExternalInputSignal" |
Events | |
const long | ON_SESSION_STATE_CHANGED = 1600 |
const long | ON_SESSION_STREAM_INFO_CHANGED = 1601 |
Public Types | |
typedef sequence < ToiMediaServiceSessionInfo > | TToiSessionSequence |
typedef sequence< ToiMediaServiceSessionInfo > ToiMediaService::TToiSessionSequence |
Sequence of sessions.
void ToiEventTarget::addEventListener | ( | in long | type, | |
in ToiEventListener | listener | |||
) | raises (TToiInvalidArgumentException) [inherited] |
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.
type | The event type of the event to subscribe to. | |
listener | The JavaScript function that will receive events. |
TInvalidArgumentException | 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. |
ToiMediaPlayer ToiMediaService::createPipPlayerInstance | ( | ) | raises (TToiInvalidArgumentException, TToiOperationNotSupportedException, TToiPermissionDeniedException) |
This function creates a new Picture in Picture media player and associates it with the calling application.
When the application no longer needs the media player, it must release it by calling ToiMediaPlayer::releaseInstance(). This will return the underlying resources to the system.
IToiMediaPlayer | The address to the ToiMediaPlayer instance. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. | |
TToiOperationNotSupportedException | Raised if a new player instance cannot be created. | |
TToiPermissionDeniedException | Raised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications. |
ToiMediaPlayer ToiMediaService::createPlayerInstance | ( | ) | raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiPermissionDeniedException) |
This function creates a new media player and associates it with the calling application.
When the application no longer needs the media player, it must release it by calling ToiMediaPlayer::releaseInstance(). This will return the underlying resources to the system.
IToiMediaPlayer | The address to the ToiMediaPlayer instance. |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. | |
TToiNotEnoughResourcesException | Raised if a new player instance cannot be created due to lack of system resources. | |
TToiPermissionDeniedException | Raised if the calling application is not allowed to create instances of the media player. This restriction applies to popup applications. |
ToiMediaRecorder ToiMediaService::createRecorderInstance | ( | ) | raises (TToiInvalidArgumentException, TToiNotEnoughResourcesException, TToiOperationNotSupportedException) |
This function creates a new media recorder and associates it with the calling application.
When the application no longer needs the media recorder, it must release it by calling ToiMediaRecorder::releaseInstance(). This will return the underlying resources to the system.
IToiMediaRecorder | The address to the ToiMediaRecorder instance |
TToiInvalidArgumentException | Raised if the specified application identifier is invalid. | |
TToiNotEnoughResourcesException | Raised if a new recorder instance cannot be created due to lack of system resources. | |
TToiOperationNotSupportedException | Raised if recording is not supported on this system. |
void ToiEventTarget::removeEventListener | ( | in long | type, | |
in ToiEventListener | listener | |||
) | raises (TToiInvalidArgumentException) [inherited] |
This method removes an event listener for a specific event.
type | The event type of the event to remove the listener from. | |
listener | The JavaScript function that was previously added as an event listener. |
TInvalidArgumentException | 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 had not previously been added. |
const long ToiMediaService::ON_SESSION_STATE_CHANGED = 1600 |
This is an Event identifier for ToiMediaSessionStateChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STATE_CHANGED.
const long ToiMediaService::ON_SESSION_STREAM_INFO_CHANGED = 1601 |
This is an Event identifier for ToiMediaSessionStreamInfoChangedEvent.
This constant can also be accessed from toi.consts.ToiMediaService.ON_SESSION_STREAM_INFO_CHANGED.
const string ToiMediaService::REASON_COMMAND_CLOSE = "CommandClose" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_CLOSE.
const string ToiMediaService::REASON_COMMAND_CONSUME = "CommandConsume" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_CONSUME.
const string ToiMediaService::REASON_COMMAND_FASTFORWARD = "CommandFastForward" |
State change caused by a fast forward command
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_FASTFORWARD.
const string ToiMediaService::REASON_COMMAND_OPEN = "CommandOpen" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_OPEN.
const string ToiMediaService::REASON_COMMAND_PAUSE = "CommandPause" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PAUSE.
const string ToiMediaService::REASON_COMMAND_PLAY = "CommandPlay" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PLAY.
const string ToiMediaService::REASON_COMMAND_PLAYFROMPOSITION = "CommandPlayFromPosition" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_PLAYFROMPOSITION.
const string ToiMediaService::REASON_COMMAND_RECORD = "CommandRecord" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_RECORD.
const string ToiMediaService::REASON_COMMAND_REWIND = "CommandRewind" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_COMMAND_REWIND.
const string ToiMediaService::REASON_ERROR_COMMAND_NOT_SUPPORTED = "ErrorCommandNotSupported" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_COMMAND_NOT_SUPPORTED.
const string ToiMediaService::REASON_ERROR_CONNECTION_FAILED = "ErrorConnectionFailed" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_CONNECTION_FAILED.
const string ToiMediaService::REASON_ERROR_DISK_FULL = "ErrorStorageFull" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_DISK_FULL.
const string ToiMediaService::REASON_ERROR_DISK_OVERHEATED = "ErrorStorageOverheated" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_DISK_OVERHEATED.
const string ToiMediaService::REASON_ERROR_HOST_UNREACHABLE = "ErrorHostUnreachable" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_HOST_UNREACHABLE.
const string ToiMediaService::REASON_ERROR_INVALID_DISKASSET = "ErrorInvalidDiskasset" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_INVALID_DISKASSET.
const string ToiMediaService::REASON_ERROR_INVALID_PRECONDITION = "ErrorInvalidPrecondition" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_INVALID_PRECONDITION.
const string ToiMediaService::REASON_ERROR_LOWLEVEL_IO_FAILURE = "ErrorLowlevelIOFailure" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_LOWLEVEL_IO_FAILURE.
const string ToiMediaService::REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL = "ErrorNoExternalInputSignal" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_NO_EXTERNAL_INPUT_SIGNAL.
const string ToiMediaService::REASON_ERROR_PERMISSION_DENIED = "ErrorPermissionDenied" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_PERMISSION_DENIED.
const string ToiMediaService::REASON_ERROR_POSITION_INVALID = "ErrorPositionInvalid" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_POSITION_INVALID.
const string ToiMediaService::REASON_ERROR_STREAM_CLIENT = "ErrorStreamClient" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_STREAM_CLIENT.
const string ToiMediaService::REASON_ERROR_UNEXISTING_RESOURCE = "ErrorUnexistingResource" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_UNEXISTING_RESOURCE.
const string ToiMediaService::REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION = "ErrorUnsupportedDiskAssetVersion" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_ERROR_UNSUPPORTED_DISKASSET_VERSION.
const string ToiMediaService::REASON_POSITION_END = "PositionEnd" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_POSITION_END.
const string ToiMediaService::REASON_POSITION_START = "PositionStart" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_POSITION_START.
const string ToiMediaService::REASON_TIMESHIFT_BUFFER_DISCARDED = "TimeshiftBufferDiscarded" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_DISCARDED.
const string ToiMediaService::REASON_TIMESHIFT_BUFFER_FULL = "TimeshiftBufferFull" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_FULL.
const string ToiMediaService::REASON_TIMESHIFT_BUFFER_OPEN = "TimeshiftBufferOpen" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_TIMESHIFT_BUFFER_OPEN.
const string ToiMediaService::REASON_UNKNOWN = "Unknown" |
This constant can also be accessed from toi.consts.ToiMediaService.REASON_UNKNOWN.