Camera Capture
this plugin can easy to integrate with your project, you just need
to write a few code to complete your [Link] can support take photo
and record video by device’s camera , it available for Android And iOS
platform.
How to integaration and use:
Please follow these steps to integrate this plugin with you project.
Step1: Please import this plugin into your project.
Step2: Drag the prefab named “CameraCapture” from
Assets/CameraCapture/Prefab/ into hierarchy.
Step3:
(1) Camera Capture Features:
1) Get CameraCapture reference Object
CameraCapture camCap= [Link]<CameraCapture> ();
2) Take Photo (it will be saved in gallery)
//this api will open the camera and make you can take photo to save to gallery auto
2.1) [Link]();
2.2) take photo event:
[Link] += onTakePhotoCompleted;
void onTakePhotoCompleted(string fpath)
{
// todo something by fpath , you can use the path to load it and preview it
in ui or other. see the demo sample scene.,
}
(2)record video
1) Get CameraCapture reference Object
CameraCapture camCap= [Link]<CameraCapture> ();
2) Record video (it will be saved in gallery)
// the video will be save in the gallery if it success
2.1) [Link]();
2.2) Record video event:
[Link] += onCaptureVideoCompleted;
void onCaptureVideoCompleted(string fpath)
{
// todo something by fpath , you can use this video path to do what you
want,like upload it to webservers , or other .see the demo sample scene.
}
(3)Pick Video and Play
1) Get CameraCapture reference Object
CameraCapture camCap= [Link]<CameraCapture> ();
2) pick video to play:
// it will open the video files folders make you can pick the video,and it
will play auto
[Link]();
3) Pick Event:
[Link] += OnPickCompleted;
void OnPickCompleted(string path)
// todo something by path, see the demo sample scene.
(4)Pick Video
1) Get CameraCapture reference Object
CameraCapture camCap= [Link]<CameraCapture> ();
2)pick video:
// it will open the video files folders make you can pick the video,it will
return the path;
[Link]();
3)Pick Event:
[Link] += OnPickCompleted;
void OnPickCompleted(string path)
// todo something by path, see the demo sample scene.
(5)Pick Photo
1) Get CameraCapture reference Object
CameraCapture camCap= [Link]<CameraCapture> ();
2) pick video:
// it will open the image files folders make you can pick the images ,it will
return the path;
[Link]();
3)Pick Event:
[Link] += OnPickCompleted;
void OnPickCompleted(string path)
// todo something by path, see the demo sample scene.
Step4:
build app
Android:
1,Please set the “Write Permission” as “External(SDCard)” in the
player [Link] the plugin need to access the SDCard when taking photo
to gallery. If not ,it can’t save image to gallery success
2,Edit the [Link] file (important)
1) Open the [Link] in the Assets/Plugins/Android/ folder.
And edit it.
2) Locate at the node <provider></provider>
<provider
android:name="[Link]"
android:authorities="[Link]"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data android:name="[Link].FILE_PROVIDER_PATHS
" android:resource="@xml/provider_paths"/>
</provider>
3) Edit the “[Link]” with your project
packagename.
Ok, we have provide some sample scenes for you ,you can
see them for detail.
For support email me at wiliamheart@[Link]