You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove active learning from HTML video and audio (#39869)
* Remove active learning from HTML video and audio
* Update files/en-us/learn_web_development/core/structuring_content/html_video_and_audio/index.md
Co-authored-by: Brian Smith <brian@smith.berlin>
---------
Co-authored-by: Brian Smith <brian@smith.berlin>
Copy file name to clipboardExpand all lines: files/en-us/learn_web_development/core/structuring_content/html_video_and_audio/index.md
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ An audio player will tend to play an audio track directly, e.g., an MP3 or Ogg f
107
107
> [!NOTE]
108
108
> Several popular formats, such as MP3 and MP4/H.264, are excellent but are encumbered by patents; that is, there are patents covering some or all of the technology that they're based upon. In the United States, patents covered MP3 until 2017, and H.264 is encumbered by patents through at least 2027.
109
109
>
110
-
> Because of those patents, browsers that wish to implement support for those codecs must pay typically enormous license fees. In addition, some people prefer to avoid restricted software and prefer to use only open formats. Due to these legal and preferential reasons, web developers find themselves having to support multiple formats to capture their entire audience.
110
+
> Because of those patents, browsers that wish to implement support for those codecs must pay typically enormous license fees. In addition, some people prefer to avoid restricted software and prefer to use only open formats. Due to these legal and preferential reasons, web developers find themselves having to support multiple formats to provide a video experience to their entire audience.
111
111
112
112
The codecs described in the previous section exist to compress video and audio into manageable files, since raw audio and video are both exceedingly large. Each web browser supports an assortment of **{{Glossary("Codec","codecs")}}**, like Vorbis or H.264, which are used to convert the compressed audio and video into binary data and back. Each codec offers its own advantages and drawbacks, and each container may also offer its own positive and negative features affecting your decisions about which to use.
113
113
@@ -277,21 +277,48 @@ For more details, including on how to add labels please read [Adding captions an
277
277
> [!NOTE]
278
278
> Text tracks also help you with {{glossary("SEO")}}, since search engines especially thrive on text. Text tracks even allow search engines to link directly to a spot partway through the video.
279
279
280
-
## Active learning: Embedding your own audio and video
280
+
## Embedding your own audio and video
281
281
282
-
For this active learning, we'd (ideally) like you to go out into the world and record some of your own video and audio — most phones these days allow you to record audio and video very easily and, provided you can transfer it on to your computer, you can use it. You may have to do some conversion to end up with a WebM and MP4 in the case of video, and an MP3 and Ogg in the case of audio, but there are enough programs out there to allow you to do this without too much trouble, such as [Miro Video Converter](http://www.mirovideoconverter.com/)and [Audacity](https://sourceforge.net/projects/audacity/). We'd like you to have a go!
282
+
For this task, why not go out into the world and record some of your own video and audio? If you have a phone, use that to record audio and video, transfer it to your computer, and try it out. You may have to do some conversion to end up with a WebM and MP4 in the case of video, and an MP3 and Ogg in the case of audio, but there are enough programs and tools out there to allow you to do this without too much trouble, such as [CloudConvert](https://cloudconvert.com/mp4-converter) (online) and [Audacity](https://sourceforge.net/projects/audacity/) (desktop application). We'd like you to have a go!
283
283
284
-
If you are unable to source any video or audio, then you can feel free to use our [sample audio and video files](https://github.com/mdn/learning-area/tree/main/html/multimedia-and-embedding/video-and-audio-content) to carry out this exercise. You can also use our sample code for reference.
284
+
> [!NOTE]
285
+
> If you are unable to source any video or audio, then you can feel free to use our [sample audio and video files](https://github.com/mdn/learning-area/tree/main/html/multimedia-and-embedding/video-and-audio-content) to carry out this exercise.
285
286
286
287
We would like you to:
287
288
288
289
1. Save your audio and video files in a new directory on your computer.
289
-
2. Create a new HTML file in the same directory, called `index.html`.
290
+
2. Create a new HTML file in the same directory, called `index.html`, based on our [getting started template](https://github.com/mdn/learning-area/blob/main/html/introduction-to-html/getting-started/index.html).
290
291
3. Add {{HTMLElement("audio")}} and {{HTMLElement("video")}} elements to the page; make them display the default browser controls.
291
292
4. Give both of them {{HTMLElement("source")}} elements so that browsers will find the audio format they support best and load it. These should include [`type`](/en-US/docs/Web/HTML/Reference/Elements/source#type) attributes.
292
-
5. Give the `<video>` element a poster that will be displayed before the video starts to be played. Have fun creating your own poster graphic.
293
+
5. Give both of them a fallback `<p>` element inside the tags that provides a direct link to the media for non-supporting browsers.
294
+
6. Give the `<video>` element a poster that will be displayed before the video starts to be played. Have fun creating your own poster graphic.
295
+
296
+
<details>
297
+
<summary>Click here to show the solution</summary>
298
+
299
+
Your finished HTML should look something like this:
300
+
301
+
```html
302
+
<videocontrolsposter="poster.png">
303
+
<sourcesrc="rabbit320.mp4"type="video/mp4" />
304
+
<sourcesrc="rabbit320.webm"type="video/webm" />
305
+
<p>
306
+
Your browser doesn't support HTML video. Here is a
307
+
<ahref="rabbit320.mp4">link to the video</a> instead.
308
+
</p>
309
+
</video>
310
+
311
+
<audiocontrols>
312
+
<sourcesrc="viper.mp3"type="audio/mp3" />
313
+
<sourcesrc="viper.ogg"type="audio/ogg" />
314
+
<p>
315
+
Your browser doesn't support HTML audio. Here is a
316
+
<ahref="viper.mp3">link to the audio</a> instead.
317
+
</p>
318
+
</audio>
319
+
```
293
320
294
-
For an added bonus, you could try researching text tracks, and work out how to add some captions to your video.
0 commit comments