Modify the settings as needed.
Mpl. OpenUrl ("DuskToDawn.wma ");
The complete code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN"
Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> MediaPlayer example </title>
<Mce: style type = "text/css"> <! --
Body
{
Font-size: 12px;
Font-family:;
}
# DivMpl
{
Height: 137px;
Width: 277px;
}
# DivMsg
{
Height: 155px;
Overflow: auto;
Width: 376px;
}
--> </Mce: style> <style type = "text/css" mce_bogus = "1"> body
{
Font-size: 12px;
Font-family:;
}
# DivMpl
{
Height: 137px;
Width: 277px;
}
# DivMsg
{
Height: 155px;
Overflow: auto;
Width: 376px;
}
</Style>
<Mce: script language = "javascript" type = "text/javascript"> <! --
/* MediaPlayer class definition original freezing point */
Function MediaPlayer ()
{
This. dom = null;
}
MediaPlayer. uiMode =
{
Full: "full ",
Mini: "mini ",
None: "none ",
Invisible: "invisible"
}
MediaPlayer. prototype = {
CreateAt: function (id) // create a MediaPlayer control in the tag of the specified ID. The size is determined by the tag.
{
This. dom = document. createElement ("object ");
This. dom. classid = "CLSID: 6BF52A52-394A-11d3-B153-00C04F79FAA6 ";
This. dom. style. width = "100% ";
This. dom. style. height = "100% ";
Var container = document. getElementById (id );
Container. innerHTML = "";
Container. appendChild (this. dom );
This. _ Init ();
},
BindID: function (id) // bind an existing Object tag, which should be a MediaPlayer Control
{
This. dom = document. getElementById (id );
This. _ Init ();
},
_ Init: function () // initialization, event registration
{
Var _ this = this;
This. dom. attachEvent ("PlayStateChange ",
Function (newState) {_ this. onPlayStateChange (newState )});
This. dom. attachEvent ("Buffering", function (bStart) {_this. onBuffering (bStart )});
This. dom. attachEvent ("Error", function () {_ this. onError ();});
This. dom. attachEvent ("PositionChange ",
Function (oldPos, newPos) {_this. onPositionChange (oldPos, newPos );});
This. dom. attachEvent ("StatusChange", function () {_this. onStatusChange ();})
},
OnPlayStateChange: function (newState)
{
Switch (newState)
{
Case 1: // wmppsStopped
This. onStop ();
Break;
Case 2: // wmppsPaused
This. onPaused ();
Break;
Case 3: // wmppsPlaying
This. onPlay ();
Break;
Case 4: // wmppsScanForward
Break;
Case 5: // wmppsScanReverse
Break;
Case 6: // wmppsBuffering
Th