If you still use the following: & amp; lt; EMBEDsrc = & amp; ldquo; music. mid & amp; rdquo; autostart = & amp; ldquo; true & amp; rdquo; loop = & amp; ldquo; 2 & amp; rdquo; widt
If you use the following code:
<EMBED src = "music. mid" autostart = "true" loop = "2" width = "80" height = "30">
If you play music in the form, it will be out. html5 audio can better support music playing, of course it does not support IE.
Browser support:
Browser |
Support |
Codecs |
Chrome |
3.0 |
Theora, Vorbis, Ogg H.264, AAC, and MPEG4 |
FireFox |
3.5 |
Theora, Vorbis, Ogg |
IE |
Not Supported |
None |
Opera |
10.5 |
Theora, Vorbis, Ogg (10.5) VP8, Vorbis, WebM (10.6) |
Safari |
3.2 |
H.264, ACC, MPEG4 |
Common control functions:
Function |
Action |
Load () |
Loading audio and video software |
Play () |
Load and play audio and video files or play paused audio and video again |
Pause () |
Pause audio and video files in the playback status |
CanPlayType (obj) |
Test whether a specified Mini file is supported |
Read-Only media attributes:
Read-only attribute |
Value |
Duration |
Gets the playback duration of a media file, in seconds. If it cannot be obtained, it is NaN. |
Paused |
If the media file is paused, true is returned; otherwise, false is returned. |
Ended |
Returns true if the media file has been played. |
StartTime |
Returns the start playback time. |
Error |
Error Code returned |
CurrentSrc |
Returns a file that is being played or loaded as a string. |
Property values that can be controlled by script:
Attribute |
Value |
Autoplay |
Automatically play the loaded media file |
Loop |
If it is true, it is set to automatic playback. |
CurrentTime |
Returns the time taken from the start of playback to the current time in seconds. |
Controls |
Show or hide the User Control Interface |
Volume |
Volume value, from 0.0 to 1.0 |
Muted |
Set whether to mute |
Autobuffer |
Buffer loading? |
Take a look at the following simple application:
From PHP point-of-the-box (http://www.phpddt.com) web tutorialScript function playClicked (element) {// get the state of the playerif (audio_player.paused) {audio_player.play (); newdisplay = "|";} else {audio_player.pause (); newdisplay = ">";} element. value = newdisplay;} script
If you remove the controls tag, the player will hide it.