Flash microphone access in Chome app

787 views
Skip to first unread message

Guy Gordon

unread,
Apr 10, 2014, 7:29:46 PM4/10/14
to chromi...@chromium.org
My end goal is to be able to get a single app kiosk mode application working on chromebooks for an internal network educational web app (Scholastic's Read 180 Next Generation). It is flash based and works in Chrome and on Chromebooks normally. But when I launch it in a packaged app, it launches and plays back audio but microphone access won't work. Flash tosses up its typical request for permission box, but the mic does not work. I have "audioCapture" in the permissions in the manifest (and if I view the permissions of the app in the browser, it shows as having access). For kicks, I added "videoCapture" as well (there's no need for camera, just audio), but it made no difference. I even tried adding all sorts of other permissions I thought might be getting in the way (storage ones, etc), but I just cannot get the app to properly work with the mic. If I launch the app on a Windows machine, the mic doesn't work. But if I go to the same URL that the app is loading outside of the app normally in the browser itself, the mic works just fine. The audio doesn't work in the single app kiosk launched on a chromebook, either (it does work if I sign into the Chromebook and go to the URL in the browser).

Anybody have any idea why a flash app can't access the mic in a packaged app when launched? There a trick to it I'm not finding? Here's the permission I've got set, though i've tried a dozen other random ones added for the heck of it.

"permissions": [
    "webview",
    "audioCapture",
    "videoCapture"
]

Istiaque Ahmed

unread,
Apr 10, 2014, 8:53:38 PM4/10/14
to Guy Gordon, chromi...@chromium.org
I'm assuming you are loading the Flash page inside a <webview>?
In that case do you have audio permission event firing on that element? You have to allow that: https://developer.chrome.com/apps/tags/webview#type-MediaPermissionRequest



--
You received this message because you are subscribed to the Google Groups "Chromium Apps" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-app...@chromium.org.
To post to this group, send email to chromi...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-apps/.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

Guy Gordon

unread,
Apr 10, 2014, 10:05:15 PM4/10/14
to chromi...@chromium.org, Guy Gordon
Correct. I've been trying to insert the correct bit of code, but I'm a bit of a n00b with this. I'm working off a barely modified copy of Google's sample single app kiosk code:

https://storage.googleapis.com/support-kms-prod/SNP_E1B7A409D2D20FEBD817F2C8D0C73B52B9C6_4537340_en_v2

I've been putting it into the browser.js file. Would I be correct in using the permissionrequest event handler as they show in their example here for media requests?

webview.addEventListener('permissionrequest', function(e) {
  if (e.permission === 'media') {
    e.request.allow();
  }
});
Thanks,

Guy

Istiaque Ahmed

unread,
Apr 10, 2014, 11:51:23 PM4/10/14
to Guy Gordon, chromi...@chromium.org
Yes.

Guy Gordon

unread,
Apr 11, 2014, 12:15:05 PM4/11/14
to chromi...@chromium.org, Guy Gordon
I suppose I failed to properly note in the previous post that adding that wasn't helping. The mic still won't work. I'm gonna try to take another fresh attempt at getting it to work today again. Perhaps I'm not putting it in the proper location in the js file, though I've tried quite a few possibilities.

Thanks,

Guy

Guy Gordon

unread,
Apr 24, 2014, 1:41:15 PM4/24/14
to chromi...@chromium.org, Guy Gordon
Either I'm just not getting how to allow this or something bigger is going wrong. I cannot get a kiosk app (in this case, Scholastic's Read 180 Next Generation) to get any response from the microphone. It works fine in incognito windows and such. If I launch the packaged app on a windows machine it still doesn't recognize the mic, though again it works fine on the same machine in a regular incognito window. I do consistently get the usual Flash allow/deny prompt, but no browser prompts for access (I don't get that outside of the packaged app, either, even in normal incognito sessions).

I've tried every manifest permission that I think could possibly be related. I tried the eventlistener permissionrequest statement mentioned in previous post (I'm correct in assuming is should in the the onLoad?). Nothing seems to get the mic to recognize in the packaged app. Anyone have any possible ideas of additional things that might need to be done to get it to work?

Thanks,

Guy

Guy Gordon

unread,
Apr 24, 2014, 3:16:32 PM4/24/14
to chromi...@chromium.org, Guy Gordon
Actually, I mispoke. I am getting the native Flash premission prompt on the Chromebook in Kiosk App mode (and also in the browser on the Chromebook normally - where the sound does work), but I don't see it when launching the kiosk app via the extensions tab on a Windows machine. No idea if that behavior difference means anything to anyone. With or without that prompt, the microphone does not work when launched via the kiosk app on either Chromebook or Windows. And it works fine via the same Chromebook or Windows machines in a regular browser session.

Guy

Blair Kennedy

unread,
Jul 17, 2014, 6:49:46 PM7/17/14
to chromi...@chromium.org, guy.g...@menta.com
Hi Guy,

Have you gotten any further with this?  I am stuck at this same point.

Blair.

Guy Gordon

unread,
Jul 17, 2014, 7:52:06 PM7/17/14
to Blair Kennedy, chromi...@chromium.org
Regrettably, no. I handed it off to a colleague of mine a little while back to see if a fresh set of eyes could figure it out. Since he hasn't mentioned it to me, I'm guessing that would be "no" for him as well.

Really wish I could make it work. It would make a huge difference of convenience for us to be able to put all our students into the specific app (Scholastic's Read 180 Next Generation) without them signing into the Chromebooks. I may revisit the issue again in the next couple weeks, but alas, no luck so far.

Guy

Blair Kennedy

unread,
Jul 18, 2014, 1:58:04 PM7/18/14
to chromi...@chromium.org, blair....@gmail.com
Well, it looks like I have found success in my situation.  I now have this working on an unmanaged chromebook launching the application in kiosk mode.  The issue ended up being a simple JavaScript error, a missing parenthesis.  It was keeping me from properly registering the webview.addEventListener.  I was able to get into debug mode and look at the JavaScript console, which was really the breakthrough.  There, I could see what the issue was as well as watch the 'media' requests being denied or approved.  I added a couple of console.log messages to make sure the media access requests were being granted.  Here is what shows up in the console log when I had things working correctly:

2permission requested application.js:13
media permission requested application.js:9
permission requested application.js:13
media permission requested application.js:9
permission requested application.js:13
media permission requested application.js:9
permission requested application.js:13
media permission requested application.js:9
permission requested  

My app is just a very simple prototype to demo doing A/V in a kiosk.  I reset my approach and just started with a very simple example on the google developer site.  I used the service meetings.io for the demonstration, which is a flash application.  Here are my files.  Hopefully, they will be helpful in solving the issue for you.

Blair.

------- files from my project ----------

application.js
window.onload = function() {
 document.querySelector('#reset').onclick = function() {
   window.close();
 }

 var webview = document.getElementById("map");
 webview.addEventListener('permissionrequest', function(e) {
   if (e.permission === 'media') {
     console.log("media permission requested");
     e.request.allow();
   }

  console.log("permission requested");
 });


}

application.html (note: you will need to supply your own room id in the webview src attribute)
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Muse Kiosk App</title>
    <script src="application.js"></script>
    <link rel="stylesheet" type="text/css" href="application.css">
  </head>


  <body>
    <button id="reset">Reset</button>
    <webview id="map" src="https://meetings.io/embed/?room= **you need to put your own room id in here ** "></webview>
  </body>
</html>

application.css
webview {
 height: 100%;
 width: 100%;
}

#menubar {
  margin-bottom:2px;
  margin-top:0px;
  padding:0px;
}


button {
 left: auto;
 position: absolute;
 right: 6px;
}


background.js 
chrome.app.runtime.onLaunched.addListener(function() {
 var options = {
   'id': 'App Id',
   'bounds': {
     'width': 1024,
     'height': 768
   }
 };
 chrome.app.window.create('application.html', (options));
});

manifest.json
{
  "name": "My App",
  "description": "My test application",
  "version": "0.0.0.10",
  "manifest_version": 2,
  "icons": {
    "128": "icon_128.png"
  },
  "app": {
    "background": {
        "scripts": [ "background.js" ],
        "persistent": false
    }
  },
  "permissions": ["webview", "audioCapture", "videoCapture"],
  "kiosk_enabled" : true
}

jga...@fjuhsd.org

unread,
Jan 25, 2018, 12:14:22 PM1/25/18
to Chromium-Apps-Announce
I had this same issue yesterday in a classroom.  I noticed, after I closed the read180 app and website, because they pop up separately, that in the Google Chrome, the little flash guy is in the corner of the address bar.  If you click on him you will see two options.  One says always block microphone access to Read180 and the others says to always allow.  It's frustrating, because it doesn't show up on the Read180 page that's open.
Reply all
Reply to author
Forward
0 new messages