Click to return to the Streaming     
Web Workshop  |  Streaming & Interactive Media

ITIMEMediaPlayer Interface


Any media player that supports the ITIMEMediaPlayer interface can be used as an HTML+TIME media element. A media player or media player control must implement all of the ITIMEMediaPlayer methods, so that its content can be integrated with the rest of the timing on an HTML+TIME page.

ITIMEMediaPlayer Methods

begin Begins playing media.
clipBegin Specifies the beginning of a clip of continuous media as an offset from the start of the media.
clipEnd Specifies the end of a clip of continuous media as an offset from the start of the media.
cue Currently not implemented. Player implementation should return E_NOTIMPL.
end Stops playing media.
get_CurrentTime Retrieves the current running time of the player in local time.
get_repeat Retrieves the HTML+TIME repeat property.
get_src Retrieves the URL of the media to be played.
init Called after the player control is instantiated. This method should be implemented to perform any initialization the player needs.
pause Pauses the currently playing media.
put_CurrentTime Sets the current running time of the player in local time.
put_repeat Sets the HTML+TIME repeat property.
put_src Sets the URL of the media to be played.
resume Resumes playing media from a paused state.
tick Currently not used. Player implementation should return E_NOTIMPL.

Interface Information

Implementation Media players must implement
Inherits from IDispatch
Header and IDL files DATime.idl
Minimum availability Internet Explorer 5
Minimum operating systems Windows 98

ITIMEMediaPlayer::begin Method


Begins playing media.

Syntax

HRESULT begin();

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME beginElement method

ITIMEMediaPlayer::clipBegin Method


Specifies the beginning of a clip of continuous media as an offset from the start of the media.

Syntax

HRESULT clipBegin( VARIANT varClipBegin );

Parameters

varClipBegin
[in] The amount to clip from the beginning of the media in the format timeID or metric=time_value. See Remarks for more information.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

The clipBegin parameter can be specified in two ways, timeID or metric=time_value. In the timeID format, varClipEnd is a named point in a media stream. For example, Door opens. Named points are supported only by some players, so they are specific to certain MIME types, such as newer ASF files.

In the metric=time_value format, metric specifies the kind of offset and time_value depends on the metric. If no metric is specified, the CLOCK metric is used as the default. The following table lists possible metrics and their time values.

Metric Description Time Value Example
SMPTE Society of Motion Picture and Television Engineers timecodes Hours:Minutes:Seconds:Frames:Subframes
(Frames and subframes are optional.)
smpte=102:33:20
SMPTE-30-DROP SMPTE 30 drop format with 29.97 frames per second Hours:Minutes:Seconds:Frames:Subframes
(Frames and subframes are optional. Frames can have values from 0 through 29.)
smpte-30-drop=06:05:34:14
SMPTE-25 SMPTE 25 drop format Same as SMPTE-30-DROP, except that frames can have values from 0 through 24.
CLOCK Clock time Hours:Minutes:Seconds 00:05:35.3
INDEX An index into media (such as into a character stream). Can only be used on naturally indexed media, such as text streams. Integer index=142

See Also

HTML+TIME clipBegin property

ITIMEMediaPlayer::clipEnd Method


Specifies the end of a clip of continuous media as an offset from the start of the media.

Syntax

HRESULT clipEnd( VARIANT varClipEnd );

Parameters

varClipEnd
[in] The end of the clip, in the format timeID or metric=time_value. See Remarks in clipBegin for more information.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME clipEnd property

ITIMEMediaPlayer::cue Method


Currently not implemented. Player implementation should return E_NOTIMPL.

Syntax

HRESULT cue();

Return Value

Returns E_NOTIMPL.

ITIMEMediaPlayer::end Method


Stops playing media.

Syntax

HRESULT end();

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME endElement method

ITIMEMediaPlayer::get_CurrentTime Method


Retrieves the current running time of the player in local time.

Syntax

HRESULT get_CurrentTime( double *dblCurrentTime );

Parameters

dblCurrentTime
[out] Pointer to the amount of time, in seconds, that the media player has been running. Must be –HUGE_VAL if the player is not playing. Must be +HUGE_VAL if the player has finished playing.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

You must take care that the time provided by the media player is always increasing, even if the media repeats. When the player is not playing, this method must return –HUGE_VAL for the current time. HUGE_VAL is the largest representable double value. When the player has finished playing, this method must return +HUGE_VAL for the current time. During playback, the value that this method returns for the current time must always increase. If a media file repeats playback, the current time must include the total time of the preceding playbacks.

ITIMEMediaPlayer::get_repeat Method


Retrieves the HTML+TIME repeat property.

Syntax

HRESULT get_repeat ( long *ltime );

Parameters

ltime
[out] Pointer to the number of times the player's timeline will loop.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME repeat property

ITIMEMediaPlayer::get_src Method


Retrieves the URL of the media to be played. The URL can contain a relative path.

Syntax

HRESULT get_src( BSTR *pbstrURL );

Parameters

pbstrURL
[out] Pointer to a length-prefixed string that contains the URL.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME src property

ITIMEMediaPlayer::Init Method


Called after the player control is instantiated. This method should be implemented to perform any initialization the player needs, because it is always the first method called when the player property is loaded.

Syntax

HRESULT Init();

Return Value

Returns S_OK if successful, or an error code otherwise.

ITIMEMediaPlayer::pause Method


Pauses the currently playing media.

Syntax

HRESULT pause();

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME pause method

ITIMEMediaPlayer::put_CurrentTime Method


Sets the current running time of the player in local time.

Syntax

HRESULT put_CurrentTime( double dblCurrentTime );

Parameters

dblCurrentTime
[in] The amount of time, in seconds, that the media player has been running. Must be –HUGE_VAL if the player is not playing. Must be +HUGE_VAL if the player has finished playing.

Return Value

Returns S_OK if successful, or an error code otherwise.

Remarks

You must take care that the time provided by the media player is always increasing, even if the media repeats. When the player is not playing, this method must return –HUGE_VAL for the current time. HUGE_VAL is the largest representable double value. When the player has finished playing, this method must return +HUGE_VAL for the current time. During playback, the value that this method returns for the current time must always increase. If a media file repeats playback, the current time must include the total time of the preceding playbacks.

ITIMEMediaPlayer::put_repeat Method


Sets the HTML+TIME repeat property.

Syntax

HRESULT put_repeat( long ltime );

Parameters

ltime
[in] Number of times the player's timeline will loop.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME repeat property

ITIMEMediaPlayer::put_src Method


Sets the URL of the media to be played. The URL can contain a relative path.

Syntax

HRESULT put_src( BSTR bstrURL );

Parameters

bstrURL
[in] Length-prefixed string that contains the URL.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME src property

ITIMEMediaPlayer::resume Method


Resumes playing media from a paused state.

Syntax

HRESULT resume();

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

HTML+TIME method resume

ITIMEMediaPlayer::tick Method


Currently not implemented. Player implementation should return E_NOTIMPL.

Syntax

HRESULT tick();

Return Value

Returns E_NOTIMPL.



Back to topBack to top

Did you find this article useful? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.