Inserting audio and video: audio and video tags and their attributes

1. Upload to a third-party website, and then import, for example, video upload to Youku.com, and then get the code

<iframe height=498 width=510 src='http://player.youku.com/embed/XMTg1MjAzMTUwMA==' frameborder=0 'allowfullscreen'></iframe>

Second, the audio tag defines sound, such as music or other audio streams.

1.audio supports three audio formats, ogg, mp3, and wav. For compatibility reasons, two of them are generally introduced.

2. Properties:

autoplay If present, the audio plays as soon as it is ready. (Note: you can write autoplay="autoplay", or you can write autoplay directly)

controls If present, displays controls, such as a play button, to the user. (Note: You can write controls="controls", or you can write controls directly)

loop If present, restarts playback each time the audio ends. (Note: you can write loop=“loop”, or you can write loop directly)

preload If present, the audio is loaded when the page loads and is ready to play. This property is ignored if "autoplay" is used. (load, auto, meta, none)

src URL of the audio to play. (It can be written in the same way as Liezi, introducing the source single tag)

3. The following is the display style in the Firefox browser. Other browsers have different display styles. You can use CSS to unify the format.

4. Text content can be placed between the start tag and the end tag, so that old browsers can display information that does not support this tag.

< audio controls autoplay loop > 
        < source src ="/i/horse.ogg" > 
        < source src ="/i/horse.mp3" > 
        < source src ="/i/horse.wav" >
Your browser does not Support video tag !
</ audio >

Third, the <video> tag defines a video, such as a movie clip or other video stream.

1. Video supports three audio formats, ogg, mp4, and webm. For compatibility reasons, two of these formats are generally introduced.

2. Properties:

autoplay If present, the video will play as soon as it is ready. (Note: you can write autoplay="autoplay", or you can write autoplay directly)

controls If present, displays controls, such as a play button, to the user. (Note: You can write controls="controls", or you can write controls directly)

loop If this attribute is present, it starts playing again when the media file finishes playing. (Note: you can write loop=“loop”, or you can write loop directly)

preload If present, the video is loaded when the page loads and is ready to play. This property is ignored if "autoplay" is used. (load, auto, meta, none)

src URL of the video to play. (It can be written in the same way as Liezi, introducing the source single tag)

width and height set the width and height of the video player.

3. The following is the display style in the Firefox browser. Other browsers have different display styles. You can use CSS to unify the format.

4. Text content can be placed between the start tag and the end tag, so that old browsers can display information that does not support this tag.

<video controls autoplay loop>
            <source src="/i/movie.ogg">
            <source src="/i/movie.mp4">
            <source src="/i/movie.webm">
            Your browser does not support the video tag!
</video>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325522446&siteId=291194637