Display Below error in Safari.
Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
My Code is:
function createObjectURL(object) {
return (window.URL) ? window.URL.createObjectURL(object) : window.webkitURL.createObjectURL(object);
}
This is my Code for image:
function myUploadOnChangeFunction() {
if (this.files.length) {
for (var i in this.files) {
if (this.files.hasOwnProperty(i)) {
var src = createObjectURL(this.files[i]);
var image = new Image();
image.src = src;
imagSRC = src;
$('#img').attr('src', src);
}
}
}
}
If you are using angular this tutorial will be helpful: link. However you will need to replace this line:
with this, since createObjectURL() is deprecated on chrome for MediaStream.