Media.getMarkerTime method
The getMarkerTime method retrieves the time of the marker at the specified index.
Syntax
retVal = Media.getMarkerTime(
markerNum
)
Parameters
-
markerNum [in]
-
Number (long) specifying the marker index.
Return value
This method returns a Number (double) specifying the location of the marker in seconds from the beginning of the clip.
Remarks
This method returns NULL if the specified marker does not exist.
Some digital media items do not contain markers. Use markerCount to find out how many markers are in the current clip.
Marker index numbers start at 1.
To use this method, read access to the library is required. For more information, see Library Access.
Examples
The following JScript example uses Media.getMarkerTime to fill an HTML TEXTAREA element named MTIMES with the location of each marker. The Player object was created with ID = "Player".
// Get the number of markers in the current media item.
var mcount = Player.currentMedia.markerCount;
// Verify that at least one marker exists in the current media item.
if (mcount > 0){
// Loop through the marker list.
for (var i = 1;i < mcount + 1; i++){
// Print the message to the text area.
MTIMES.value += "Marker number " + i + " occurs at ";
MTIMES.value += Player.currentMedia.getMarkerTime(i);
MTIMES.value += " second(s).";
MTIMES.value += "\n";
}
Requirements
Version |
Windows Media Player version 7.0 or later. |
DLL |
|