Dev Corner - HTML 5 Video Player with multiple video streams
Posted on Thursday October 13, 2011 by Randall Brown
This week's Dev Corner post comes from Mike Luongo and details using HTML5 to create a video player that lets you play multiple video streams at once.
HTML5 video player with PIP that is movable/sizeable/opaciable
I've been playing around with html5 and I have to say it's an exciting new technology! That's right it really deserves a bunch of !!!!! Why is it so cool? With just with a little bit of javascript (yawn) I was able to create a PIP (picture in picture) player with opacity for the web. This example lets you click and drag around the pip (even off the original video). You can click the video and make it large. So you might want to check it out here:
HTML 5 PiP Demo ( Works best in Chrome )
For a long article on how all this works check out this link: Dive into html5
The most important part of the article could probably be found in this single screen capture.
These are the video types that are supported by browsers. Note that you can give a video tag in html5 multiple source videos and if it is unable to play one of them it will try the next.
HTML5 PIP is something we might be able to use right now but would require more research and testing to figure that out. What we can take from this example is that it is an exciting preview of what is to come. The playback should only get better over time and better supported.

Michael Luongo is a software engineer who joined TechSmith in 1999 when the company was about 10 employees. Since joining he has worked on almost every product at TechSmith. He is currently working on the Camtasia Relay team. In his spare time Michael enjoys working on old cars which include a 62 Chevy Corvair, Manx dune buggy, and other vehicles. He also enjoys learning about new technologies. He recently finished a 3D first person shooter in Silverlight and is at work developing his first app for Android.


Comments (7)
Hello Michael and Betsy. Nice information and content here. The link to Dive into HTML5 is not working correctly when I click on it. It gives me a 410 Error.
Also, Michael a video tutorial on how you would make this work with Camtasia Studio 7 for PC would be great to see. Just my opinion and keep up the great work. I see HTML5 video player being a winner in my book. Lots of new things to learn.
Thanks,
Fred G.
Posted by Fred G. | October 15, 2011 10:29 AM
Posted on October 15, 2011 10:29
If you download the sample code, you should be able to replace the videos with your own videos.
One thing to be wary of is the video formats that you use. Like the graph shows, not all browsers support all formats. The videos in the demo are Ogg Theora files which Camtasia doesn't currently output.
Posted by Randall | October 15, 2011 12:36 PM
Posted on October 15, 2011 12:36
Works best in Chrome? Come now. This is the HTML5 generation. This type of works-best-in nonsense is from the Lost Decade...
Posted by Tron | October 18, 2011 1:17 PM
Posted on October 18, 2011 13:17
Your demo doesn't work in Firefox because the elements' children don't include a type="video/ogg" attribute. Chrome (and Safari) do content sniffing in the absence of a mime type, whereas Firefox (and IE, and I suspect Opera) do not.
Posted by Chris Pearce | October 18, 2011 5:28 PM
Posted on October 18, 2011 17:28
@Chris, Opera does do content sniffing, but it's best practice to add the type attribute anyway so the browser doesn't have to try and find it. A good write up on the video tag: http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/
Posted by Jon Packer | October 18, 2011 11:53 PM
Posted on October 18, 2011 23:53
@Jon: The demo didn't work for me in Opera, so it appears Opera does not sniff at least in the case of a child source element without a type attribute.
Posted by Chris Pearce | October 19, 2011 1:09 AM
Posted on October 19, 2011 01:09
Hello,
i have a .mkv file with 2 video stream's in it.
While playback in html5 tag video , how do we select a specific stream ?
i have tried
src="1234.mkv#Strem 0"
src="1234.mkv#1"
but no luck....
Best Regards
Prasanth.k
Posted by prasanthk | January 19, 2012 2:22 PM
Posted on January 19, 2012 14:22