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.
Member Function Documentation
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. |
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. |
Tells the observer that current timeshift state has changed.
- Parameters:
-
| state | The new state. |
| reason | The reason for the state change. |