rossmartin / video-editor-ionic2

:camera: :video_camera: :scissors: An Ionic 2 app that shows how to use the cordova-plugin-video-editor and cordova-plugin-instagram-assets-picker plugins.
71 stars 30 forks source link

Error while running app #2

Closed kalyandechiraju closed 8 years ago

kalyandechiraju commented 8 years ago

Hi @rossmartin, I am facing this exception while on click event

EXCEPTION: Error during evaluation of "click" ORIGINAL EXCEPTION: TypeError: undefined is not an object (evaluating 'navigator.device.capture')

Please help me in running this application. On device, the app is not responding to click of the ion-item.

rossmartin commented 8 years ago

Did you add the necessary plugins via step 5?

ionic plugin add cordova-plugin-camera cordova-plugin-device cordova-plugin-media-capture https://github.com/driftyco/ionic-plugin-keyboard.git cordova-plugin-statusbar cordova-plugin-spinner-dialog cordova-plugin-instagram-assets-picker cordova-plugin-video-editor
kalyandechiraju commented 8 years ago

Yes. Same error. Now while building for Android device, getting this error.

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 18 declared in library [com.github.ergovia-mobile:android-transcoder:v0.1.10R_ergovia] /Users/kalyandechiraju/Downloads/video-editor-ionic2-master/platforms/android/build/intermediates/exploded-aar/com.github.ergovia-mobile/android-transcoder/v0.1.10R_ergovia/AndroidManifest.xml

rossmartin commented 8 years ago

The video editor plugin for android requires android sdk version 18 (android 4.3)

In your app's root config.xml add this below to your android preferences or create if needed -

<platform name="android">
    ...
    <preference name="android-minSdkVersion" value="18" />
    ...
</platform>
kalyandechiraju commented 8 years ago

Thank you @rossmartin . It worked. Can you help me out in doing the same with typescript? Typescript is complaining about device (Property 'device' does not exist on type 'Navigator').

navigator.device.capture.captureVideo

How to resolve this? Or is there any alternate way to use media-capture-plugin with typescript?

kalyandechiraju commented 8 years ago

Hey the above error I am facing was resolved by adding navigator global declaration (In typescript)

declare var navigator: any;