Commit 2e21ded1 authored by ldeluca's avatar ldeluca
Browse files
parents 294d2e33 d7391167
Loading
Loading
Loading
Loading
+6 −1
Changes for plugin.xml: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ id="org.apache.cordova.media"
    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git</repo>
    <issue>https://issues.apache.org/jira/browse/CB/component/12320647</issue>
    
    <dependency id="org.apache.cordova.file" version="1.0.1" />
    <dependency id="org.apache.cordova.file" version=">=1.0.1" />

    <js-module src="www/MediaError.js" name="MediaError">
        <clobbers target="window.MediaError" />
@@ -151,6 +151,11 @@ id="org.apache.cordova.media"
        <js-module src="src/windows8/MediaProxy.js" name="MediaProxy">
            <merges target="" />
        </js-module>

        <config-file target="package.appxmanifest" parent="/Package/Capabilities">
            <Capability Name="musicLibrary" />
            <DeviceCapability Name="microphone" />
        </config-file>
    </platform>

    <!-- tizen -->
+6 −6
Changes for src/windows8/MediaProxy.js: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -131,20 +131,19 @@ module.exports = {
        thisM.mediaCaptureMgr.initializeAsync(captureInitSettings).done(function (result) {
            thisM.mediaCaptureMgr.addEventListener("recordlimitationexceeded", lose);
            thisM.mediaCaptureMgr.addEventListener("failed", lose);
        }, lose);
            
            // Start recording
            Windows.Storage.KnownFolders.musicLibrary.createFileAsync(src, Windows.Storage.CreationCollisionOption.replaceExisting).done(function (newFile) {
                var storageFile = newFile;
            var fileType = this.src.split('.').pop();
                var encodingProfile = null;
            switch (fileType) {
                case 'm4a':
                switch (newFile.fileType) {
                    case '.m4a':
                        encodingProfile = Windows.Media.MediaProperties.MediaEncodingProfile.createM4a(Windows.Media.MediaProperties.AudioEncodingQuality.auto);
                        break;
                case 'mp3':
                    case '.mp3':
                        encodingProfile = Windows.Media.MediaProperties.MediaEncodingProfile.createMp3(Windows.Media.MediaProperties.AudioEncodingQuality.auto);
                        break;
                case 'wma':
                    case '.wma':
                        encodingProfile = Windows.Media.MediaProperties.MediaEncodingProfile.createWma(Windows.Media.MediaProperties.AudioEncodingQuality.auto);
                        break;
                    default:
@@ -153,6 +152,7 @@ module.exports = {
                }
                thisM.mediaCaptureMgr.startRecordToStorageFileAsync(encodingProfile, storageFile).done(win, lose);
            }, lose);
        }, lose);
    },

    // Stop recording audio