<?xml version="1.0" encoding="utf-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
        id="cordova-plugin-exoplayer-smart"
        version="3.3.1">

    <name>ExoPlayer Smart</name>
    <description>Custom Media player for Cordova Android TV using Google's ExoPlayer framework</description>
    <keywords>ecosystem:cordova,cordova-android,phonegap,cordova,ionic,android,exoplayer,exo,video,player</keywords>
    <license>MIT</license>

    <engines>
        <engine name="cordova-android" version=">=4.0.0"/>

        <!-- <engine name="cordova" version=">=9.0.0"/> -->
        <!-- <engine name="cordova-android" version=">=9.0.0" /> -->
        <!-- <engine name="cordova-ios" version=">=5.1.0" /> -->

    </engines>

    <asset src="www/exoplayer.js" target="js/exoplayer.js"/>

    <js-module src="www/exoplayer.js" name="ExoPlayer">
        <clobbers target="ExoPlayer"/>
    </js-module>

    <platform name="android">
        <!-- <framework src="com.google.android.exoplayer:exoplayer:2.9.6"/> -->
        <framework src="com.google.android.exoplayer:exoplayer:2.18.0"/>
        <framework src="com.squareup.picasso:picasso:2.8"/>
        <!-- <framework src="androidx.webkit:webkit:${cordovaConfig.ANDROIDX_WEBKIT_VERSION}" /> -->

        <config-file target="AndroidManifest.xml" parent="/manifest/application/activity/intent-filter">
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.LAUNCHER"/>
            <category android:name="tv.ouya.intent.category.APP"/>
            <category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
        </config-file>

        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="ExoPlayer">
                <param name="android-package" value="co.frontyard.cordova.plugin.exoplayer.Plugin"/>
            </feature>
        </config-file>

        <!-- <config-file target="config.xml" parent="/*">
            <feature name="DecryptResource">
                <param name="android-package" value="com.tkyaji.cordova.DecryptResource" />
                <param name="onload" value="true" />
            </feature>
        </config-file> -->

        <source-file src="src/res/values/ids.xml" target-dir="res/values/"/>
        <source-file src="src/res/values/constants.xml" target-dir="res/values/"/>
        <source-file src="src/res/values/styles.xml" target-dir="res/values/"/>

        <source-file src="src/res/layout/exo_simple_player_view.xml" target-dir="res/layout/"/>
        <source-file src="src/res/layout/exo_playback_control_view.xml" target-dir="res/layout/"/>
        <source-file src="src/res/layout/exo_rounded_corners.xml" target-dir="res/layout/"/>

        <source-file src="src/res/drawable/fastforward.png" target-dir="res/drawable/"/>
        <source-file src="src/res/drawable/next.png" target-dir="res/drawable/"/>
        <source-file src="src/res/drawable/pause.png" target-dir="res/drawable/"/>
        <source-file src="src/res/drawable/play.png" target-dir="res/drawable/"/>
        <source-file src="src/res/drawable/previous.png" target-dir="res/drawable/"/>
        <source-file src="src/res/drawable/rewind.png" target-dir="res/drawable/"/>

        <source-file src="src/android/CallbackResponse.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/Configuration.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/LayoutProvider.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/Payload.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/Player.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/Plugin.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>
        <source-file src="src/android/Visibility.java" target-dir="src/co/frontyard/cordova/plugin/exoplayer/"/>

        <!-- <source-file src="src/android/com/tkyaji/cordova/DecryptResource.java" target-dir="src/com/tkyaji/cordova" />
        <source-file src="src/android/com/tkyaji/cordova/DecryptCordovaPathHandler.java" target-dir="src/com/tkyaji/cordova" /> -->
        <!-- <hook type="after_prepare" src="patch.js"/> -->
    </platform>

    <!-- <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="CDVCrypt">
                <param name="ios-package" value="CDVCrypt"/>
                <param name="onload" value="true"/>
            </feature>
        </config-file>

        <header-file src="src/ios/CDVCrypt.h" />
        <source-file src="src/ios/CDVCrypt.m" />
        <header-file src="src/ios/CDVCryptURLProtocol.h" />
        <source-file src="src/ios/CDVCryptURLProtocol.m" />
    </platform>

    <cryptfiles>
        <include>
            <file regex="\.(htm|html|js|css)$" />
        </include>
        <exclude>
        </exclude>
    </cryptfiles> -->

    <!-- <hook type="after_prepare" src="hooks/after_prepare.js" /> -->
</plugin>
