Home  >  Article  >  Web Front-end  >  Load audioAudio_html/css_WEB-ITnose

Load audioAudio_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:42:251052browse

var cameraAudio = new Audio();
cameraAudio.src = 'camera.wav';

// Set the properties of the audio object and preload the video
var options_audio = {
preload : 'auto'
}
for(var key in options_audio){
if(options_audio.hasOwnProperty(key) && (key in cameraAudio)){
cameraAudio[key] = options_audio[key];
                                                                                                                                                                                                         . autoplay'

3. preload: 'auto' means preloading

Related operations:

1. Play xxx.play()

2. Pause xxx.pause()

File download: Click to download

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn