Repository: cordova-plugin-media Updated Branches: refs/heads/master 6f28f9438 -> f0a0bb8f3
CB-12034 (ios) Add mandatory iOS 10 privacy description This closes #119 Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/f0a0bb8f Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/f0a0bb8f Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/f0a0bb8f Branch: refs/heads/master Commit: f0a0bb8f3c5bd05370dcc383a2a618d234148984 Parents: 6f28f94 Author: Julio Cesar Sanchez Hernandez <jcesarmob...@gmail.com> Authored: Sat Oct 29 23:38:54 2016 +0200 Committer: Julio César <jcesarmob...@gmail.com> Committed: Sun Oct 30 00:07:07 2016 +0200 ---------------------------------------------------------------------- README.md | 14 +++++++++++--- plugin.xml | 56 ++++++++++++++++++++++++++++++-------------------------- 2 files changed, 41 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/f0a0bb8f/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 818889a..58e89ad 100644 --- a/README.md +++ b/README.md @@ -312,7 +312,7 @@ function recordAudio() { // Pause Recording after 5 seconds setTimeout(function() { - my_media.pauseRecord(); + mediaRec.pauseRecord(); }, 5000); } ``` @@ -427,12 +427,12 @@ function recordAudio() { // Pause Recording after 5 seconds setTimeout(function() { - my_media.pauseRecord(); + mediaRec.pauseRecord(); }, 5000); // Resume Recording after 10 seconds setTimeout(function() { - my_media.resumeRecord(); + mediaRec.resumeRecord(); }, 10000); } ``` @@ -563,6 +563,14 @@ function recordAudio() { var myMedia = new Media("documents://beer.mp3") +- Since iOS 10 it's mandatory to add a `NSMicrophoneUsageDescription` entry in the info.plist. + +`NSMicrophoneUsageDescription` describes the reason that the app accesses the userâs microphone. When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add this entry you can pass the variable `MICROPHONE_USAGE_DESCRIPTION` on plugin install. + +Example: `cordova plugin add cordova-plugin-media --variable MICROPHONE_USAGE_DESCRIPTION="your usage message"` + +If you don't pass the variable, the plugin will add an empty string as value. + ### Windows Quirks - Windows devices can use MP3, M4A and WMA formats for recorded audio. However in most cases it is not possible to use MP3 for audio recording on _Windows Phone 8.1_ devices, because an MP3 encoder is [not shipped with Windows Phone](https://msdn.microsoft.com/en-us/library/windows/apps/windows.media.mediaproperties.mediaencodingprofile.createmp3.aspx). http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/f0a0bb8f/plugin.xml ---------------------------------------------------------------------- diff --git a/plugin.xml b/plugin.xml index 951d301..423947f 100644 --- a/plugin.xml +++ b/plugin.xml @@ -59,7 +59,7 @@ id="cordova-plugin-media" <source-file src="src/android/AudioHandler.java" target-dir="src/org/apache/cordova/media" /> <source-file src="src/android/AudioPlayer.java" target-dir="src/org/apache/cordova/media" /> <source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/media" /> - </platform> + </platform> <!-- amazon-fireos --> <platform name="amazon-fireos"> @@ -79,31 +79,35 @@ id="cordova-plugin-media" <source-file src="src/android/AudioHandler.java" target-dir="src/org/apache/cordova/media" /> <source-file src="src/android/AudioPlayer.java" target-dir="src/org/apache/cordova/media" /> <source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/media" /> - </platform> - - - <!-- ubuntu --> - <platform name="ubuntu"> - <config-file target="config.xml" parent="/*"> - <feature name="Media"> - <param policy_group="microphone" policy_version="1" /> - <param policy_group="video" policy_version="1" /> - </feature> - </config-file> - <header-file src="src/ubuntu/media.h" /> - <source-file src="src/ubuntu/media.cpp" /> - </platform> - - <!-- ios --> - <platform name="ios"> - <config-file target="config.xml" parent="/*"> - <feature name="Media"> - <param name="ios-package" value="CDVSound" /> - </feature> - </config-file> - <header-file src="src/ios/CDVSound.h" /> - <source-file src="src/ios/CDVSound.m" /> - </platform> + </platform> + + + <!-- ubuntu --> + <platform name="ubuntu"> + <config-file target="config.xml" parent="/*"> + <feature name="Media"> + <param policy_group="microphone" policy_version="1" /> + <param policy_group="video" policy_version="1" /> + </feature> + </config-file> + <header-file src="src/ubuntu/media.h" /> + <source-file src="src/ubuntu/media.cpp" /> + </platform> + + <!-- ios --> + <platform name="ios"> + <config-file target="config.xml" parent="/*"> + <feature name="Media"> + <param name="ios-package" value="CDVSound" /> + </feature> + </config-file> + <header-file src="src/ios/CDVSound.h" /> + <source-file src="src/ios/CDVSound.m" /> + <preference name="MICROPHONE_USAGE_DESCRIPTION" default=" " /> + <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription"> + <string>$MICROPHONE_USAGE_DESCRIPTION</string> + </config-file> + </platform> <!-- blackberry10 --> <platform name="blackberry10"> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org