Github user ghenry22 commented on the pull request:

    
https://github.com/apache/cordova-plugin-media/pull/62#issuecomment-159179817
  
    Ok this discussion isn't really relevant to this PR at all but more related 
to quirks of the file plugin that is used by the media plugin but let me try 
and help you out a bit:
    
    https://github.com/apache/cordova-plugin-file
    
    Read the info about file paths here and how to access persistent storage, 
cache storage etc.
    
    Importantly look at the file paths for android, windows and ios and which 
cordova.file.* value they map to.  If you use cordova.file.dataDirectory for 
example it will work to map to persistent storage across all 3 platforms in a 
consistent way.  If you use file://somedir/someotherdir/etc then it won't work.
    
    If you use file:// you will find that it also doesn't work on windows 
platform as it's native paths us ms-appdata:// prefixes.  Android works because 
it uses file:// paths for local files natively (the path mappings in the file 
plugin readme even show this).
    
    So here's an example that might help you out from my code:
    
    //define a variable to store the resolved path where files will be stored
          var basePath = false;
    
    //get the path to the file to be used for later playback from file system
            var musicDirectory = cordova.file.dataDirectory + 'musicCache/';
    
    //resolve the path to a usable internalURL for the current platform
            $window.resolveLocalFileSystemURL(musicDirectory, function(dir){
            if (!basePath) {
                 basePath = dir.toInternalURL();
    };
            })


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to