Re: Using camera on mobile devices to take a photo

  •  08-07-2015, 3:54 PM

    Re: Using camera on mobile devices to take a photo

    For anyone else who want to use <input accept="image/*" capture="camera" type="file" /> 

    function CuteWebUI_AjaxUploader_OnInitialize() {
        var hidden = this;
        var _addonobject = hidden.internalobject.addonobject;
        // set accept and capture attributes
        _addonobject.setAttribute("accept", "image/*");
        _addonobject.setAttribute("capture", "camera");

        // save the native setAttribute method
        _addonobject._setAttribute = _addonobject.setAttribute;
        // override the native setAttribute method
        _addonobject.setAttribute = function (name, value) {
            // call the native method for any attribute except accept
            if (name !== "accept")
                _addonobject._setAttribute(name, value);
        };
    }
View Complete Thread