getUserMedia in Opera 12

Opera 12 wins - the first stable desktop browser to ship getUserMedia(). I believe they had shipped it already in a mobile version of the browser.

(I'll need to fix my example from last night because Chrome Canary uses webkitGetUserMedia and also uses a stream URL to assign to video element's src)

You can start playing with it right now in Opera, no need to install nightly versions and enable secret flags. Here's how:

1. Install Opera
2. Load any page
3. Press Command + Alt + I (on a Mac) to bring the Dragonfly console (like Firebug)
4. Type:

document.body.innerHTML = '<video autoplay>';

and then

navigator.getUserMedia(
  {video:true}, 
  function(stream){document.getElementsByTagName('video')[0].src = stream}
)

This is it, enjoy :)

Ever so slightly disappointed that {audio: true} gives a "not supported" error

This entry was posted on Thursday, June 14th, 2012 and is filed under (x)HTML(5), browsers. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

4 Responses to “getUserMedia in Opera 12”

  1. John Says:

    I’m trying to find out how to enable Media Stream in Opera Mobile 12.

  2. John Says:

    Actually, I don’t need to. It already enable.

  3. hash Says:

    Seems to not work in Linux (Opera/9.80 (X11; Linux x86_64; U; ru) Presto/2.10.289 Version/12.00)

  4. Martens shoes and boots have remained popular ever since the company was establi Says:

    Hi there I am so delighted I found your web site, I really found you by accident, while I was searching on Digg for something else, Anyways I am here now and would just like to say thanks a lot for a fantastic post and a all round thrilling blog (I also love the theme/design), I don’t have time to read through it all at the moment but I have saved it and also included your RSS feeds, so when I have time I will be back to read more, Please do keep up the great job.

Leave a Reply