Embedded audio and video in a webpage can fully display the multimedia features of the webpage, especially with the popularization of broadband networks, making network broadcast and online video a reality, the importance of webpage audio and video is also becoming increasingly prominent. Specifically, there are three ways to embed webpage audio and video:
1. bgsound
(1) Basic Syntax:
Bgsound src = URL
Note: bgsound is used to insert background music, but it is only applicable to IE and IE browsers. The URL is the audio file and its path, which can be a relative or absolute path.
Example: <bgsound src = "Your. Mid">
(2) attribute settings:
Because the audio file embedded in bgsound is not displayed in the webpage, all its attributes must be set when bgsound is used.
1. automatic playback:
Syntax: autostart = true and false
Note: This attribute specifies whether music files are automatically played after being downloaded.
True: music files are automatically played after being downloaded;
False: The music file is not automatically played after it is downloaded.
Example: <bgsound src = "Your. Mid" autostart = true>
<Bgsound src = "Your. Mid" autostart = false>
2. Loop playback:
Syntax:Loop= Positive integer orInfinite
Note: This attribute specifies the number of cycles of music files.
When the property value is a positive integer, the number of cycles in the music file is the same as that in the positive integer;
The property value isInfiniteWhen the music file is repeatedly played, the loop is not limited.
Example: <bgsound src = "Your. Mid"Loop= 2>
<Bgsound src = "Your. Mid"Loop=Infinite>
Ii. Embed
(1) Basic Syntax:
Embed src = URL
Note: Embed can be used to insert various multimedia files in the format of MIDI, WAV, AIFF, AU, MP3, etc. Netscape and the new version of IE support. The URL is an audio or video file and its path, which can be a relative or absolute path.
Example: <embed src = "Your. Mid">
(2) attribute settings:
1. automatic playback:
Syntax: autostart = true and false
Note: This attribute specifies whether audio or video files are automatically played after being downloaded.
True: music files are automatically played after being downloaded;
False: The music file is not automatically played after it is downloaded.
Example: <embed src = "Your. Mid" autostart = true>
<Embed src = "Your. Mid" autostart = false>
2. Loop playback:
Syntax:Loop= Positive integer, true, false
Note: This attribute specifies whether audio or video files are cyclically or cyclically stored.
When the property value is a positive integer, the number of cycles of the audio or video file is the same as that of the positive integer;
When the attribute value is true, audio or video file loops;
When the attribute value is false, audio or video files do not circulate.
Example: <embed src = "Your. Mid" autostart = trueLoop= 2>
<Embed src = "Your. Mid" autostart = trueLoop= True>
<Embed src = "Your. Mid" autostart = trueLoop= False>
3. panel display:
Syntax: hidden = ture, no
Note: This attribute specifies whether the control panel is displayed. The default value is no.
Ture: Hide the panel;
No: Display Panel.
Example: <embed src = "Your. Mid" hidden = ture>
<Embed src = "Your. Mid" hidden = NO>
4. Start Time:
Syntax: starttime = mm: SS (minute: second)
Note: This attribute specifies the time when the audio or video file starts to play. If it is not defined, it is played from the beginning of the file.
Example: <embed src = "Your. Mid" starttime = "00:10">
5. volume size:
Syntax: an integer between volume = 0 and
Note: This attribute specifies the volume of audio or video files. If not defined, the system settings are used.
Example: <embed src = "Your. Mid" volume = "10">
6. Container properties:
Syntax: Height = # width = #
Description: The value is a positive integer or percentage, in pixels. This attribute specifies the height and width of the control panel.
Height: the height of the control panel;
Width: the width of the control panel.
Example: <embed src = "Your. Mid" Height = 200 width = 200>
7. container unit:
Syntax: Units = pixels, en
Description: This attribute specifies the unit of height and width as pixels or en.
Example: <embed src = "Your. Mid" Units = "pixels" Height = 200 width = 200>
<Embed src = "Your. Mid" Units = "en" Height = 200 width = 200>
8. Appearance settings:
Syntax: Controls = console, smallconsole, playbutton, pausebutton, stopbutton, volumelever
Note: This attribute specifies the appearance of the control panel. The default value is console.
Console: normal panel;
Smallconsole: small panel;
Playbutton: only the playback button is displayed;
Pausebutton: only the pause button is displayed;
Stopbutton: only the stop button is displayed;
Volumelever: only the volume adjustment button is displayed.
Example: <embed src = "Your. Mid" controls = smallconsole>
<Embed src = "Your. Mid" controls = volumelever>
9. Object Name:
Syntax: Name = #
Note: # Is the object name. This attribute is used to name an object so that other objects can use it.
Example: <embed src = "Your. Mid" name = "sound1">
10. Description:
Syntax: Title = #
Note: # indicates the description. This attribute specifies the description of an audio or video file.
Example: <embed src = "Your. Mid" Title = "First Song">
11. foreground and background colors:
Syntax: palette = color | color
Description: This attribute indicates the foreground color and background color of the embedded audio or video file. The first value is the foreground color, the second value is the background color, and the center is separated by |. Color can be an RGB color (rrggbb), a color name, or a transparent (transparent ).
Example: <embed src = "Your. Mid" palette = "Red | black">
12. Alignment:
Syntax: align = top, bottom, center, baseline, left, right, texttop, middle, absmiddle, absbottom
Note: This attribute specifies the alignment of the control panel and objects in the current row.
Center: center the control panel;
Left: the control panel is left;
Right: Right of the control panel;
Top: Align the top of the control panel with the top of the highest object in the current row;
Bottom: the bottom of the control panel is aligned with the baseline of the object in the current row;
Baseline: Align the bottom of the control panel with the baseline of the text;
Texttop: Align the top of the control panel with the top of the highest text in the current row;
Middle: The Middle Of The control panel is aligned with the baseline of the current row;
Absmiddle: the center of the control panel is aligned with the center of the current text or object;
Absbottom: the bottom of the control panel is aligned with the bottom of the text.
Example: <embed src = "Your. Mid" align = top>
<Embed src = "Your. Mid" align = center>
Iii. IMG DYNSRC
(1) Basic Syntax:
Img dynsrc = URL
Note: img dynsrc can be used to insert various multimedia files. The formats include WAV, Avi, AIFF, AU, MP3, Ra, and ram. The URL is an audio or video file and its path, which can be a relative or absolute path.
Example:
(2) attribute settings:
1. preset image:
Syntax: src = URL
Note: URLs are image files and their paths, which can be relative or absolute paths. This attribute is used to occupy the display position of a video file when downloading a video file. The video file is downloaded, the image is blocked, and the video file is displayed. If DYNSRC is specified as an audio file, the src attribute is blocked and the image is invisible.
Example:
2. Playback events:
Syntax: Start = fileopen, Mouseover
Note: This attribute specifies the file playback events. The default value is fileopen. You can also set both. In addition, clicking the mouse in the playback area will also enable the browser to start playing the file.
Fileopen: When the file is opened;
Mouseover: When you move the mouse over the playing area.
Example:
3. Container properties:
Syntax: Height = # width = #
Description: The value is a positive integer or percentage. This attribute specifies the height and width of the control panel.
Height: the height of the control panel.
Width: the width of the control panel.
Example:
4. Description:
Syntax: ALT = #
Note: # It is the description. The ALT value is a non-display description of the animation file.
Example:
5. control display:
Syntax: Controls
(Used to append the MS-WINDOWS playing control bar in the video window.
Example:
6. Loop playback:
Syntax: loop = positive integer orInfinite
Description: This attribute specifies the number of audio or video file cycles. The attribute value is-1 orInfiniteWhen audio or video files are repeatedly played, the loop is not limited.
When the property value is a positive integer, the number of cycles of the audio or video file is the same as that of the positive integer;
When the attribute value is infinite, audio or video files are repeatedly played, and the loop is not limited.
Example: Loop= 2>
Loop=Infinite>
7. Delayed playback:
Syntax: loopdelay = #
Note: # = the number of milliseconds. This attribute specifies the delayed playback time of audio or video files.
Example:
8. whitelist attributes:
Syntax: hspace = # vspace = #
Description: The value is a positive integer in pixels. Both attributes should be applied at the same time.
Hspace: the distance between the screen and the left of the page;
Vspace: the distance between the screen and the top of the page.
Example: