<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" id="cordova-plugin-trtc" version="1.0.0">
    <name>Trtc</name>
    <description>TRTC Plugin</description>
    <keywords>cordova,TRTC,live</keywords>
    <license>MIT License</license>

    <dependency id="cordova-plugin-androidx"/>
    <dependency id="cordova-plugin-androidx-adapter"/>

    <preference name="PERMISSION_MIC_DESC" default="应用需要访问您的麦克风"/>
    <preference name="PERMISSION_CAMERA_DESC" default="应用需要访问您的摄像头"/>

    <engines>
        <engine name="cordova-android" version=">=4.0.0"/>
    </engines>

    <js-module src="www/trtc.js" name="trtc">
        <clobbers target="cordova.plugin.trtc"/>
    </js-module>

    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="Trtc">
                <param name="ios-package" value="TrtcPlugin"/>
            </feature>
        </config-file>

        <config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
            <string>$PERMISSION_MIC_DESC</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
            <string>$PERMISSION_CAMERA_DESC</string>
        </config-file>

        <!--        <hook type="after_platform_add" src="hooks/addEmbedded.js" />-->

        <header-file src="src/ios/TrtcPlugin.h"/>
        <source-file src="src/ios/TrtcPlugin.m"/>

        <header-file src="src/ios/CordovaEventKit.h"/>
        <source-file src="src/ios/CordovaEventKit.m"/>

        <header-file src="src/ios/Events.h"/>
        <source-file src="src/ios/Events.m"/>

        <header-file src="src/ios/Listener.h"/>
        <source-file src="src/ios/Listener.m"/>

        <header-file src="src/ios/UserUpdateListener.h"/>
        <source-file src="src/ios/UserUpdateListener.m"/>

        <header-file src="src/ios/TrtcUserInfo.h"/>
        <source-file src="src/ios/TrtcUserInfo.m"/>

        <header-file src="src/ios/UIView+Toast.h"/>
        <source-file src="src/ios/UIView+Toast.m"/>

        <header-file src="src/ios/VideoCallingViewController.h"/>
        <source-file src="src/ios/VideoCallingViewController.m"/>

        <resource-file src="src/ios/VideoCallingViewController.xib"/>

        <podspec>
            <config>
                <source url="http://m.shuto.cn:8680/github/CocoaPods-Specs.git"/>
            </config>
            <pods use-frameworks="true">
                <pod name="TXLiteAVSDK_TRTC" options=":podspec => 'https://liteav.sdk.qcloud.com/pod/liteavsdkspec/TXLiteAVSDK_TRTC.podspec'" />
            </pods>
        </podspec>

    </platform>

    <platform name="android">
        <config-file target="config.xml" parent="/*">
            <feature name="Trtc">
                <param name="android-package" value="com.tencent.trtc.TrtcPlugin"/>
                <param name="onload" value="true" />

            </feature>
        </config-file>

        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.RECORD_AUDIO"/>
            <uses-permission android:name="android.permission.CAMERA"/>
            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
            <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
            <!--            <uses-feature android:name="android.hardware.camera" />-->
            <!--            <uses-feature android:name="android.hardware.camera.autofocus" />-->
        </config-file>

        <config-file target="res/values/strings.xml" parent="/resources">
            <string name="common_please_input_roomid_and_userid">用户没有允许需要的权限，加入通话失败</string>
            <string name="main_trtc_base_funciton">基础功能</string>
            <string name="main_item_aduio_call">语音通话</string>
            <string name="main_item_aduio_call_desc">双人/多人语音通话、包含静音/免提等功能</string>
            <string name="main_item_video_call">视频通话</string>
            <string name="main_item_video_call_desc">双人/多人视频通话、包含静音/免提等功能</string>
            <string name="main_item_live">视频互动直播</string>
            <string name="main_item_voice_chat_room">语音互动直播</string>
            <string name="main_item_screen_share">录屏直播</string>
            <string name="main_item_screen_share_desc">直播过程中分享屏幕，适用于在线教育，游戏直播等场景</string>

            <string name="main_trtc_advanced">进阶功能</string>
            <string name="main_item_string_room_id">字符串房间号</string>
            <string name="main_rtrc_set_video_quality">画质设定</string>
            <string name="main_rtrc_set_audio_quality">音质设定</string>
            <string name="main_rerc_render_params">渲染控制</string>
            <string name="main_item_speed_test">网络测速</string>
            <string name="main_item_pushcdn">CDN发布</string>
            <string name="main_trtc_custom_camera">自定义视频采集&amp;渲染</string>
            <string name="main_rtrc_set_audio_effect">设置音效</string>
            <string name="main_trtc_set_bgm">设置背景音乐</string>
            <string name="main_trtc_local_video_share">本地视频分享</string>
            <string name="main_item_local_record">本地媒体录制</string>
            <string name="main_item_join_multiple_room">加入多个房间</string>
            <string name="main_item_sei_message">收发SEI消息</string>
            <string name="main_item_switch_room">快速切换房间</string>
            <string name="main_trtc_connect_other_room_pk">跨房PK</string>
            <string name="main_item_third_beauty">第三方美颜</string>


            <string name="videocall_title">TRTC 视频通话示例</string>
            <string name="videocall_room_input_error_tip">"房间号和用户名不能为空"</string>
            <string name="videocall_video_item">视频选项</string>
            <string name="videocall_audio_item">音频选项</string>
            <string name="videocall_user_back_camera">使用后置摄像头</string>
            <string name="videocall_user_front_camera">使用前置摄像头</string>
            <string name="videocall_open_camera">打开摄像头</string>
            <string name="videocall_close_camera">关闭摄像头</string>
            <string name="videocall_mute_audio">打开麦克风</string>
            <string name="videocall_close_mute_audio">关闭麦克风</string>
            <string name="videocall_use_speaker">使用扬声器</string>
            <string name="videocall_use_receiver">使用听筒</string>
            <string name="videocall_enter_room">进入房间</string>
            <string name="videocall_please_input_userid">请输入用户名(必填项)</string>
            <string name="videocall_please_input_roomid">请输入房间号(必填项)</string>
            <string name="videocall_roomid">房间号:</string>
        </config-file>

        <resource-file src="src/android/res/values/colors.xml" target="res/values/trtc-colors.xml"/>
        <resource-file src="src/android/res/values/styles.xml" target="res/values/trtc-styles.xml"/>

        <config-file target="AndroidManifest.xml" parent="/manifest/application">
            <activity android:name="com.tencent.trtc.TRTCBaseActivity" android:windowSoftInputMode="adjustPan" android:launchMode="singleInstance" android:screenOrientation="portrait">
            </activity>
            <activity android:name="com.tencent.trtc.videocall.VideoCallingActivity" android:windowSoftInputMode="adjustPan" android:launchMode="singleInstance" android:screenOrientation="portrait" android:theme="@style/AppTheme">
            </activity>
            <activity android:name="com.tencent.trtc.videocall.VideoCallingEnterActivity" android:windowSoftInputMode="adjustPan" android:launchMode="singleInstance" android:screenOrientation="portrait" android:theme="@style/AppTheme">
            </activity>
        </config-file>

        <source-file src="src/android/java/com/tencent/trtc/TrtcPlugin.java" target-dir="com/tencent/trtc"/>
        <source-file src="src/android/java/com/tencent/trtc/TRTCBaseActivity.java" target-dir="com/tencent/trtc"/>
        <source-file src="src/android/java/com/tencent/trtc/MessageObject.java" target-dir="com/tencent/trtc"/>
        <source-file src="src/android/java/com/tencent/trtc/CustomVideoView.java" target-dir="com/tencent/trtc"/>
        <source-file src="src/android/java/com/tencent/trtc/CordovaEventKit.java" target-dir="com/tencent/trtc"/>

        <source-file src="src/android/java/com/tencent/trtc/videocall/BuildConfig.java" target-dir="com/tencent/trtc/videocall"/>
        <source-file src="src/android/java/com/tencent/trtc/videocall/UserInfo.java" target-dir="com/tencent/trtc/videocall"/>
        <source-file src="src/android/java/com/tencent/trtc/videocall/VideoCallingActivity.java" target-dir="com/tencent/trtc/videocall"/>
        <source-file src="src/android/java/com/tencent/trtc/videocall/VideoCallingEnterActivity.java" target-dir="com/tencent/trtc/videocall"/>

        <source-file src="src/android/java/com/tencent/trtc/debug/Constant.java" target-dir="com/tencent/trtc/debug"/>

        <source-file src="src/android/java/com/tencent/trtc/event/Events.java" target-dir="com/tencent/trtc/event"/>
        <source-file src="src/android/java/com/tencent/trtc/event/Listener.java" target-dir="com/tencent/trtc/event"/>


        <resource-file src="src/android/res/drawable/videocall_background.xml" target="res/drawable/videocall_background.xml"/>
        <resource-file src="src/android/res/drawable/common_button_bg.xml" target="res/drawable/common_button_bg.xml"/>
        <resource-file src="src/android/res/drawable/common_edit_bg.xml" target="res/drawable/common_edit_bg.xml"/>
        <resource-file src="src/android/res/drawable/common_seekbar_style.xml" target="res/drawable/common_seekbar_style.xml"/>
        <resource-file src="src/android/res/drawable/common_seekbar_thumb.xml" target="res/drawable/common_seekbar_thumb.xml"/>
        <resource-file src="src/android/res/drawable/common_selector_radio_bg.xml" target="res/drawable/common_selector_radio_bg.xml"/>

        <resource-file src="src/android/res/layout/videocall_activit_enter.xml" target="res/layout/videocall_activit_enter.xml"/>
        <resource-file src="src/android/res/layout/videocall_activity_calling.xml" target="res/layout/videocall_activity_calling.xml"/>
        <resource-file src="src/android/res/layout/custom_video_view_layout.xml" target="res/layout/custom_video_view_layout.xml"/>

        <resource-file src="src/android/res/mipmap-xxhdpi/videocall_float_logo.png" target="res/mipmap-xxhdpi/videocall_float_logo.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/videocall_home.png" target="res/mipmap-xxhdpi/videocall_home.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/common_ic_back.png" target="res/mipmap-xxhdpi/common_ic_back.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/common_user_portrait.png" target="res/mipmap-xxhdpi/common_user_portrait.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/earpiece.png" target="res/mipmap-xxhdpi/earpiece.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/mac_off.png" target="res/mipmap-xxhdpi/mac_off.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/mac_on.png" target="res/mipmap-xxhdpi/mac_on.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/speaker.png" target="res/mipmap-xxhdpi/speaker.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/swap_camera.png" target="res/mipmap-xxhdpi/swap_camera.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/view_close.png" target="res/mipmap-xxhdpi/view_close.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/view_open.png" target="res/mipmap-xxhdpi/view_open.png"/>
        <resource-file src="src/android/res/mipmap-xxhdpi/rotation.png" target="res/mipmap-xxhdpi/rotation.png"/>


        <framework src="com.tencent.liteav:LiteAVSDK_TRTC:latest.release"/>
        <framework src="androidx.appcompat:appcompat:1.1.0"/>
        <framework src="androidx.constraintlayout:constraintlayout:1.1.3"/>
        <framework src="com.android.support:multidex:1.0.1"/>
        <framework src="com.tencent.ilivesdk:ilivesdk:1.9.3"/>
        <framework src="com.tencent.ilivefilter:liteav_normal:1.1.21"/>
        <framework src="com.google.android.material:material:1.3.0"/>
    </platform>

</plugin>
