startPlayingAudio: function()

in src/windows/MediaProxy.js [108:131]


    startPlayingAudio: function (win, lose, args) {
        var id = args[0];
        // var src = args[1];
        // var options = args[2];

        var thisM = Media.get(id);
        // if Media was released, then node will be null and we need to create it again
        if (!thisM.node) {
            args[2] = true; // Setting createAudioNode to true
            if (!module.exports.create(win, lose, args)) {
                // there is no reason to continue if we can't create media
                // corresponding callback has been invoked in create so we don't need to call it here
                return;
            }
        }

        try {
            thisM.node.play();
        } catch (err) {
            if (lose) {
                lose({ code: MediaError.MEDIA_ERR_ABORTED });
            }
        }
    },