Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getCurrentPositionAudio:function(win, lose, args) {
var id = args[0];
try {
var p = (Media.get(id)).node.currentTime;
win(p);
} catch (err) {
lose(err);
}
},
setVolume:function(win, lose, args) {
var id = args[0];
var volume = args[1];
var thisM = Media.get(id);
thisM.volume = volume;
}
};
stopRecordingAudio:function(win, lose, args) {
var id = args[0];
var thisM = Media.get(id);
var srcUri = processUri(thisM.src);
var dest = parseUriToPathAndFilename(srcUri);
var destPath = dest.path;
var destFileName = dest.fileName;
var fsType = dest.fsType;
var success = function () {
Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
};
var error = function (reason) {
Media.onStatus(id, Media.MEDIA_ERROR, reason);
};
thisM.mediaCaptureMgr.stopRecordAsync().done(function () {
pausePlayingAudio:function(win, lose, args) {
var id = args[0];
var thisM = Media.get(id);
try {
thisM.node.pause();
Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_PAUSED);
} catch (err) {
lose("Failed to pause: "+err);
}
},