knaito-asial opened a new pull request, #352:
URL: https://github.com/apache/cordova-plugin-media/pull/352
### Platforms affected
iOS platform
### Motivation and Context
In iOS, this plugin does not support `file://` scheme.
Therefore following code does not work
```
window.requestFileSystem(
LocalFileSystem.PERSISTENT,
0,
function (fs) {
const pathPrefix = fs.root.toURL();
file = pathPrefix + fileName;
mediaRec = new Media(file, mediaRecordSuccess, mediaError,
mediaRecordStatus);
mediaRec.startRecord();
},
function (err) {
alert("LocalFileSystem Error");
}
);
```
On the other hand, this code works in Android.
The actual `file` variable in the above code is like
`file:///var/mobile/Containers/Data/Application/6DAC6E88-C38A-4A8B-A7E9-456345E5D25D/Library/NoCloud/myrecording.m4a`
where the `file://` scheme is used.
But the current this plugin does not support `file://` scheme in iOS and not
work in iOS.
This is inconsistent with in Android.
### Description
This PR improves Media plugin to support `file://` scheme in iOS.
### Testing
In my local Mac, I create a sample cordova project and add this modified
media plugin.
Check the Recording and Playing audio with file path using `file://` scheme
and confirm it works well.
### Checklist
- [ ] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [x] Commit is prefixed with `(platform)` if this change only applies to
one platform (e.g. `(android)`)
- [ ] If this Pull Request resolves an issue, I linked to the issue in the
text above (and used the correct [keyword to close issues using
keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]