websockets bufferedAmount example

// 10k max buffer size. var THRESHOLD = 10240;   // Create a New WebSocket connection var ws = new WebSocket("ws://w3mentor.com");   // Listen for the opening event ws.onopen = function () {   // Attempt to send update every second. setInterval( function() { // Send only if the buffer is not full if (ws.bufferedAmount […]
Continue reading…

Enjoyed this post? Share it!

 
 

Handling Media Events in HTML 5 audio and video

Example which allows to play the given video: <!DOCTYPE HTML> <head> <script type="text/javascript"> function PlayVideo(){ var v = document.getElementsByTagName("video")[0]; v.play(); } </script> </head> <html> <body> <form> <video width="300" height="200" src="/html5/foo.mp4"> Your browser does not support the <video> element. </video> <input type="button" onclick="PlayVideo();" value="Play"/> </form> </body> </html> The HTML5 audio and video tag can have a […]
Continue reading…

Enjoyed this post? Share it!

 
 

Audio Attribute Specification in HTML 5

The HTML5 audio tag can have a number of attributes to control the look and feel and various functionalities of the control: Attribute Description autoplay This boolean attribute if specified, the audio will automatically begin to play back as soon as it can do so without stopping to finish loading the data. autobuffer This boolean […]
Continue reading…

Enjoyed this post? Share it!

 
 

Embedding Audio in HTML 5 Pages

HTML5 supports audio tag which is used to embed sound content in an HTML or XHTML document as follows. <audio src="foo.wav" controls autoplay> Your browser does not support the <audio> element. </audio> The current HTML5 draft specification does not specify which audio formats browsers should support in the audio tag. But most commonly used audio […]
Continue reading…

Enjoyed this post? Share it!

 
 

Video Attribute Specification in HTML 5

The HTML5 video tag can have a number of attributes to control the look and feel and various functionalities of the control: Attribute Description autoplay This boolean attribute if specified, the video will automatically begin to play back as soon as it can do so without stopping to finish loading the data. autobuffer This boolean […]
Continue reading…

Enjoyed this post? Share it!