webcamjs icon indicating copy to clipboard operation
webcamjs copied to clipboard

Feature Request: callback hook for Flash being used

Open lillereven opened this issue 11 years ago • 4 comments

I just ran into the problem of having to raise the z-index of the div containing the webcam (particular app problem, nothing to do with webcam.js per se).

I implemented an additional callback hook to inform me when Flash gets loaded. Works nicely for IE8 and Safari7, probably everywhere else, too.

line 145:

    // flash fallback
    var div = document.createElement('div');
    div.innerHTML = this.getSWFHTML();
    elem.appendChild(div);
    // tell the world
    this.dispatch('flash');

lillereven avatar Oct 24 '14 22:10 lillereven

Thanks! I'll include this in the next release. Leaving this issue open so I don't forget.

jhuckaby avatar Nov 16 '14 07:11 jhuckaby

@lillereven Hello!, there's any solution for this problem without using the SWFHTML element?, i'm using it for a WebApp on some Mobile Browsers, and by default does not support SWF natively.

Thanks.

davidlares avatar Mar 16 '17 20:03 davidlares

IIRC, this solved a particular problem where I needed the div containing the webcam to be on top on everything else. All this does is to emit an event when the flash fallback is activated, and that the app listens for to adjust the camera div's z-index. No, this wouldn't work on mobile since the flash fallback would/should never activate. Not sure how/if that would translate to activation of a built-in camera. That said, I am presuming you're doing this on HTML5 with a somewhat recent browser core. Have a look at this: https://davidwalsh.name/browser-camera

lillereven avatar Mar 16 '17 20:03 lillereven

@lillereven I'll take a look rightaway, the main problem is focused on the canvas generated, I need to insert a custom markdown for the resulting image, but the image is positioning on top of the custom image.

The combo position:absolute and negative z-index is not working properly.

Once again, thanks.

davidlares avatar Mar 16 '17 20:03 davidlares