Skip to content

Commit

Permalink
Cordova Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfriedmann committed Feb 25, 2020
1 parent 20423ff commit 4833924
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ziggeo Client SDK 2.35.4
# Ziggeo Client SDK 2.35.5


Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"type": "git",
"url": "git://github.com/Ziggeo/ziggeo-client-sdk.git"
},
"version": "2.35.4"
"version": "2.35.5"
}
2 changes: 1 addition & 1 deletion build/playerjs-adapter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/ziggeo.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/ziggeo.js

Large diffs are not rendered by default.

Binary file modified dist/locales.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/ziggeo-locales.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 55 additions & 23 deletions dist/ziggeo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
ziggeo-client-sdk - v2.35.4 - 2020-02-14
ziggeo-client-sdk - v2.35.5 - 2020-02-25
Copyright (c) Ziggeo
Closed Source Software License.
*/
Expand Down Expand Up @@ -2373,8 +2373,8 @@ Scoped.binding('module', 'root:BetaJS');
Scoped.define("module:", function () {
return {
"guid": "71366f7a-7da3-4e55-9a0b-ea0e4e2a9e79",
"version": "1.0.201",
"datetime": 1579055706652
"version": "1.0.203",
"datetime": 1582639311870
};
});

Expand Down Expand Up @@ -14874,7 +14874,7 @@ Scoped.define("module:Upload.FormDataFileUploader", ["module:Upload.FileUploader
}, {

supported: function(options) {
if (Info.isInternetExplorer() && Info.internetExplorerVersion() <= 9)
if (Info.isInternetExplorer() && Info.internetExplorerVersion() <= 9 || Info.isCordova())
return false;
try {
new(window.FormData)();
Expand Down Expand Up @@ -14973,7 +14973,7 @@ Scoped.define("module:Upload.FormIframeFileUploader", ["module:Upload.FileUpload
});
});

Scoped.define("module:Upload.CordovaFileUploader", ["module:Upload.FileUploader","module:Info","base:Promise"], function(FileUploader, Info, Promise, scoped) {
Scoped.define("module:Upload.CordovaFileUploader", ["module:Upload.FileUploader","module:Info","base:Promise","base:Ajax.Support","base:Objs"], function(FileUploader, Info, Promise, AjaxSupport, Objs, scoped) {
return FileUploader.extend({
scoped: scoped
}, {
Expand Down Expand Up @@ -15004,32 +15004,64 @@ Scoped.define("module:Upload.CordovaFileUploader", ["module:Upload.FileUploader"

_upload: function() {
return this._acquirePermission().mapSuccess(function() {
var self = this;
//var fileURI = this._options.source.localURL;
var fileURI = this._options.source.fullPath.split(':')[1];
var fileUploadOptions = new window.FileUploadOptions();
fileUploadOptions.fileKey = "file";
fileUploadOptions.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
fileUploadOptions.mimeType = this._options.source.type;
fileUploadOptions.httpMethod = this._options.method;
fileUploadOptions.params = this._options.data;
var fileTransfer = new window.FileTransfer();
fileTransfer.upload(fileURI, this._options.url, function(data) {
self._successCallback(data);
}, function(data) {
self._errorCallback(data);
}, fileUploadOptions);
return window.resolveLocalFileSystemURL ? this._uploadWithLocalFileSystem() : this._uploadWithPlugin();
}, this);
}
},

_uploadWithPlugin: function() {
var self = this;
//var fileURI = this._options.source.localURL;
var fileURI = this._options.source.fullPath.split(':')[1];
var fileUploadOptions = new window.FileUploadOptions();
fileUploadOptions.fileKey = "file";
fileUploadOptions.fileName = fileURI.substr(fileURI.lastIndexOf('/') + 1);
fileUploadOptions.mimeType = this._options.source.type;
fileUploadOptions.httpMethod = this._options.method;
fileUploadOptions.params = this._options.data;
var fileTransfer = new window.FileTransfer();
fileTransfer.upload(fileURI, this._options.url, function(data) {
self._successCallback(data);
}, function(data) {
self._errorCallback(data);
}, fileUploadOptions);
},

_uploadWithLocalFileSystem: function() {
var self = this;
var fileURI = this._options.source.fullPath;
window.resolveLocalFileSystemURL(fileURI, function(fileEntry) {
fileEntry.file(function(file) {
var reader = new FileReader();
reader.onloadend = function() {
// Create a blob based on the FileReader "result", which we asked to be retrieved as an ArrayBuffer
var blob = new Blob([new Uint8Array(this.result)], {
type: self._options.source.type
});
var data = Objs.clone(self._options.data || {}, 1);
data.file = blob;
return AjaxSupport.execute({
method: self._options.method,
uri: self._options.url,
decodeType: "text",
data: data
}, self._progressCallback, self).success(self._successCallback, self).error(self._errorCallback, self);
};
// Read the file as an ArrayBuffer
reader.readAsArrayBuffer(file);
}, function(err) {
self._errorCallback(err);
});
}, function(err) {
self._errorCallback(err);
});
}
}, {

supported: function(options) {
var result = !!navigator.device &&
!!navigator.device.capture &&
!!navigator.device.capture.captureVideo &&
!!window.FileTransfer &&
!!window.FileUploadOptions &&
!!(window.resolveLocalFileSystemURL || (window.FileTransfer && window.FileUploadOptions)) &&
!options.isBlob &&
("localURL" in options.source);
return result;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ziggeo-client-sdk",
"description": "Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only two lines of code in your site, service or app. This is the JavaScript Client SDK.",
"version": "2.35.4",
"version": "2.35.5",
"author": "Ziggeo",
"repository": "https://github.com/Ziggeo/ziggeo-client-sdk.git",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ziggeo-preprocessed.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4833924

Please sign in to comment.