You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by daserge <gi...@git.apache.org> on 2015/06/29 14:42:20 UTC

[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

GitHub user daserge opened a pull request:

    https://github.com/apache/cordova-plugin-media/pull/58

    CB-9238 Media plugin cannot record audio on windows

    Reworked Windows proxy to support ms-appdata file paths (temporaryFolder and localFolder) instead of app package' folders (ms-appx) as ms-appx is readonly
    Fixed release method to avoid Access is denied exception on Windows
    Added MEDIA_RUNNING and MEDIA_ERROR states firing to record-related methods on Windows
    Reworked Windows proxy to not to create Audio object in case of record mode
    Adds releaseAudio to record manual test to avoid Access denied errors on Windows
    Updates Windows test to use ms-appdata file path (via toURL)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-media CB-9238

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-media/pull/58.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #58
    
----
commit 79e466ffa2dad270eab3ab4c841b1b1d72d0073a
Author: daserge <da...@yandex.ru>
Date:   2015-06-29T08:49:00Z

    CB-9238 Media plugin cannot record audio on windows
    
    Reworked Windows proxy to support ms-appdata file paths (temporaryFolder and localFolder) instead of app package' folders (ms-appx) as ms-appx is readonly
    Fixed release method to avoid Access is denied exception on Windows
    Added MEDIA_RUNNING and MEDIA_ERROR states firing to record-related methods on Windows
    Reworked Windows proxy to not to create Audio object in case of record mode
    Adds releaseAudio to record manual test to avoid Access denied errors on Windows
    Updates Windows test to use ms-appdata file path (via toURL)

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482157
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -203,20 +234,64 @@ module.exports = {
             var id = args[0];
             var thisM = Media.get(id);
     
    -        var normalizedSrc = thisM.src.replace(/\//g, '\\');
    +        var success = function () {
    +            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
    +            win();
    +        };
    +
    +        var error = function (reason) {
    +            Media.onStatus(id, Media.MEDIA_ERROR, reason);
    +            lose(reason);
    +        };
    +
    +        var fsTypes = {
    +            PERSISTENT: 'PERSISTENT',
    +            TEMPORARY: 'TEMPORARY'
    +        };
    +        var fsType;
    +
    +        var normalizedSrc = thisM.src;
    +        normalizedSrc = setTemporaryFsByDefault(normalizedSrc);
    +
    +        if (normalizedSrc.indexOf('ms-appdata:///local/') === 0) {
    +            fsType = fsTypes.PERSISTENT;
    +        } else if (normalizedSrc.indexOf('ms-appdata:///temp/') === 0) {
    +            fsType = fsTypes.TEMPORARY;
    +        } else {
    +            lose({ code: MediaError.MEDIA_ERR_NONE_SUPPORTED });
    +            return;
    +        }
    +
    +        // Removing schemes (both variants are supported)
    +        normalizedSrc = normalizedSrc.replace('ms-appdata:///local//', '').replace('ms-appdata:///temp//', '')
    --- End diff --
    
    Seems like as per line 192 you don't need these top two variations.  


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33480928
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -33,8 +42,11 @@ module.exports = {
         create:function(win, lose, args) {
             var id = args[0];
             var src = args[1];
    +        var createAudioNode = args[2];
             var thisM = Media.get(id);
     
    +        src = setTemporaryFsByDefault(src);
    --- End diff --
    
    Would prefer this line immediately follow "var src = args[1]" because it is easy to miss this mutation.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33950043
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -33,8 +42,11 @@ module.exports = {
         create:function(win, lose, args) {
             var id = args[0];
             var src = args[1];
    +        var createAudioNode = args[2];
             var thisM = Media.get(id);
     
    +        src = setTemporaryFsByDefault(src);
    --- End diff --
    
    Addressed in https://github.com/MSOpenTech/cordova-plugin-media/commit/41d6149b7b55a6a8ce067d0a1a30ace3ca636231


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by dblotsky <gi...@git.apache.org>.
Github user dblotsky commented on the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#issuecomment-126634941
  
    Ping. Please rebase atop latest master changes, and verify that it still works. Then we can merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482303
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -91,6 +106,8 @@ module.exports = {
             var thisM = Media.get(id);
             // if Media was released, then node will be null and we need to create it again
             if (!thisM.node) {
    +            // createAudioNode = true;
    --- End diff --
    
    No it's a comment for the following line:
    ```javascript
    args[2] = true;
    ```
    It will add it as a side-comment.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482032
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -26,6 +26,15 @@ var MediaError = require('cordova-plugin-media.MediaError');
     
     var recordedFile;
     
    +function setTemporaryFsByDefault(src) {
    +    if (!/.+:/.test(src)) {
    --- End diff --
    
    Great idea, thank you!
    Will rework this via Windows.Foundation.Uri


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33950096
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -33,8 +42,11 @@ module.exports = {
         create:function(win, lose, args) {
             var id = args[0];
             var src = args[1];
    +        var createAudioNode = args[2];
    --- End diff --
    
    Addressed in https://github.com/MSOpenTech/cordova-plugin-media/commit/41d6149b7b55a6a8ce067d0a1a30ace3ca636231


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33481357
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -91,6 +106,8 @@ module.exports = {
             var thisM = Media.get(id);
             // if Media was released, then node will be null and we need to create it again
             if (!thisM.node) {
    +            // createAudioNode = true;
    --- End diff --
    
    Dead code?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482725
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -226,6 +301,10 @@ module.exports = {
             try {
                 if (thisM.node) {
                     thisM.node.onloadedmetadata = null;
    +                // Unsubscribing as the media object is being released
    +                thisM.node.onerror = null;
    +                // Needed to avoid "0x80070005 - JavaScript runtime error: Access is denied." on copyAsync
    --- End diff --
    
    This occurs when there is an Audio object with `src` set to a file being rewritten on recording.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#issuecomment-121324570
  
    Pending my other comments, LGTM.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33481074
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -33,8 +42,11 @@ module.exports = {
         create:function(win, lose, args) {
             var id = args[0];
             var src = args[1];
    +        var createAudioNode = args[2];
    --- End diff --
    
    This is later compared to true using ===.  Suggest coercing it to true or false here, "var createAudioNode = !!args[2];".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482258
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -226,6 +301,10 @@ module.exports = {
             try {
                 if (thisM.node) {
                     thisM.node.onloadedmetadata = null;
    +                // Unsubscribing as the media object is being released
    +                thisM.node.onerror = null;
    +                // Needed to avoid "0x80070005 - JavaScript runtime error: Access is denied." on copyAsync
    --- End diff --
    
    Can you clarify here why this error is occurring?  Is it because there is a sharing violation (i.e., the file is already open when trying to overwrite it)?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-media/pull/58


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33950380
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -159,7 +176,21 @@ module.exports = {
             var id = args[0];
             var src = args[1];
     
    -        var normalizedSrc = src.replace(/\//g, '\\');
    +        src = setTemporaryFsByDefault(src);
    +
    +        var success = function () {
    +            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_RUNNING);
    +            win();
    +        };
    +
    +        var error = function (reason) {
    +            Media.onStatus(id, Media.MEDIA_ERROR, reason);
    +            lose(reason);
    +        };
    +
    +        // Fixing paths like: ms-appdata:///temp//recs/memos/media.m4a => ms-appdata:///temp/recs/memos/media.m4a
    +        var normalizedSrc = src.replace(/([^\/])(\/\/)([^\/])/g, '$1/$3');
    --- End diff --
    
    uri.absoluteCanonicalUri does not handle double slashes, so I have left some regexps in the path-handling functions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#issuecomment-121547583
  
    @robpaveza, thanks for review, 
    I have addressed your comments.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482012
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -203,20 +234,64 @@ module.exports = {
             var id = args[0];
             var thisM = Media.get(id);
     
    -        var normalizedSrc = thisM.src.replace(/\//g, '\\');
    +        var success = function () {
    +            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
    +            win();
    +        };
    +
    +        var error = function (reason) {
    +            Media.onStatus(id, Media.MEDIA_ERROR, reason);
    +            lose(reason);
    +        };
    +
    +        var fsTypes = {
    +            PERSISTENT: 'PERSISTENT',
    +            TEMPORARY: 'TEMPORARY'
    +        };
    +        var fsType;
    +
    +        var normalizedSrc = thisM.src;
    +        normalizedSrc = setTemporaryFsByDefault(normalizedSrc);
    +
    +        if (normalizedSrc.indexOf('ms-appdata:///local/') === 0) {
    --- End diff --
    
    Is this component going to allow for interoperable code among platforms?  I just want to ensure that the developer isn't expected to utter "ms-appdata:///local/" - instead they're getting that from some service (or we're converting into that from some other argument) so that the developer can just write "persistent" or "temporary" and it saves.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33480844
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -26,6 +26,15 @@ var MediaError = require('cordova-plugin-media.MediaError');
     
     var recordedFile;
     
    +function setTemporaryFsByDefault(src) {
    +    if (!/.+:/.test(src)) {
    --- End diff --
    
    This test seems like it could collide with absolute file paths (e.g., "c:\foo.bar") or UNC paths (e.g., "\\?\C:\foo.bar").  Are you sure this is adequate?  I'm curious about whether creating a new Windows.Foundation.Uri would be more likely to detect such sources.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by robpaveza <gi...@git.apache.org>.
Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33481751
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -159,7 +176,21 @@ module.exports = {
             var id = args[0];
             var src = args[1];
     
    -        var normalizedSrc = src.replace(/\//g, '\\');
    +        src = setTemporaryFsByDefault(src);
    +
    +        var success = function () {
    +            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_RUNNING);
    +            win();
    +        };
    +
    +        var error = function (reason) {
    +            Media.onStatus(id, Media.MEDIA_ERROR, reason);
    +            lose(reason);
    +        };
    +
    +        // Fixing paths like: ms-appdata:///temp//recs/memos/media.m4a => ms-appdata:///temp/recs/memos/media.m4a
    +        var normalizedSrc = src.replace(/([^\/])(\/\/)([^\/])/g, '$1/$3');
    --- End diff --
    
    This is another instance in which using Windows.Foundation.Uri may be preferable.  You can canonicalize the Uri using it, instead of worrying about doing accurate regular expression matching.  See for example https://msdn.microsoft.com/en-us/library/windows/apps/windows.foundation.uri.absolutecanonicaluri.aspx


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#issuecomment-127279861
  
    @dblotsky, rebased and tested


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-media/pull/58#discussion_r33482618
  
    --- Diff: src/windows/MediaProxy.js ---
    @@ -203,20 +234,64 @@ module.exports = {
             var id = args[0];
             var thisM = Media.get(id);
     
    -        var normalizedSrc = thisM.src.replace(/\//g, '\\');
    +        var success = function () {
    +            Media.onStatus(id, Media.MEDIA_STATE, Media.MEDIA_STOPPED);
    +            win();
    +        };
    +
    +        var error = function (reason) {
    +            Media.onStatus(id, Media.MEDIA_ERROR, reason);
    +            lose(reason);
    +        };
    +
    +        var fsTypes = {
    +            PERSISTENT: 'PERSISTENT',
    +            TEMPORARY: 'TEMPORARY'
    +        };
    +        var fsType;
    +
    +        var normalizedSrc = thisM.src;
    +        normalizedSrc = setTemporaryFsByDefault(normalizedSrc);
    +
    +        if (normalizedSrc.indexOf('ms-appdata:///local/') === 0) {
    --- End diff --
    
    Do you mean cdvfile://localhost/persistent paths?
    There is another [PR for this](https://github.com/apache/cordova-plugin-media/pull/57).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org