Using Media Player in the web page November 12, 2004, the method of embedding Media Player in the web page is relatively simple, as long as the HTML is used.
Yes, as shown below.
Where ID is the name of the object, and when the user is controlled by JavaScript to control the name of the object when the Media Player is controlled, it can be accessed. CodeBase indicates that you can get from the URL specified when you have no Player controls in your user's browser. Of course, you can use the Player object.
To specify parameters for it. As follows:
The "FileName" parameter represents the logistics or stream of MEDIA Player to play. "ShowControls" indicates whether a control bar is displayed during playback. Madia Player has a lot of parameters, and we will not be detailed here. Readers If you need to know more detailed content, you can refer to the relevant part of the Media Player SDK. The method of embedding Media Player in the web page is relatively simple, as long as it is in HTML
Yes, as shown below.
Where ID is the name of the object, and when the user is controlled by JavaScript to control the name of the object when the Media Player is controlled, it can be accessed. CodeBase indicates that you can get from the URL specified when you have no Player controls in your user's browser. Of course, you can use the Player object.
To specify parameters for it. As follows:
The "FileName" parameter represents the logistics or stream of MEDIA Player to play. "ShowControls" indicates whether a control bar is displayed during playback. Madia Player has a lot of parameters, and we will not be detailed here. Readers If you need to know more detailed content, you can refer to the relevant part of the Media Player SDK. If the user needs to control the Media Player to be controlled with JavaScript. In this example, Media Player is embedded in the web page, with some buttons on the right side of Media Player, using these buttons users to control the MEDIA Player's playback activity. The HTML code of these buttons is as follows:
The corresponding JavaScript code is:
script> From this example, it can be seen that when a button of the user is single, its corresponding ONClick function will be called. In the JavaScript function, you can directly control the activity of the player directly, such as start playing, stop playing or occupying the playback, and zooming in zooming. In addition to the action such as a mouse, an embedded Media Player can be controlled by an event. Microsoft? Windows Media? Player supports a lot of events, with ordinary mouse events, such as the mouse click, double-click, mouse movement, mouse keys and release, etc., there are also some events for Media Player. Events with direct relationships with streams include: OpenStateChange, PlayStateChange, Buffering, Markerhit, ScriptCommand, etc. Below we will briefly introduce these important events. 1 OpenStateChange Event OpenStateChange event indicates that the status of Player has changed. The open state of Media Player is: 0 indicates that the stream has been closed (NSCLOSED) 1 indicating that the ASX file (NSLoadingAsx) 2 indicates that the NSC file (NSLoadingNSC) 3 indicates that the Media Server (NSLocating) 4 indicates that is being with Media Server Establishing a connection (nsconnecting) 5 indicates that the flow information is being opened or listened to the flow information. The format of the OpenStateChange event is processed by the stream information has been opened (NSOpen). ) "Language =" jscript "> // INSERT Script commands // script> where MediaPlayer is
The name of the Media Player object defined in the name. 2 PlayStateChange event PlayStateChange event indicates that the playback status of Media Player has changed, and Media Player may be: 0 Play has stopped (MPSTOPPED) 1 Playing pause (MPPASED) 2 is playing (MPPLAYING) 3 is waiting to start (MPWAITING) 4 Front Search (MPScanForward) 6 Backward Search (MPSkipForward) 7 Backward Jumping (MPSkipReverse) 8 stream Has been closed (MPCLOSED) The method of processing the event with JavaScript: