Camera access from a web page in Opera Next

, , , , ,

In 1969, we were told that someday, you'll be a star, and after great efforts from the open web community, that time has come! Access to the camera from a web page through JavaScript (getUserMedia) is possible. Grab the latest Opera Next version from the desktop team blog!

Let's rewind a bit. On October 2011 and January 2012, we released desktop Labs builds for testing getUserMedia. Your feedback has been valuable and helped fixed issues.

The first time you access a web page that requests access to the camera, you will get a notification requesting you to authorize it. It's time to rush to the bathroom, fix your hair, make up, change your shirt and smile. If you are not satisfied, you can deny right away.

Then you might want to change these settings later on - perhaps your image on the camera was not what you were expecting. Just click on the icon on the address bar and a menu pops up.

Good! Now you have the choice in between a few options: Always, Allow once or Deny.

There will always be an icon in the toolbar or the tab to tell you that the camera access is ongoing in case you had forgotten. It's worth noting that we do something similar for sites that request access to your geolocation.

The API for accessing the camera is fairly simple.

navigator.getUserMedia({audio: true, video: true}, success, error);

 function success(stream) {
  // ... use 'stream' ...
  }
 
  function error(){
  //display fallback content
  }

You can find more code samples and advanced examples in Daniel Davis' Dev.Opera article about getUserMedia.

And because we all need a moustache to be a star:

Time for you to code your project and share with us.

Opera's Turkish fans opening the WebA bright future for Opera extensions; end of the road for Unite apps and Widgets

Comments

Charles SchlossChas4 Tuesday, April 17, 2012 1:02:46 PM

he he Mustache adding Power has been given to Opera next

interesting the details on security info from clicking in the address bar work in Next and not 11.62 for me

Karl Dubostkarlcow Tuesday, April 17, 2012 1:20:08 PM

Charles, I guess it's part of Opera Next features.

nahtanoj999 Wednesday, April 18, 2012 2:05:04 AM

Is there a way to make allow once the default? This new build adds two extra clicks to selecting it.

Michael A. Puls IIburnout426 Wednesday, April 18, 2012 9:18:45 AM

Originally posted by nahtanoj999:

Is there a way to make allow once the default?

I was thinking the same thing

Michael A. Puls IIburnout426 Wednesday, April 18, 2012 12:09:26 PM

audio: true

Does audio capture from microphone device work at all?

Maycel Viernes y Bordeymaycelbordeyviernes Wednesday, May 9, 2012 4:43:25 AM

smile

Karl Dubostkarlcow Tuesday, June 5, 2012 10:00:33 AM

Michael: not yet. see http://caniuse.com/#feat=audio-api

Michael A. Puls IIburnout426 Tuesday, June 5, 2012 10:22:10 AM

Originally posted by karlcow:

Michael: not yet. see http://caniuse.com/#feat=audio-api

Ah, so Audio API support is required for that to work then. Didn't think that'd be the case for this. thanks.

George Blacktennisfan1978 Tuesday, June 5, 2012 1:25:54 PM

This is why Opera is the best browser! Please, continue with your great work!

Write a comment

New comments have been disabled for this post.