diff --git a/web_widget_image_webcam/__manifest__.py b/web_widget_image_webcam/__manifest__.py index d547e04cb..b86b3d7bd 100644 --- a/web_widget_image_webcam/__manifest__.py +++ b/web_widget_image_webcam/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Web Widget - Image WebCam", "summary": "Allows to take image with WebCam", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "category": "web", "website": "https://github.com/OCA/web", "author": "Tech Receptives, " diff --git a/web_widget_image_webcam/readme/CONFIGURE.rst b/web_widget_image_webcam/readme/CONFIGURE.rst index 409ad16ba..bfcfc6cf5 100644 --- a/web_widget_image_webcam/readme/CONFIGURE.rst +++ b/web_widget_image_webcam/readme/CONFIGURE.rst @@ -1,9 +1,9 @@ By default, the module works with all `major browsers -`_. +`_. An important note for **Chrome 47+** users - this module only works with websites delivered over SSL / HTTPS. Visit this for `more info -`_. +`_. But, If you still want this module to work with websites without SSL / HTTPS. Here is the steps to do it easily (Always run in Adobe Flash fallback mode, but it is not desirable). diff --git a/web_widget_image_webcam/static/src/js/webcam_widget.js b/web_widget_image_webcam/static/src/js/webcam_widget.js index ec050868f..190b8dde0 100644 --- a/web_widget_image_webcam/static/src/js/webcam_widget.js +++ b/web_widget_image_webcam/static/src/js/webcam_widget.js @@ -2,7 +2,7 @@ Copyright 2016 Siddharth Bhalgami License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ -odoo.define("web_widget_image_webcam.webcam_widget", function(require) { +odoo.define("web_widget_image_webcam.webcam_widget", function (require) { "use strict"; var core = require("web.core"); @@ -14,7 +14,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { var QWeb = core.qweb; FieldBinaryImage.include({ - _render: function() { + _render: function () { this._super(); var self = this, @@ -38,7 +38,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { rpc.query({ model: "ir.config_parameter", method: "get_webcam_flash_fallback_mode_config", - }).then(function(default_flash_fallback_mode) { + }).then(function (default_flash_fallback_mode) { if (default_flash_fallback_mode == 1) { Webcam.set({ /* @@ -53,7 +53,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { self.$el .find(".o_form_binary_file_web_cam") .off() - .on("click", function() { + .on("click", function () { // Init Webcam var dialog = new Dialog(self, { size: "large", @@ -64,8 +64,8 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { { text: _t("Take Snapshot"), classes: "btn-primary take_snap_btn", - click: function() { - Webcam.snap(function(data) { + click: function () { + Webcam.snap(function (data) { img_data = data; // Display Snap besides Live WebCam Preview WebCamDialog.find("#webcam_result").html( @@ -82,7 +82,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { text: _t("Save & Close"), classes: "btn-primary save_close_btn", close: true, - click: function() { + click: function () { var img_data_base64 = img_data.split(",")[1]; /* @@ -119,7 +119,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { ], }).open(); - dialog.opened().then(function() { + dialog.opened().then(function () { Webcam.attach("#live_webcam"); // At time of Init "Save & Close" button is disabled @@ -135,7 +135,7 @@ odoo.define("web_widget_image_webcam.webcam_widget", function(require) { }); Dialog.include({ - destroy: function() { + destroy: function () { // Shut Down the Live Camera Preview | Reset the System Webcam.reset(); this._super.apply(this, arguments); diff --git a/web_widget_image_webcam/static/src/lib/webcam.js b/web_widget_image_webcam/static/src/lib/webcam.js index 80af68910..dd945d59d 100644 --- a/web_widget_image_webcam/static/src/lib/webcam.js +++ b/web_widget_image_webcam/static/src/lib/webcam.js @@ -1,9 +1,9 @@ -// WebcamJS v1.0.25 +// WebcamJS v1.0.26 // Webcam library for capturing JPEG/PNG images in JavaScript // Attempts getUserMedia, falls back to Flash // Author: Joseph Huckaby: http://github.com/jhuckaby // Based on JPEGCam: http://code.google.com/p/jpegcam/ -// Copyright (c) 2012 - 2017 Joseph Huckaby +// Copyright (c) 2012 - 2019 Joseph Huckaby // Licensed under the MIT License (function(window) { @@ -34,7 +34,7 @@ FlashError.prototype = new IntermediateInheritor(); WebcamError.prototype = new IntermediateInheritor(); var Webcam = { - version: '1.0.25', + version: '1.0.26', // globals protocol: location.protocol.match(/https/i) ? 'https' : 'http', @@ -92,10 +92,6 @@ var Webcam = { window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL; this.userMedia = this.userMedia && !!this.mediaDevices && !!window.URL; - if (this.iOS) { - this.userMedia = null; - } - // Older versions of firefox (< 21) apparently claim support but user media does not actually work if (navigator.userAgent.match(/Firefox\D+(\d+)/)) { if (parseInt(RegExp.$1, 10) < 21) this.userMedia = null; @@ -274,6 +270,7 @@ var Webcam = { // setup webcam video container var video = document.createElement('video'); video.setAttribute('autoplay', 'autoplay'); + video.setAttribute('playsinline', 'playsinline'); video.style.width = '' + this.params.dest_width + 'px'; video.style.height = '' + this.params.dest_height + 'px';