A
A
Alexey2013-10-07 15:23:18
ActionScript
Alexey, 2013-10-07 15:23:18

Chrome packaged app, webview. Why is the video from the webcam not displayed from the flash application?

I am writing a "Chrome packaged app" application with content embedded via webview. Content - a page with a flash application that is loaded from the site. It seems nothing unusual, but got into a stupor on one issue.
The flash drive accesses the webcam and outputs the image to the Video object:

private var video:Video;
private var cam:Camera;

...

video = new Video(320, 240);
stage.addChild(video);
    
cam = Camera.getCamera();
video.attachCamera(cam);

This code works on the site and in the debugger.
When the flash drive requests access to the webcam, the webview fires a "permissionrequest" event, to which I grant permission:
webview.addEventListener('permissionrequest', function(e) {
    if (e.permission === 'media') {
      e.request.allow();
    }
  });

But having received permission and not swearing anywhere, the image from the camera does not go to video. Monster Debugger shows that the dimensions of the video are zero.
Permissions in manifest:
"permissions": [
  "storage",
  "contentSettings",
    
  "webview", "pointerLock", "geolocation", "videoCapture", "audioCapture"
]

I rewrote it to Haxe, the result is the same - everything is fine on the site, when displayed through webview - nothing. Tell me where else you can dig here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2013-10-07
@VDG

I asked myself, and I will answer. It turned out the following.
A tuner and a webcam are installed on the tested computer. Both work fine in flash and are normally selected by names / indexes both through AS3 code and through the standard player settings window. I found out that in the Chrome browser in Content_Settings-> Multimedia, the tuner is selected by default, and for some reason Chrome does not work with it, and this affects the work of its desktop applications. Replaced with a webcam, and the application worked.
There is a second jamb, apparently in chrome. In the AS3 code or through the player settings window, access to a specific device " cam = Camera.getCamera("0");" is requested, but chrome only gives access to the one specified in the default settings.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question