Open ctetreault opened 12 years ago
@erik54 - its just permission, I think you just need to listen to the media events.
in the browser it shows up as a toast.
I'm using the following source code in the browser and also within an WebWork apps screen:
<div data-bb-type="screen">
<video autoplay controls></video>
<script type="text/javascript">
function onFailSoHard(ex) {
console.log(ex);
}
navigator.getUserMedia = navigator.getUserMedia||navigator.webkitGetUserMedia||false;
if(!!navigator.getUserMedia) {
navigator.getUserMedia({audio: true, video: true}, function(stream) {
var video = document.querySelector('video');
video.src = ('webkitURL' in window)?window.webkitURL.createObjectURL(stream):stream;
}, onFailSoHard);
} else {
alert("not supported"); // fallback.
}
</script>
</div>
This is working in the browser with a toast message asking for the permission to use the front or rear camera, but I needed to remove the <meta name="viewport" ... />
tag from the HTML head to get it working.
The issues I figured out in the browser can be seen in the pictures below.
So it seems to be like a browser tab in the videos viewport and also seem to be really buggy at this time of usage.
On the other hand I tried to use the above source code together with permission <rim:permit>use_camera</rim:permit>
and it doesn't seem to work for me like @ctetreault mentioned. It asked me for permission to use the camera but it shows nothing in the video element like using it from the website. Something missing there??
I'm on BB10 Dev Alpha OS 10.0.9.338 using the latest WebWorks SDK 1.0.2.9.
Yes we need to investigate this.
~Nukul
From: RonMen [mailto:notifications@github.com] Sent: Friday, October 05, 2012 05:25 AM To: blackberry/BB10-WebWorks-Framework BB10-WebWorks-Framework@noreply.github.com Cc: Nukul Bhasin Subject: Re: [BB10-WebWorks-Framework] getUserMedia does not work in a WebWorks application (#274)
I'm using the following source code in the browser and also within an WebWork apps screen:
This is working in the browser with a toast message asking for the permission to use the front or rear camera, but I needed to remove the <meta name="viewport" ... /> tag from the HTML head to get it working.
The issues I figured out in the browser can be seen in the pictures below.
So it seems to be like a browser tab in the videos viewport and also seem to be really buggy at this time of usage.
On the other hand I tried to use the above source code together with permission rim:permituse_camera/rim:permit and it doesn't seem to work for me like @ctetreaulthttps://github.com/ctetreault mentioned. It asked me for permission to use the camera but it shows nothing in the video element like using it from the website. Something missing there??
I'm on BB10 Dev Alpha OS 10.0.9.338 using the latest WebWorks SDK 1.0.2.9.
— Reply to this email directly or view it on GitHubhttps://github.com/blackberry/BB10-WebWorks-Framework/issues/274#issuecomment-9170013.
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
BTW: will it be possible to use the getUserMedia and send the stream using something like WebRTC in the future like discussed here: http://www.html5rocks.com/en/tutorials/webrtc/basics/
@RonMen We have created the user story to investigate it and will do as soon as we can.
That sounds interesting. Hope you got something running. Would be really great to work with that not only in browser like Chrome supporting a peer2peer connection.
Hi there. I updated my Dev Alpha to OS version 10.0.9.1103 and wanted to give it another try with this but it doesn't work like expected, no dialog comes up to request permission for camera and also nothing else happens, also no errors in web inspector.
Since the window.* and navigator.* got extended with some new functionality I wanted to go deeper into it, implementing an app to connect to a webRTC server running here since the window.webkitRTCPeerConnection (and window.webkitPeerConnection00) available, so I guess I could give it a try to get an app up an running?
Some app samples out thee showing how it works?
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
Hi Ken. I updated to WebWorks SDK 1.0.3.8 yesterday before going on with the getUserMedia. I also use <rim:permit>use_camera</rim:permit>
within the config.xml of the project. The provided source code of my earlier posts was working only in the browser, but right now it isn't working, neither in the browser nor as an app.
@tohman - can you please help @RonMen get up and running? since @tohman enabled the feature in WebWorks
THX @nukulb, would be very nice if @tohman can assist to get it up and running!
@RonMen, it works for me with WebWorks SDK 1.0.3.8 and 10.0.9.1103 build. Please see code I used below. I saw you already have use_camera capability in your config.xml.
config.xml
<rim:permissions>
<rim:permit>use_camera</rim:permit>
</rim:permissions>
index.html
<html>
<head>
<title>getUserMedia</title>
</head>
<body>
<div data-bb-type="screen">
<video autoplay controls></video>
<script src="local:///chrome/webworks.js" type="text/javascript"></script>
<script type="text/javascript">
function onFailSoHard(ex) {
console.log(ex);
}
navigator.getUserMedia = navigator.getUserMedia||navigator.webkitGetUserMedia||false;
if(!!navigator.getUserMedia) {
navigator.getUserMedia({audio: true, video: true}, function(stream) {
var video = document.querySelector('video');
video.src = ('webkitURL' in window)?window.webkitURL.createObjectURL(stream):stream;
}, onFailSoHard);
} else {
alert("not supported"); // fallback.
}
</script>
</div>
</body>
</html>
Hi @tohman. I tried again, but it doesn't work on BB10 Dev Alpha with the code on latest WebWorks 1.0.3.8 and BB10 OS 10.0.9.1103 available for me.
@RonMen, can you send me your widget with that code and I can look into it and to try it on?
@tohman, I send you an email togehter with the attached project files and some more questions. Looking forward for an answer. THX
.getUserMedia does not appear to work when packaged in a WebWorks application. It works fine when the app is run in the browser.
It does not ask for permissions when the application loads, the way it does in the browser. This may be related.