初始化ios平台
This commit is contained in:
parent
e2dc633112
commit
a0aab26bdc
77
plugin.xml
77
plugin.xml
@ -1,35 +1,44 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<plugin id="capture-cordova-plugin" version="1.0.0"
|
<plugin id="capture-cordova-plugin" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
<name>Capture Plugin</name>
|
||||||
<name>Capture Plugin</name>
|
<js-module name="capture-cordova-plugin" src="www/capture.js">
|
||||||
|
<clobbers target="capture"/>
|
||||||
<js-module name="capture-cordova-plugin" src="www/capture.js">
|
</js-module>
|
||||||
<clobbers target="capture" />
|
<platform name="android">
|
||||||
</js-module>
|
<config-file parent="/*" target="res/xml/config.xml">
|
||||||
|
<feature name="capture-cordova-plugin">
|
||||||
<platform name="android">
|
<param name="android-package" value="cn.shuto.plugin.capture.CaptureCordovaPlugin"/>
|
||||||
<config-file parent="/*" target="res/xml/config.xml">
|
</feature>
|
||||||
<feature name="capture-cordova-plugin">
|
</config-file>
|
||||||
<param name="android-package" value="cn.shuto.plugin.capture.CaptureCordovaPlugin" />
|
<config-file parent="/*" target="AndroidManifest.xml">
|
||||||
</feature>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
</config-file>
|
</config-file>
|
||||||
<config-file target="AndroidManifest.xml" parent="/*">
|
<config-file parent="application" target="AndroidManifest.xml">
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<activity android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden|screenSize"
|
||||||
</config-file>
|
android:exported="false" android:name="com.mabeijianxi.smallvideorecord2.MediaRecorderActivity"
|
||||||
<config-file target="AndroidManifest.xml" parent="application">
|
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||||
<activity android:name="com.mabeijianxi.smallvideorecord2.MediaRecorderActivity" android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden" android:exported="false"/>
|
android:windowSoftInputMode="stateAlwaysHidden"/>
|
||||||
<provider android:name="org.apache.cordova.camera.FileProvider" android:authorities="${applicationId}.cordova.plugin.camera.provider" android:exported="false" android:grantUriPermissions="true">
|
<provider android:authorities="${applicationId}.cordova.plugin.camera.provider" android:exported="false"
|
||||||
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths"/>
|
android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
|
||||||
</provider>
|
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
</config-file>
|
android:resource="@xml/camera_provider_paths"/>
|
||||||
<config-file target="AndroidManifest.xml" parent="/manifest">
|
</provider>
|
||||||
<uses-permission android:name="android.permission.CAMERA"/>
|
</config-file>
|
||||||
<uses-permission android:name="android.permission.FLASHLIGHT"/>
|
<config-file parent="/manifest" target="AndroidManifest.xml">
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="true"/>
|
<uses-permission android:name="android.permission.CAMERA"/>
|
||||||
</config-file>
|
<uses-permission android:name="android.permission.FLASHLIGHT"/>
|
||||||
|
<uses-feature android:name="android.hardware.camera" android:required="true"/>
|
||||||
<source-file src="src/android/CaptureCordovaPlugin.java" target-dir="src/cn/shuto/plugin/capture" />
|
</config-file>
|
||||||
<framework custom="true" src="src/android/mobile-ffmpeg-x2.gradle" type="gradleReference" />
|
<source-file src="src/android/CaptureCordovaPlugin.java" target-dir="src/cn/shuto/plugin/capture"/>
|
||||||
</platform>
|
<framework custom="true" src="src/android/mobile-ffmpeg-x2.gradle" type="gradleReference"/>
|
||||||
</plugin>
|
</platform>
|
||||||
|
<platform name="ios">
|
||||||
|
<config-file parent="/*" target="config.xml">
|
||||||
|
<feature name="CapturePlugin">
|
||||||
|
<param name="ios-package" value="CapturePlugin"/>
|
||||||
|
</feature>
|
||||||
|
</config-file>
|
||||||
|
<source-file src="src/ios/CapturePlugin.m"/>
|
||||||
|
</platform>
|
||||||
|
</plugin>
|
||||||
|
28
src/ios/CapturePlugin.m
Normal file
28
src/ios/CapturePlugin.m
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/********* Capture Plugin.m Cordova Plugin Implementation *******/
|
||||||
|
|
||||||
|
#import <Cordova/CDV.h>
|
||||||
|
|
||||||
|
@interface CapturePlugin : CDVPlugin {
|
||||||
|
// Member variables go here.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)capture:(CDVInvokedUrlCommand*)command;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation CapturePlugin
|
||||||
|
|
||||||
|
- (void)capture:(CDVInvokedUrlCommand*)command
|
||||||
|
{
|
||||||
|
CDVPluginResult* pluginResult = nil;
|
||||||
|
NSString* echo = [command.arguments objectAtIndex:0];
|
||||||
|
|
||||||
|
if (echo != nil && [echo length] > 0) {
|
||||||
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
|
||||||
|
} else {
|
||||||
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
|
||||||
|
}
|
||||||
|
|
||||||
|
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
Loading…
x
Reference in New Issue
Block a user