IToiMediaPlayerObserver Interface Reference


Description

This interface is implemented by applications and is used when creating media players. The application will receive asynchronous notifications about media player events.

The application provides the address of the IToiMediaPlayerObserver implementation in the IToiMediaService::CreatePlayerInstance() method.

Note:
Services or applications may choose to inherit the adapter class TToiMediaPlayerObserverAdapter, which provides a default empty implementation of IToiMediaPlayerObserver.

import "IToiMediaPlayerObserver.idl";

List of all members.

Public Member Functions

oneway void OnStateChanged (in IToiMediaPlayerBase::TToiState state, in string reason)
oneway void OnDataAvailable (in boolean status)
oneway void OnPositionChanged (in long position, in long pace)
oneway void OnStreamInfoChanged (in IToiMediaPlayerBase::TToiComponentSequence availableComponents, in IToiMediaPlayerBase::TToiComponentSequence activeComponents, in IToiMediaPlayerBase::TToiComponentSequence changedComponents)
oneway void OnActiveComponentChanged (in IToiMediaPlayerBase::TToiComponentEntry mediaComponent)
oneway void OnParameterChanged (in string name)
oneway void OnTimeshiftStateChanged (in IToiMediaPlayerBase::TToiTimeshiftState state, in string reason)
oneway void OnCapabilitiesChanged (in long capabilityMask)

Member Function Documentation

oneway void IToiMediaPlayerObserver::OnActiveComponentChanged ( in IToiMediaPlayerBase::TToiComponentEntry  mediaComponent  ) 

Tells the observer that a new media component has been selected, e.g. a new audio track has been activated.

Deprecated:
OnStreamInfoChanged provides the same information.
Parameters:
mediaComponent The newly activated media component.
oneway void IToiMediaPlayerObserver::OnCapabilitiesChanged ( in long  capabilityMask  ) 

Tells the observer that the media player capabilities has changed. This may happen when time shifting is started and stopped.

Parameters:
capabilityMask The new capability mask.
See also:
IToiMediaPlayer::GetCapabilities().
oneway void IToiMediaPlayerObserver::OnDataAvailable ( in boolean  status  ) 

Tells the observer when the status of stream data availability changes, e.g. when there is not enough data available for playback.

Parameters:
status The availability of stream data; true if stream data is received at a rate acceptable for playback, and false otherwise.
oneway void IToiMediaPlayerObserver::OnParameterChanged ( in string  name  ) 

Tells the observer that the value has changed for one of the parameters that the observer is subscribing to.

Parameters:
name The name of the changed parameter.
See also:
IToiMediaPlayerBase::SubscribeParameter()
oneway void IToiMediaPlayerObserver::OnPositionChanged ( in long  position,
in long  pace 
)

Gives the observer an up-to-date snapshot of the position in the stream, together with information about how the position changes. This event may be emitted at any time within a session, but generally it is emitted every time the pace changes and in regular intervals inbetween, provided that the pace is not zero.

Parameters:
position The "current position" in milliseconds. If asset start is 0, relative position from start is equal to "current position". Otherwise, relative position from start is "current position" - "asset start".
pace The pace at which the position changes, given as a multiplier of normal playback times 1000. If the stream is paused the pace is zero. When the stream is played at normal speed the pace is 1000. In IToiMediaPlayerBase::STATE_FASTFORWARDING the pace is generally above 1000, and in IToiMediaPlayerBase::STATE_REWINDING generally below -1000. For example, if the stream is rewinded at a pace three times normal playback, the pace is -3000.
oneway void IToiMediaPlayerObserver::OnStateChanged ( in IToiMediaPlayerBase::TToiState  state,
in string  reason 
)

A call to this function tells the observer that the media player state has changed. The application is not notified this way about implicit state changes triggered by commands from the application itself. For example, assume the player is in IToiMediaPlayerBase::STATE_PLAYING. If the application calls IToiMediaPlayer::Play() with a pace greater than 1000 and the function returns without error, the player state has changed implicitly to IToiMediaPlayerBase::STATE_FASTFORWARDING but the application will not receive a call to OnStateChanged() for that particular state transition. However, other applications that have registered observers to the status interface will, assuming this particular player is in focus, receive calls to OnStateChanged() with state IToiMediaPlayerBase::STATE_FASTFORWARDING and reason IToiMediaService::REASON_COMMAND_FASTFORWARD.

Note that there is no timing constraint on these messages, and they may arrive late in certain situations. For example, the application may receive a call to this function about a state transition after the application has successfully called IToiMediaPlayer::Close() and thereby ended the session. This implies that the application should take calls to this function as indications to state transitions that has in fact happened, but it cannot say for certain when these state transitions occured.

Parameters:
state The new state.
reason The reason for the state change.
oneway void IToiMediaPlayerObserver::OnStreamInfoChanged ( in IToiMediaPlayerBase::TToiComponentSequence  availableComponents,
in IToiMediaPlayerBase::TToiComponentSequence  activeComponents,
in IToiMediaPlayerBase::TToiComponentSequence  changedComponents 
)

Tells the observer that the media player has updated the available or active stream components or that the information on the stream components has changed. Information on the stream is available through the IToiMediaPlayerBase::GetStreamInfo() function. Information on the different type of stream components is available through the respecitve info functions in IToiMediaPlayerBase.

Parameters:
availableComponents The media components currently available.
activeComponents The currently active media components.
changedComponents The media components that have changed.
See also:
IToiMediaPlayerBase::GetStreamInfo()
IToiMediaPlayerBase::GetVideoStreamInfo()
IToiMediaPlayerBase::GetAudioStreamInfo()
IToiMediaPlayerBase::GetSubtitleStreamInfo()
IToiMediaPlayerBase::GetTeletextStreamInfo()
oneway void IToiMediaPlayerObserver::OnTimeshiftStateChanged ( in IToiMediaPlayerBase::TToiTimeshiftState  state,
in string  reason 
)

Tells the observer that current timeshift state has changed.

Parameters:
state The new state.
reason The reason for the state change.