Skip to content

Commit 44a9599

Browse files
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>
1 parent 457970e commit 44a9599

File tree

1 file changed

+34
-7
lines changed
  • files/en-us/learn_web_development/core/structuring_content/html_video_and_audio

1 file changed

+34
-7
lines changed

files/en-us/learn_web_development/core/structuring_content/html_video_and_audio/index.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ An audio player will tend to play an audio track directly, e.g., an MP3 or Ogg f
107107
> [!NOTE]
108108
> 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.
109109
>
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.
111111
112112
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.
113113

@@ -277,21 +277,48 @@ For more details, including on how to add labels please read [Adding captions an
277277
> [!NOTE]
278278
> 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.
279279
280-
## Active learning: Embedding your own audio and video
280+
## Embedding your own audio and video
281281

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!
283283

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.
285286
286287
We would like you to:
287288

288289
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).
290291
3. Add {{HTMLElement("audio")}} and {{HTMLElement("video")}} elements to the page; make them display the default browser controls.
291292
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+
<video controls poster="poster.png">
303+
<source src="rabbit320.mp4" type="video/mp4" />
304+
<source src="rabbit320.webm" type="video/webm" />
305+
<p>
306+
Your browser doesn't support HTML video. Here is a
307+
<a href="rabbit320.mp4">link to the video</a> instead.
308+
</p>
309+
</video>
310+
311+
<audio controls>
312+
<source src="viper.mp3" type="audio/mp3" />
313+
<source src="viper.ogg" type="audio/ogg" />
314+
<p>
315+
Your browser doesn't support HTML audio. Here is a
316+
<a href="viper.mp3">link to the audio</a> instead.
317+
</p>
318+
</audio>
319+
```
293320

294-
For an added bonus, you could try researching text tracks, and work out how to add some captions to your video.
321+
</details>
295322

296323
## Test your skills!
297324

0 commit comments

Comments
 (0)