The Cordova Media Capture plugin provides the ability to capture Audio, Image and Video. The Kapsel Voice Recording plugin provides the ability to record audio in an encrypted format. It takes the recorded audio file returned from the media capture plugin, encrypts it using an API from the encrypted storage plugin and then deletes the original unencrypted file.
For additional details on the Kapsel Voice Recording plugin see the JavaScript file in a project that includes this plugin at
project_name\plugins\com.sap.mp.cordova.plugins.voicerecording\www\voicerecording.js
or the Documentation at Using the Voice Recording Plugin.
The following steps will demonstrate these plugins.
cordova -d create C:\Kapsel_Projects\VoiceRecordingDemo com.mycompany.voicerecording VoiceRecordingDemo "{\"plugin_search_path\":\"C:/SAP/MobileSDK3/KapselSDK/plugins/\"}"
cd C:\Kapsel_Projects\VoiceRecordingDemo
cordova -d platform add android
cordova -d create ~/Documents/Kapsel_Projects/VoiceRecordingDemo com.mycompany.voicerecording VoiceRecordingDemo "{\"plugin_search_path\":\"/Users/i826567/SAP/MobileSDK3/KapselSDK/plugins/\"}"
cd ~/Documents/Kapsel_Projects/VoiceRecordingDemo
cordova -d platform add ios
cordova -d plugin add org.apache.cordova.media-capture
Add the attachment viewer plugin and two other plugins (should be automatically added as dependents but are not in SP08) to assist with the opening of the media file in a separate WebView.cordova plugins add com.sap.mp.cordova.plugins.attachmentviewer
cordova plugins add org.apache.cordova.dialogs
cordova plugins add com.sap.mp.cordova.plugins.i18n
Modify the C:\Kapsel_Projects\VoiceRecordingDemo\plugins\com.sap.mp.cordova.plugins.attachmentviewer\www\attachmentviewer.js file to handle file types.if (element.tagName == 'A' && (element.href.indexOf("http") === 0 || element.href.indexOf("https") === 0) && element.target == "_blank")
to
if (element.tagName == 'A' && (element.href.indexOf("http") === 0 || element.href.indexOf("file") === 0 || element.href.indexOf("https") === 0) && element.target == "_blank")
cordova -d prepare
cordova -d plugin add com.sap.mp.cordova.plugins.voicerecording
C:\Kapsel_Projects\VoiceRecordingDemo\plugins\com.sap.mp.cordova.plugins.voicerecording\www\recording.js
Move the exports section below the deleteFile method. Modify the exports section to include the deleteFile method.module.exports = {
audioCapture: audioCapture,
deleteFile: deleteFile
};
cordova -d prepare
Back to Getting Started With Kapsel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
10 | |
9 | |
9 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 |