cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robpaveza <...@git.apache.org>
Subject [GitHub] cordova-plugin-media pull request: CB-9238 Media plugin cannot rec...
Date Mon, 29 Jun 2015 16:21:00 GMT
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


Mime
View raw message