Because of my own needs, I collected and sorted out relevant information.
The players we saw on the webpage were nothing more than WMP/RealOne/Macromedia Flash Player. The others were just different panels or added other controls. For those installed on the computer, Some players are also integrated encoders and decoders, and their core encoding and decoding technologies are the same. For example: the most popular windows media streams on the Internet (asf, wma, wmv formats...), Real streams (rm, rmvb...), and MPEG series encoding formats (MP4/MP3 formats...)
WMP control ActiveX decoder control has been added, which can not only play music, but also Flash and other video files.
Copy content to clipboard code:
<object title="dvubb" align="middle" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" class="object" id="MediaPlayer" width="480" height="360">
<param name="AUTOSTART" value="false"/>
<param name="ShowStatusBar" value="-1"/>
<param name="Filename" value="Your video address"/>
<embed title="dvubb" type="application/x-oleobject" codebase=" http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 " flename ="mp" src="Your video address" width="480" height="360" autoplay="false"></embed>
</object>
The player above is an old-fashioned one, version 6.4! The new player appeared after WMP9.0, which means that the new player code can only be used normally if a player 9.0 or above is installed. Compared with the previous It's much simpler:
Copy content to clipboard code:
<object height="64" width="260" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" align="center" border="0"><param name="AutoStart" value="0" ><param name="Balance" value="0"><param name="enabled" value="-1"><param name="EnableContextMenu" value="-1"><param name="url" value ="{1}"><param name="PlayCount" value="1"><param name="rate" value="1"><param name="currentPosition" value="0"><param name= "currentMarker" value="0"><param name="defaultFrame" value=""><param name="invokeURLs" value="0"><param name="baseURL" value=""><param name= "stretchToFit" value="0"><param name="volume" value="100"><param name="mute" value="0"><param name="uiMode" value="mini"><param name="windowlessVideo" value="-1"><param name="fullScreen" value="0"><param name="enableErrorDialogs" value="-1"><param name="SAMIStyle" value><param name="SAMILang" value><param name="SAMIFilename" value><param name="captioningID" value></object>
Real series player copy content to clipboard code:
<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" width="500" height="40" id="RealMoviePlayer" border="0"><param name="_ExtentX" value="13229" ><param name="_ExtentY" value="1058"><param name="AUTOSTART" value="0"><param name="SHUFFLE" value="0"><param name="PREFETCH" value=" 0"><param name="NOLABELS" value="0"><param name="CONTROLS" value="controlpanel"><param name="CONSOLE" value="_master"><param name="LOOP" value ="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR " value="#000000"><param name="SRC" value="REAL media file address"></object>
Flash player copy content to clipboard code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0, 0 " width="550" height="400"><param name="allowScriptAccess" value="sameDomain"><param name="movie" value="flash animation address"><param name="quality" value= "high"><param name="bgcolor" value="#ffffff"><embed src="flash animation address" quality="high" bgcolor="#ffffff" width="550" height="400" allowScriptAccess= "sameDomain" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer " /></object>
Universal automatic web player code copies content to the clipboard code:
<embed src="Media file URL address" width=400 height=300 type="audio/mpeg" loop="-1" autostart="false" volume="0" style=""></embed>
WIDTH represents the width of the player, HEIGHT represents the height, and the following values can be adjusted according to your own preferences;
AUTOSTART="TRUE" or autoplay="true" Here TRUE represents automatic playback, and if changed to FALSE, it represents manual playback;
LOOP="TRUE" represents loop playback;
style="" represents style, the parameters can refer to CSS filters and can be omitted;
type can be omitted;
other details can be found in EMBED's code; I won't go into detail about Flash's code! Because there are some online Flash MP3 players but there are often some problems. I originally wanted to add a FLASH MP3 player button to the forum but gave up because the effect was too poor and used universal code!
There is no need to specify the player type. The system will call the default player to play automatically. I will introduce it in detail later. Just add object to the outermost part of the code to specify the player!
Quote:
(Default 0 means no, -1 or 1 means yes)
<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="MediaPlayer1" width="286" height="225">
<param name="AudioStream" value="/-1">
<param name="AutoSize" value="-1">
<!--Whether to automatically adjust the playback size-->
<param name="AutoStart" value="-1">
<!--Whether to play automatically-->
<param name="AnimationAtStart" value="-1">
<param name="AllowScan" value="-1">
<param name="AllowChangeDisplaySize" value="-1">
<param name="AutoRewind" value="0">
<param name="Balance" value="0">
<!--Left and right channel balance, leftmost-9640, rightmost 9640-->
<param name="BaseURL" value>
<param name="BufferingTime" value="15">
<!--Buffering time-->
<param name="CaptioningID" value>
<param name="ClickToPlay" value="-1">
<param name="CursorType" value="0">
<param name="CurrentPosition" value="0">
<!--The current playback progress -1 means unchanged, 0 means the starting unit is seconds, for example, 10 means starting playback from the 10th second, the value must be -1.0 or greater than or equal to 0-->
<param name="CurrentMarker" value="0">
<param name="DefaultFrame" value>
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="16777215">
<param name="DisplayMode" value="0">
<param name="DisplaySize" value="0">
<!--Video 1-50%, 0-100%, 2-200%, 3-full screen, other values are treated as 0, and decimals are rounded off and then processed as before -->
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="-1">
<!-Whether to use right-click pop-up menu control-->
<param name="EnablePositionControls" value="-1">
<param name="EnableFullScreenControls" value="-1">
<param name="EnableTracker" value="-1">
<!--Whether it is allowed to pull the playback progress bar to play anywhere-->
<param name="Filename" value="01.wma" valuetype="ref">
<!--The file address to be played-->
<param name="InvokeURLs" value="-1">
<param name="Language" value="-1">
<param name="Mute" value="0">
<!--Whether to mute-->
<param name="PlayCount" value="10">
<!--Number of repeat playbacks, 0 means always repeat-->
<param name="PreviewMode" value="-1">
<param name="Rate" value="1">
<!--Playback rate control, 1 is normal, decimals are allowed-->
<param name="SAMIStyle" value>
<!--SAMI style-->
<param name="SAMILang" value>
<!--SAMI Language-->
<param name="SAMIFilename" value>
<!--Subtitle ID-->
<param name="SelectionStart" value="-1">
<param name="SelectionEnd" value="-1">
<param name="SendOpenStateChangeEvents" value="-1">
<param name="SendWarningEvents" value="-1">
<param name="SendErrorEvents" value="-1">
<param name="SendKeyboardEvents" value="0">
<param name="SendMouseClickEvents" value="0">
<param name="SendMouseMoveEvents" value="0">
<param name="SendPlayStateChangeEvents" value="-1">
<param name="ShowCaptioning" value="0">
<!--Whether to display subtitles, it is a piece of black, there will be a large piece of black below, generally not displayed-->
<param name="ShowControls" value="-1">
<!--Whether to display controls, such as play, stop, pause-->
<param name="ShowAudioControls" value="-1">
<!--Whether to display the volume control-->
<param name="ShowDisplay" value="0">
<!--Display program information, such as copyright, etc.-->
<param name="ShowGotoBar" value="0">
<!--Whether to enable context menu-->
<param name="ShowPositionControls" value="-1">
<!--Whether to display the forward, backward and list, if displayed, it will generally be gray and uncontrollable-->
<param name="ShowStatusBar" value="-1">
<!--Current playback information, showing whether it is playing, the total playback time and the current playback time-->
<param name="ShowTracker" value="-1">
<!--Whether to display the current playback tracking bar, that is, the current playback progress bar-->
<param name="TransparentAtStart" value="-1">
<param name="VideoBorderWidth" value="0">
<!--If the width of the display part is smaller than the video width, the minimum is the video width, or it is increased to the specified value, and the height is automatically increased. This change only changes the size of the surrounding black frame, and does not change the video size-- >
<param name="VideoBorderColor" value="0">
<!--Display the color of the black frame, which is an RGB value, for example, ffff00 is yellow-->
<param name="VideoBorder3D" value="0">
<param name="Volume" value="0">
<!--Volume size, negative value means the decrease of the current volume, the value will automatically take the absolute value, the maximum is 0, the minimum is -9640-->
<param name="WindowlessVideo" value="0">
<!--If it is 0, full screen can be allowed, otherwise it can only be viewed in the window-->
</object>
The player above is an old-fashioned one, version 6.4! The new player appeared after MediaPlayer 9.0, which means that it can only be used normally if 9.0 or above is installed.
The following is an analysis of the controls of WMP9. Other playback parameters are basically similar. Please refer to the following!
Quote:
<object id="player" height="64" width="260" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param NAME="AutoStart" VALUE="-1">
<!--Whether to play automatically-- www.devdao.com >
<param NAME="Balance" VALUE="0">
<!--Adjust the left and right channel balance, the same as the old player code above-->
<param name="enabled" value="-1">
<!--Whether the player can be controlled manually-->
<param NAME="EnableContextMenu" VALUE="-1">
<!--Whether to enable context menu-->
<param NAME="url" value="/blog/1.wma">
<!--The file address to be played-->
<param NAME="PlayCount" VALUE="1">
<!--Play count control, which is an integer-->
<param name="rate" value="1">
<!--Playback rate control, 1 is normal, decimals are allowed, 1.0-2.0-->
<param name="currentPosition" value="0">
<!--Control settings: current position-->
<param name="currentMarker" value="0">
<!--Control settings: current mark-->
<param name="defaultFrame" value="">
<!--Show default frame-->
<param name="invokeURLs" value="0">
<!--Script command settings: whether to call URL-->
<param name="baseURL" value="">
<!--Script command settings: called URL-->
<param name="stretchToFit" value="0">
<!--Whether to stretch proportionally-->
<param name="volume" value="50">
<!--Default sound size is 0%-100%, 50 is 50%-->
<param name="mute" value="0">
<!--Whether to mute-->
<param name="uiMode" value="mini">
<!--Player display mode: Full displays all; mini is the most simplified; None does not display playback controls, only displays the video window; invisible does not display all -->
<param name="windowlessVideo" value="0">
<!--If it is 0, full screen can be allowed, otherwise it can only be viewed in the window-->
<param name="fullScreen" value="0">
<!--Whether to automatically full screen when starting playback-->
<param name="enableErrorDialogs" value="-1">
<!--Whether to enable error prompt reporting-->
<param name="SAMIStyle" value>
<!--SAMI style-->
<param name="SAMILang" value>
<!--SAMI Language-->
<param name="SAMIFilename" value>
<!--Subtitle ID-->
</object>
Real Player web player parameter meaning reference:
Parameter: autostart Attribute: True or False Function: Specify whether to automatically play the specified source file Parameter: backgroundcolor Attribute: Any hexadecimal value starting with the symbol "#" or any predefined color Function: Specify the background of the image window Color parameter: center Attribute: True or False Function: Specify the fragment to be played using the initial encoding size and in the center of the image window.
Parameter: classid Attribute: "clsid: CFCDAA03-8BE4-1lcf-B84B0020AFBBCCFA:** Function: Used to specify the unique string identifier of the ActiveX control, which can identify the embedded RealPalyer player.
Parameter: console Attribute: any string Function: Various RealPlayer controls can be gathered on the web page, so that they can be used interactively or remain independent, and do not affect each other Parameter: controls Attribute: ImageWindow, All, ControlPanel, PlavButton, PlayOnlyButton, PauseButton, StopButton, FFCtrl, RWCtrl, MuteCtrl, MuteVolume, VolumeSlider, PositionSlider, TACCtrl, HomeCtrl, InfoVolumePanel, InfoPanel, StatusBar, StatusField, PositionField Function: Allows you to specify which controls are visible.
Parameter: height Attribute: any integer value Function: Specify the height of the RealPlayer element, unit: pixel Parameter: id Attribute: any string Function: Specify a name for the RealPlayer element in the tag.
Parameter: imagestatus Attribute: True or False Function: Specify whether to display status information in the image window. The default value is true
Parameter: loop Attribute: True or False Function: Allows you to specify whether the fragment loops infinitely Parameter: maintainaspect Attribute: True or False Function: By default, RealPlayer stretches all fragments to fill the entire image window.
Parameters: name Attribute: any string Function: Specify a name for the RealPlayer element in the tag (use id in the tag)
Parameter: nojava Attribute: True or False Function: Avoid starting the Java virtual machine Parameter: nolabels Attribute: True or False Function: You can suppress the display of titles or copyright information (when realplayer5.0 or above, it is garbage...)
Parameter: nologo Attribute: True or False Function: Avoid displaying in the image window when RealPlayer starts Parameter: numloop Attribute: Any integer value Function: Allows you to specify the number of file loops, no parameter loop is required
Parameter: prefetch Attribute: True or False Function: Specifies whether RealPlayer can obtain stream description information before playing. The default value is False
Parameter: region Attribute: any string Function: Used with SMIL. Allows you to specify that HTML should be used instead of SMIL
Parameters: scriptcallbacks Attributes: Comma-separated list Function: Specify the browser's callback monitoring (so advanced stuff!)
Parameter: shuffle Attribute: True or False Function: Used with multi-file ram files or SMIL files. Allows RealPlayer to randomly play files in the list Parameters: src Attribute: Any legal relative or complete URL Function: Specify the address of the file to be played or the source file Parameter: type Attribute: String Function: Specify the MIME type for the embedded plug-in Parameters: width attribute: any integer value Role: specifies the width of the RealPlayer element
Some functions, methods and processes of RealPlayer. These are all the functions and methods of Real Player ActiveX Control Library (Version 1.0). If you are interested, you can study them.
Quote:
function GetSource: WideString;
procedure SetSource(const lpszNewValue: WideString);
function GetConsole: WideString;
procedure SetConsole(const lpszNewValue: WideString);
function GetControls: WideString;
procedure SetControls(const lpszNewValue: WideString);
function GetNoLabels: WordBool;
procedure SetNoLabels(bNewValue: WordBool);
function GetAutoStart: WordBool;
procedure SetAutoStart(bNewValue: WordBool);
function GetAutoGotoURL: WordBool;
procedure SetAutoGotoURL(bNewValue: WordBool);
function GetVolume: Smallint;
procedure SetVolume(nVol: Smallint);
function GetMute: WordBool;
procedure SetMute(bMute: WordBool);
function GetLoop: WordBool;
procedure SetLoop(bVal: WordBool);
function GetImageStatus: WordBool;
procedure SetImageStatus(bEnable: WordBool);
function GetPacketsTotal: Integer;
function GetPacketsReceived: Integer;
function GetPacketsOutOfOrder: Integer;
function GetPacketsMissing: Integer;
function GetPacketsEarly: Integer;
function GetPacketsLate: Integer;
function GetBandwidthAverage: Integer;
function GetBandwidthCurrent: Integer;
procedure DoPlayPause;
procedure DoStop;
procedure DoNextItem;
procedure DoPrevItem;
function CanPlayPause: WordBool;
function CanStop: WordBool;
function HasNextItem: WordBool;
function HasPrevItem: WordBool;
function HasNextEntry: WordBool;
function HasPrevEntry: WordBool;
procedure DoNextEntry;
procedure DoPrevEntry;
procedure AboutBox;
procedure EditPreferences;
procedure HideShowStatistics;
function IsStatisticsVisible: WordBool;
procedure DoGotoURL(const url: WideString; const target: WideString);
procedure DoPlay;
procedure DoPause;
function GetPosition: Integer;
function GetPlayState: Integer;
function GetLength: Integer;
function GetTitle: WideString;
function GetAuthor: WideString;
function GetCopyright: WideString;
function GetClipWidth: Integer;
function GetClipHeight: Integer;
function CanPlay: WordBool;
function CanPause: WordBool;
procedure SetPosition(lPosition: Integer);
function GetNumLoop: Integer;
procedure SetNumLoop(lVal: Integer);
function GetCenter: WordBool;
procedure SetCenter(bVal: WordBool);
function GetNoLogo: WordBool;
procedure SetNoLogo(bVal: WordBool);
function GetMaintainAspect: WordBool;
procedure SetMaintainAspect(bVal: WordBool);
function GetBackgroundColor: WideString;
procedure SetBackgroundColor(const pVal: WideString);
function GetStereoState: WordBool;
function GetLiveState: WordBool;
function GetShowStatistics: WordBool;
procedure SetShowStatistics(bVal: WordBool);
function GetShowPreferences: WordBool;
procedure SetShowPreferences(bVal: WordBool);
function GetShowonmouseover WordBool;
procedure SetShowAbou
Usage Guide for WMP Video Control in Web Pages
Playback Methods and Attributes In addition to play, pause, and stop, the media player can also use the following attributes:
Scanning - similar to the fast forward and rewind functions of a video recorder;
Search (Seeking) - Move directly to the specific performance time marked in the clip;
□Play media player provides two techniques to specify the name of the media (clip) to be played, you can set the FileName property, or call the Open method. If the value of the AutoStart property is true, the movie clip will start playing when the FileName property is set to the URL of the movie clip; otherwise, the movie clip will not start playing unless you call the Play method. The Open method starts playing asynchronously, unlike the Play method which waits until other processes end before starting playing.
The media player provides the following video recorder-like properties and methods to control the playback of streaming media:
Play, Stop, and Pause methods to start, stop, and pause streaming media.
PlayCount attribute, sets the number of times the file is played.
AutoRewind property that determines whether to return to the beginning of the movie clip when playback is stopped.
□Audio Control The media player provides the following properties to manage audio:
Balance attribute, determines the sound balance of the left and right speakers;
Volume attribute, used to increase or decrease the volume;
Mute attribute, used to turn off or turn on the sound;
※You can set the ShowAudioControls property to true to add controls for processing sound in the control bar.
□ Scanning media player provides the following attributes for scanning:
FastForward method, fast forward;
FastReverse method, fast reverse;
Rate attribute, change the playback rate;
※To enable the movie clip to be scanned, the CanScan and AllowScan properties must be set to true.
□Search The attributes used for searching are:
The MarkerCount property refers to the total number of markers in the clip;
CurrentMaker, GetMarkerName, GetMarkerTime methods are used to return mark information;
MarkerHit event, triggered when a mark is encountered;
The CurrentPosition property, the current position (measured in seconds), can be used to move the playhead to a specified point in the clip;
PositionChange event, triggered when the CurrentPosition property is set;
※To search for any time, the CanSeek attribute must be set to true. To search for marked points, the CanSeekToMarkers attribute must be set to true.
□The appearance interface of the media player is on the web page. You can control which parts of the media player appear and which parts do not appear through relevant attributes.
The media player includes the following elements:
Video Display Panel: Video display panel;
Video Border: video border;
Closed Captioning Display Panel; subtitle display panel;
Track Bar; search bar;
Control Bar with Audio and Position Controls: Control bar with audio and position controls;
Go To Bar: go to the bar;
Display Panel: display panel;
Status Bar: status bar;
The following properties are used to determine which element is displayed:
ShowControls property: whether to display the control bar (including playback controls and optional sound and position controls);
ShowAudioControls property: whether to display sound controls (mute button and volume slider) in the control bar;
ShowPositionControls property: whether to display position controls in the control bar (including skipping backward, rewinding, fast forwarding, jumping forward, and previewing each clip in the playlist);
ShowTracker property: whether to display the search bar;
ShowDisplay attribute: whether to display the display panel (used to provide program and clip information);
ShowCaptioning attribute: whether to display the subtitle display panel;
ShowGotoBar property: whether to display the goto bar;
ShowStatusBar property: whether to display the status bar;
□The playlist media player provides the following methods to access clips in the playlist:
Next method, jump to the next clip in the program (playlist);
Previous method, jumps back to the previous clip in the program;
One feature of the media player is the ability to preview each clip in the show, using the following properties:
The PreviewMode attribute determines whether the media player is currently in preview mode;
The CanPreview property determines whether the media player can be in preview mode;
In the Windows media metafile, you can specify a preview time for each clip - PREVIEWDURATION. If not specified, the default preview time is 10 seconds.
You can also add watermarks and banners using Windows Media metafiles, which also support gapless stream switching when inserting ads.
□Program information Use the GetMediaInfoString method to return the following information about related clips or programs:
File name: File name
Title:Title
Description: Description
Author:Author
Copyright: Copyright
Level: Rating
URLs: The address clipping information of logo icon, watermark, and banner can be placed in the media file, or in the Windows media metafile, or both. If clip information is specified in the metafile, the GetMediaInfoString method returns the information in the metafile, not the information contained in the clip.
In the metafile, additional information can be placed in the PARAM tag of each clip or program. You can add as many PARAM tags to each clip to store custom information or link to related sites. The information in the PARAM tag can be accessed through the GetMediaParameter method.
The following properties return information about size and time:
ImageSourceHeight, ImageSourceWidth: Return the display size of the image window;
Duration property, returns the length of the clip (in seconds). To detect whether this property contains a valid value, check the IsDurationValid property. (For broadcast video, the length is unpredictable).
□Subtitles You can use .smi files to add subtitles to your programs. The media player supports the following properties for handling subtitles:
SAMIFileName attribute, specifies the name of the .smi file;
SAMILang attribute, specifies the language of the subtitles (if not specified, the first language is used);
SAMIStyle attribute, specifies the text size and style of subtitles;
ShowCaptioning attribute determines whether to display the subtitle display panel;
□Script commands accompany audio and video streams, and you can add script commands to streaming media files. A script command is a pair of Unicode strings synchronized with a specific time in a multimedia stream. The first string identifies the type of command to be issued, and the second string specifies the command to be executed.
When the stream plays to the time related to the script, the control will send a ScriptCommand event to the web page, and then the event handler will respond to this event. The script command string is passed to the event handler as a parameter of the script command event.
The media player automatically handles the following types of inline script commands:
1) URL type command: When the media player control receives a URL type command, the specified URL will be loaded into the user's default browser. If the media player is embedded in a framed HTML file, the URL page can be loaded into the frame specified by the script command. If the script command does not specify a frame, the DefaultFrame property determines which frame the URL page is loaded into.
You can decide whether to automatically handle URL-type script commands by setting the InvokeURLs property. If the value of this property is false, the media player control will ignore URL-type commands. But script command events will still fire, allowing you to selectively handle URL-type commands.
URL type commands specify the relative address of the URL. The base address is specified by the BaseURL attribute. The command parameter of the script command event sent by the media player control is the linked address.
2) FILENAME type command: When the media player control receives a FILENAME type command, it will set the FileName property to the file provided by the script command, and then the media player will open the file and start playing. The media player control always automatically handles FILENAME-type commands, unlike URL-type commands, which cannot be disabled.
3) TEXT type command: When the media player control receives a TEXT type command, it will display the content of the command in the subtitle window of the control. Content can be plain text or HTML.
4) EVENT type command: When the media player control receives an EVENT type command, it will search the NAME attribute of the EVENT element in the media metafile. If the NAME attribute matches the second string in the script command, the media player control executes the entry contained in the EVENT element.
5) OPENEVENT type command: When the media player control receives an OPENEVENT type command, it will check the EVENT element in the media metafile and open the matching title, but will not play it until it receives the same name from the EVENT type command. Real events.
□Capture keyboard and mouse events
The EnableContextMenu and ClickToPlay properties provide users with methods to operate in the image window.
If the EnableContextMenu property is true, right-clicking the mouse in the image window can open the context menu. If the ClickToPlay property is set to true, the user can click the image window to switch between play and pause.
To receive mouse move and click events, set the SendMouseMoveEvents and SendMouseClickEvents properties to true. Mouse events are:
MouseDown, generated when the user presses the mouse;
MouseUp, generated when the user releases the mouse;
MouseMove, generated when the user moves the mouse;
Click, generated when the user clicks the mouse button on the media player;
DbClick, generated when the user double-clicks the mouse button on the media player;
To receive keyboard events, set the SendKeyboardEvents property to true. Keyboard events are:
KeyDown, generated when the user presses a key;
KeyUp, generated when the user releases a key;
KeyPress, generated when the user presses and releases a key;
□Monitoring flow status and network link flow status attributes include:
PlayState: playback state;
OpenState: open state;
Bandwidth: bandwidth;
Supported events are:
OpenStateChange: open state change (only triggered when the SendOpenStateChangeEvents property is true)
PlayStateChange: Play state changes (only triggered when the SendPlayStateChangeEvents property is true)
EndOfStream: triggered when the stream ends;
NewStream: triggered when a new stream is opened;
Network receiving properties include:
ReceptionQuality: reception quality;
ReceivedPackets: Packets that have been received;
LostPackets: lost packets;
The properties of the monitoring buffer are:
BufferingTime: buffering time;
BufferingCount: number of buffering times;
BufferingProgress: buffering process;
Buffering: Buffering events;
□Error handling Media player provides built-in error handling function - display error information in the dialog box or status bar. Additionally, you can add error handlers yourself. If the SendErrorEvents property is set to true, the error box will not be displayed and error events will be sent; if the SendErrorEvents property is set to false, the error box will be displayed and error events will be sent.
The media player supports the following error handling events:
Error event refers to a dangerous error occurring;
Warning event refers to the occurrence of a non-dangerous error;
When your application receives an error event, you can examine the following properties to determine the specific error message:
HasError: Check whether the current media player has errors;
ErrorCode: Provides the code value related to this type of error;
ErrorDescription: Provide error description information;
ErrorCorrection: Specify the media player to correct this type of error;
□Play CD
Media players treat CDs as a single audio stream with markers at the beginning of each track. To use CD in a web page, you need to set the FileName property to CDAUDIO:, which must contain a colon, as shown below:
Copy content to clipboard code:
<HTML>
<HEAD><TITLE>CD Audio Playback Example</TITLE></HEAD>
<BODY>
<OBJECT ID="MediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
WIDTH="320"
HEIGHT="508"
STYLE="position:absolute; left:0px; top:70px;" >
<PARAM NAME="FileName" value="/cdaudio:">
<PARAM NAME="AutoStart" VALUE="0">
<PARAM NAME="ShowControls" VALUE="1">
<PARAM NAME="ShowStatusBar" VALUE="1">
<PARAM NAME="ShowDisplay" VALUE="1">
</OBJECT>
</BODY>
</HTML>
You can then use the Play method to play the CD.
You can specify the playback order and information about each track in the Windows media metafile. Examples are as follows:
Copy content to clipboard code:
<ASX VERSION="3.0">
<TITLE>CD Audio with the Media Player</TITLE>
<AUTHOR>Windows Media Technologies</AUTHOR>
<COPYRIGHT>(c) 1999, Microsoft, Inc.</COPYRIGHT>
<ENTRY>
<TITLE>Track 1: Title 1</TITLE>
<REF href="/cdaudio:" />
<STARTMARKER NUMBER="1"/>
<ENDMARKER NUMBER="2"/>
</ENTRY>
<ENTRY>
<TITLE>Track 2: Title 2</TITLE>
<REF href="/cdaudio:" />
<STARTMARKER NUMBER="2"/>
<ENDMARKER NUMBER="3"/>
</ENTRY>
<ENTRY>
<TITLE>Track 3: Title 3</TITLE>
<REF href="/cdaudio:" />
<STARTMARKER NUMBER="3"/>
<ENDMARKER NUMBER="4"/>
</ENTRY>
<ENTRY>
<TITLE>Track 4: Title 4</TITLE>
<REF href="/cdaudio:" />
<STARTMARKER NUMBER="4"/>
</ENTRY>
</ASX>
Source: Jishige