This article briefly describes the use of new audio and video in H5, H4 playback is done through flash.
<! DOCTYPE html>
There are also some attributes, such as:
AutoPlay Properties (AutoPlay), preload properties (preload or buffering), poster properties (video unique),
The Loop property, the error property, such as
<video id= "video" src= "Video123.mp4" ></video>
<script type= "Text/javascript" >
var video = document.getElementById (' video ');
Video.addeventlistener ("Error", function () {
var error = Video.error;
Switch (error.code) {case
1:
alert (' The retrieval process was aborted by the user. ');
break;
Case 2:
alert (' An error occurred at the moment of load. ');
break;
Case 3:
alert (' An error occurred while decoding. ');
break;
Case 4:
alert (' Media unavailable or no support for audio/video. ');
break;
}
},false);
</script>
Play Effect Chart: