requesting data
Eventtester ("stalled"); Speed stall
Eventtester ("Play"); Triggers when play () and AutoPlay start playing
Eventtester ("pause"); Pause () Trigger
Eventtester ("Loadedmetadata"); Successful acquisition of resource length
Eventtester ("Loadeddata"); //
Eventtester ("Waiting"); Wait for data, not error
Eventtester ("playing"); Start playback
Eventtester ("Canplay"); Can be played, but may be paused halfway through loading
Eventtester ("Canplaythrough"); Can play
Today learn to use canvas to write the HTML5 audio visual spectrum Bounce code to do a summary of the code here:"en">"UTF-8"> "Viewport"Content="Width=device-width, initial-scale=1.0"> "x-ua-compatible"Content="Ie=edge"> "Myaudio"Src="./Star Moon myth. mp3">"Canvas">HTML5 Audio Visual Spectral bounce code
1 Use the HTML5 label 2 Several important functions of document are used:3 1.createElement Create a Label object,4 2.getElementById Gets the src attribute of the object and the IMG object5 3.document.body Add control appendchild () function6 learn the power of document. You can create objects, manipulate body tags, etc. -7 DOCTYPE HTML>8 HTML>9 Metahttp-equiv= "Content-type"content= "Text/html;charset=utf-8">Ten Body> One H3>Music Playback
Do a micro-letter application, want to add a background music, using HTML5 audio tag in the Computer browser can play automatically, and on the mobile device whether the set AutoPlay properties or use JS call Play () method, can not be automatically played, what is the solution.
Cause analysis
The AutoPlay property in HTML5 is set to play automatically. If this
I really don't want to review software engineering at night. Write a player. This is just a small Demo for learning. For many imperfections, the source code is posted below. If you want to reprint it, add a copyright statement.
PS: Because Ajax involves cross-origin weather information retrieval, there are two versions, one is direct cross-origin, IE10 supports, other browsers need to change the configuration. The other is weather. php on the server
In the evening to test software engineering, really do not want to review. Write a player, this is just a small demo for learning, many imperfections, the following posted source code, if you want to reprint, please add the copyright notice
PS: Because Ajax involves getting weather information across domains, there are two versions, one is a direct cross-domain, IE10 support, and other browsers are configured to change. The other is the server-side w
(or Exitfullscreen) method of the Document object.Code:Fullscreenvar Docelm = document.documentelement;W3cif (Docelm.requestfullscreen) {Docelm.requestfullscreen ();}FireFoxelse if (Docelm.mozrequestfullscreen) {Docelm.mozrequestfullscreen ();}Chrome and moreelse if (Docelm.webkitrequestfullscreen) {Docelm.webkitrequestfullscreen ();}IE11else if (Elem.msrequestfullscreen) {Elem.msrequestfullscreen ();}Exit Full Screenif (Document.exitfullscreen) {Document.exitfullscreen ();}else if (Document.mo
src: The URL of the music
Preload: Pre-load
AutoPlay: Auto Play
Loop: Looping Playback
Controls: Browser's own control
SRC: URL of the video
Poster: Video cover, no picture displayed when playing
Preload: Pre-load
AutoPlay: Auto Play
Loop: Looping Playback
Controls: Browser's own control bar
Width: Video width
Height: Video Height
Get Htmlvideoelement and Htmlaudioelement objects1 // audio
A simple audio list and a small example of playbackDOCTYPE HTML>HTML>Head> MetaCharSet= "Utf-8"> title>title>Head>Body>Scripttype= "Text/javascript">varCount= +; //How many MP3 filesvarIndex= '18.mp3'; //Initialize the file to playwindow.onload= function(){ varAudio= NewAudio (); Audio.preload= true; Audio.controls= true; Audio.loop= false; AUDIO.SRC=index; Document.body.appendChild (audio);
following describes a method.
Insert an input node in the page and specify the type as file. To play multiple files, you can add the attribute multiple. Registers the callback function when the file node is updated and calls the URL in the callback function. the createObjectURL function is used to obtain the url of the selected file and set the url to the src value of audio or video.
The code example is as follows:The Code is as follows:This Code pas
This article mainly introduces the full screen (fullScreen) method example of HTML5video player. This article provides a complete code example. If you need a friend, refer to the following. First of all, this title is misleading, however, this setting changes the title mainly because video is mostly used.
In html5, the full screen method can be applied to many html elements, not just video
The Code is as
The whim of the need to put a 1.5-hour video tutorial on the official website ...However, loading becomes a problem, the page is cshtml. NET hybrid website, do not know where the restrictions, cause the video can not be added.No way, only the front-end to find out.Then cut the video into 4Load autoplay in turn. The effect is also possible.Code:Introduced: Html: Js:var vList = [' Http://xxx.com/video/home2.mp4 ', ' http://xxx.com/video/home3.mp4 ', ' http://xxx.com/video/home4.mp4 ', ' Http://
1. AudioYour browser does not support the audio element.Insert prompt text for The 2. VideoYour browser does not support the video tag.The 3. Drag and Dropvar box1,box2,imgWindow.onload = function () {Box1 = document.getElementById ("Box1");Box2 = document.getElementById ("Box2");Box2.ondragstart = function (e) {Drag (e);}Box2.ondragover = function (e) {DragOver (e);}Box2.ondrop = function (e) {OnDrop (e);}img = document.getElementById ("img");Img.dra
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.