You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2018/05/25 04:44:27 UTC

[cordova-plugin-camera] branch master updated: CB-13384: (browser) Added deprecation of video.src compatibility (#288)

This is an automated email from the ASF dual-hosted git repository.

shazron pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-camera.git


The following commit(s) were added to refs/heads/master by this push:
     new 5163d38  CB-13384: (browser) Added deprecation of video.src compatibility (#288)
5163d38 is described below

commit 5163d3846558c70753af0d232bec762f337f2c66
Author: Matthew Vander Vliet <va...@gmail.com>
AuthorDate: Thu May 24 22:44:23 2018 -0600

    CB-13384: (browser) Added deprecation of video.src compatibility (#288)
    
    * CB-13384: (browser) Added deprecation of video.src compatibility
    
    * CB-13384: Updated to reflect property detection rather than deprecation exception.
---
 src/browser/CameraProxy.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/browser/CameraProxy.js b/src/browser/CameraProxy.js
index 362420e..ff81257 100644
--- a/src/browser/CameraProxy.js
+++ b/src/browser/CameraProxy.js
@@ -102,9 +102,12 @@ function capture (success, errorCallback, opts) {
 
     var successCallback = function (stream) {
         localMediaStream = stream;
-        video.src = window.URL.createObjectURL(localMediaStream);
+        if ('srcObject' in video) {
+            video.srcObject = localMediaStream;
+        } else {
+            video.src = window.URL.createObjectURL(localMediaStream);
+        }
         video.play();
-
         document.body.appendChild(parent);
     };
 

-- 
To stop receiving notification emails like this one, please contact
shazron@apache.org.

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org