<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="cordova-plugin-media-capture-mp4video"
    version="1.0.6">

    <name>cordova-plugin-media-capture-mp4video</name>

    <description>Cordova Media Capture Plugin modified to generate a mp4 video file for iOS and Android</description>
    <license>Apache 2.0</license>
    <keywords>cordova,media,capture</keywords>
    <repo>https://github/remoorejr/cordova-plugin-media-capture-mp4video.git</repo>

    <dependency id="cordova-plugin-file" version=">=4.0.0" />

    <js-module src="www/CaptureAudioOptions.js" name="CaptureAudioOptions">
        <clobbers target="CaptureAudioOptions" />
    </js-module>

    <js-module src="www/CaptureImageOptions.js" name="CaptureImageOptions">
        <clobbers target="CaptureImageOptions" />
    </js-module>

    <js-module src="www/CaptureVideoOptions.js" name="CaptureVideoOptions">
        <clobbers target="CaptureVideoOptions" />
    </js-module>

    <js-module src="www/CaptureError.js" name="CaptureError">
        <clobbers target="CaptureError" />
    </js-module>

    <js-module src="www/MediaFileData.js" name="MediaFileData">
        <clobbers target="MediaFileData" />
    </js-module>

    <js-module src="www/MediaFile.js" name="MediaFile">
        <clobbers target="MediaFile" />
    </js-module>

    <js-module src="www/helpers.js" name="helpers">
        <runs />
    </js-module>

    <js-module src="www/capture.js" name="capture">
        <clobbers target="navigator.device.capture" />
    </js-module>

    <!-- android -->
    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Capture" >
                <param name="android-package" value="org.apache.cordova.mediacapture.Capture"/>
            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.RECORD_AUDIO" />
            <uses-permission android:name="android.permission.RECORD_VIDEO"/>
            <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        </config-file>

        <source-file src="src/android/Capture.java" target-dir="src/org/apache/cordova/mediacapture" />
        <source-file src="src/android/FileHelper.java" target-dir="src/org/apache/cordova/mediacapture" />
        <source-file src="src/android/PendingRequests.java" target-dir="src/org/apache/cordova/mediacapture" />

        <js-module src="www/android/init.js" name="init">
            <runs />
        </js-module>
    </platform>

   

    <!-- ios -->
    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="Capture">
                <param name="ios-package" value="CDVCapture" />
            </feature>
        </config-file>
        <header-file src="src/ios/CDVCapture.h" />
        <source-file src="src/ios/CDVCapture.m" />
        <resource-file src="src/ios/CDVCapture.bundle" />

        <framework src="CoreGraphics.framework" />
        <framework src="MobileCoreServices.framework" />

        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
            <string>This app requires access to the camera to take photos.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
            <string>This app requires access to the microphone to record audio.</string>
        </config-file>

        <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
            <string>This app requires access to the photo library to display images.</string>
        </config-file>
    </platform>

</plugin>
