Html5 video playback and html5 video playback
When we play a video, some players use software to decode the video. This will take up a lot of CPU usage. Some players use hardware decoding, But it limits the formats of the video that can be played.
Knowledge Point 1: Video codecs
1. H.264
2. Theora (released by Xiph. Org)
3. VP8 (released by Google)
Knowledge Point 2: audio codecs
1. AAC (Apple uses the audio format on iTunes Store)
2. Vorbis (OGG)
3. MP3
Knowledge 3: The container must work with the decoder to play audio and video simultaneously.
1. OGG container: Includes Theora video and Vorbis Audio
2. MP4 container: including H.264 video and AAC audio
3. WebM container: including VP8 video and Vorbis Audio
The settings for browser compatibility are shown below to embed audio Resources in the page.
<Article class = "sample">
In addition, JavaScript can be used to hide codes in browsers that are not compatible with audio elements.
<script type="text/javascript"charset="utf-8">$(function(){var canPlayAudioFiles=!!(document.createElement('audio').canPlayType);if(canPlayAudioFiles){$(".sample a").hide();};});</script>