How to use the cordova-plugin-media.Media.get function in cordova-plugin-media

To help you get started, we’ve selected a few cordova-plugin-media examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / cordova-plugin-media / src / windows / MediaProxy.js View on Github external
getCurrentPositionAudio:function(win, lose, args) {
        var id = args[0];
        try {
            var p = (Media.get(id)).node.currentTime;
            win(p);
        } catch (err) {
            lose(err);
        }
    },
github apache / cordova-plugin-media / src / windows / MediaProxy.js View on Github external
setVolume:function(win, lose, args) {
        var id = args[0];
        var volume = args[1];
        var thisM = Media.get(id);
        thisM.volume = volume;
    }
};
github apache / cordova-plugin-media / src / windows / MediaProxy.js View on Github external
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 () {
github apache / cordova-plugin-media / src / windows / MediaProxy.js View on Github external
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);
        }
    },