Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does HTML5 audio stream, or download and then play

Tags:

html

audio

I intend to put together a web based player for myself. Is it possible to stream audio files using the html5 tag? or will they fully download and then play. Is any special server configuration required to play these files

Also what if the audio is not a file on the server but being dynamically generated on the server side with the raw bytes being written to the response stream

like image 489
Midhat Avatar asked Nov 30 '10 10:11

Midhat


People also ask

How does HTML audio work?

HTML Audio - How It WorksThe controls attribute adds audio controls, like play, pause, and volume. The <source> element allows you to specify alternative audio files which the browser may choose from. The browser will use the first recognized format.

How do I get HTML audio to play on my website?

Complete HTML/CSS Course 2022 To play sound file in the background on a web page, use the <embed>… </embed> element. Also, use the autoplay attribute. This will run music in the background whenever the page loads.

Can we play audio files using HTML5?

Since the release of HTML5, audios can be added to webpages using the “audio” tag. Previously, audios could be only played on web pages using web plugins like Flash. The “audio” tag is an inline element that is used to embed sound files into a web page.

How does video and audio work in HTML5?

HTML5 features include native audio and video support without the need for Flash. The HTML5 <audio> and <video> tags make it simple to add media to a website. You need to set src attribute to identify the media source and include a controls attribute so the user can play and pause the media.


1 Answers

http://www.w3.org/TR/2010/WD-html5-20101019/video.html#audio

edit:

What's up with all that downloading?

Opera, Chrome and Safari will automatically download the whole video file even if it hasn't started to play yet. Firefox 3.6 only loads enough to render a frame and determine duration, unless the autobuffer attribute is present. Note that the spec changed from autobuffer to preload, which hasn't been implemented anywhere yet. Opera plans to change to the Firefox behavior of only loading enough to render a frame and determine duration by default, unless the preload attribute says otherwise.

source: http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/

like image 171
atlavis Avatar answered Sep 30 '22 19:09

atlavis