Created
November 10, 2015 16:45
-
-
Save kmturley/164fe4c659b3b06b8f96 to your computer and use it in GitHub Desktop.
Extending video editor functionality
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// VideoEditor.js | |
// | |
// Created by Josh Bavari on 01-14-2014 | |
// Modified by Ross Martin on 01-29-15 | |
// | |
var exec = require('cordova/exec'), | |
pluginName = 'VideoEditor'; | |
function VideoEditor() {} | |
VideoEditor.prototype.transcodeVideo = function (successCallback, fail, options) { | |
// https://github.com/apache/cordova-plugin-file-transfer/blob/master/www/FileTransfer.js#L197 | |
var self = this, | |
win = function (result) { | |
if (typeof result.lengthComputable !== "undefined") { | |
if (self.onprogress) { | |
self.onprogress(result); | |
} | |
} else { | |
successCallback(result); | |
} | |
}; | |
exec(win, fail, pluginName, 'transcodeVideo', [options]); | |
}; | |
VideoEditor.prototype.createThumbnail = function (success, error, options) { | |
exec(success, error, pluginName, 'createThumbnail', [options]); | |
}; | |
VideoEditor.prototype.killVideoProcessor = function (success, error, options) { | |
exec(success, error, pluginName, 'killVideoProcessor', [options]); | |
}; | |
module.exports = new VideoEditor(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment