# util/enum.js

    /**
     * @desc 模块枚举
     * @readonly
     * @enum {String}
     */
    var ModulesEnum = {
    	/**
    	 * @desc 引擎模块
    	 */
    	avdEngine: "AVDEngine",

    	/**
    	 * @desc  浏览器检测模块
    	 * @ignore
    	 */
    	browserDetect: "BrowserDetect",

    	/**
    	 * @desc 视频模块
    	 * @ignore
    	 */
    	video: "Video",

    	/**
    	 * @desc 音频模块
    	 * @ignore
    	 */
    	audio: "Audio",

    	/**
    	 * @desc 错误处理模块
    	 * @ignore
    	 */
    	error: "Error",

    	/**
    	 * @desc 批注模块
    	 * @ignore
    	 */
    	annotation: "Annotation",

    	/**
    	 * @desc 信令模块
    	 * @ignore
    	 */
    	client: "Client",
    };

    /**
     * @desc 日志显示方式枚举
     * @readonly
     * @enum {number}
     */
    var Appender = {
    	 /**
    	 * @desc 使用alert语句显示日志
    	 */
    	alert: 1,

    	/**
    	 * @desc 内嵌到页面显示日志
    	 */
    	inpage: 2,

    	/**
    	 * @desc 弹出对话框显示日志
    	 */
    	popup: 3,

    	/**
    	 * @desc 浏览器控制台显示日志
    	 */
    	browserConsole: 4
    };

    /**
     * @desc 日志显示级别枚举
     * @readonly
     * @enum {number}
     */
    var LogLevel = {
    	all: 1,
    	trace: 2,
    	debug: 3,
    	info: 4,
    	warn: 5,
    	error: 6,
    	fatal: 7,
    	off: 8
    };

    /**
     * @desc 协议类型枚举
     * @enum {String}
     * @ignore
     */
    var SignalType = {
    	websocket: "websocket",
    	dataChannel: "dataChannel"
    };

    /**
     * @desc 房间类型枚举
     * @enum {String}
     */
    var RoomTypeEnum = {
    	join_host_first: "join.host.first",
    	net_acc: "net.acc",
    	host_control: "host.control",
    	free_speech: "free.speech"
    };

    /**
     * @desc 房间类型二进次对应
     * @ignore
    */
    var roomTypePrivilige = {
    	  join_host_first  : 1 << 1,              //房间中主持人要先加入，其他人才能加入
    	  net_acc : 1 << 2,                       //房间中网络加速
    	  host_control : 1 << 3,                  //房间是场控模式，严格控制房间中的音视频，参会者默认没有音视频打开权限
    };

    /**
     * @desc 引擎级别callback枚举
     * @enum {String}
     * @ignore
     */
    var EngineCallback = {
    	open_rep_return_0: "open.rep.return.0",

    	room_join_success: "room.join.success",
    	room_join_error: "room.join.error",

    	room_join_websocket_reconnection_success: "room.join.websocket.reconnection.success",

    	pub_roomresourcemsg_rep_success: "pub.roomresourcemsg.rep.success",
    	pub_roomresourcemsg_rep_error: "pub.roomresourcemsg.rep.error",

    	unpub_roomresourcemsg_rep_success: "unpub.roomresourcemsg.rep.success",
    	unpub_roomresourcemsg_rep_error: "unpub.roomresourcemsg.rep.error",

    	sub_roomresourcemsg_rep_success: "sub.roomresourcemsg.rep.success",
    	sub_roomresourcemsg_rep_error: "sub.roomresourcemsg.rep.error",

    	unsub_roomresourcemsg_rep_success: "unsub.roomresourcemsg.rep.success",
    	unsub_roomresourcemsg_rep_error: "unsub.roomresourcemsg.rep.error",

    	device_camera_change: "device.camera.change",
    	device_microphone_change: "device.microphone.change",

    	updateboardmsg_add_rep_success: "updateboardmsg.add.rep.success",
    	updateboardmsg_add_rep_error: "updateboardmsg.add.rep.error",

    	updateboardmsg_update_rep_success: "updateboardmsg.update.rep.success",
    	updateboardmsg_update_rep_error: "updateboardmsg.update.rep.error",

    	updateboardmsg_share_rep_success: "updateboardmsg.share.rep.success",
    	updateboardmsg_share_rep_error: "updateboardmsg.share.rep.error",

    	updateboardmsg_close_rep_success: "updateboardmsg.close.rep.success",
    	updateboardmsg_close_rep_error: "updateboardmsg.close.rep.error",

    	updateboardmsg_remove_rep_success: "updateboardmsg.remove.rep.success",
    	updateboardmsg_remove_rep_error: "updateboardmsg.remove.rep.error"
    };

    /**
     * @desc 数据加密类型枚举
     * @enum {number}
     */
    var DataCryptoType = {
    	AES128: 1,
    	AES256: 2,
    	SM4: 3  //国密
    };

    /**
     * @desc 视频编码格式枚举
     * @enum {number}
     */
    var VideoCodingType = {
    	VP8: 0,
    	VP9: 1,
    	H264: 2,
    	H265: 3
    };

    /**
     * @desc 音频编码格式枚举
     * @enum {number}
     */
    var AudioCodingType = {
    	ISAC_16k: 0,
    	ISAC_32k: 1,
    	opus: 2,
    	G722: 3,
    	PCMA: 4,
    	PCMU: 5
    };

    /**
     * @desc 分辨率枚举
     * @enum {Object}
     */
    var Resolution = {
    	"1920*1280": {
    		width: 1920,
    		height: 1280,
    		order: 16
    	},

        "1920*1080": {
    		width: 1920,
    		height: 1080,
    		order: 15
    	},

    	"1280*1024": {
    		width: 1280,
    		height: 1024,
    		order: 14
    	},

    	"1280*720": {
    		width: 1280,
    		height: 720,
    		order: 13
    	},

    	"960*720": {
    		width: 960,
    		height: 720,
    		order: 12
    	},

    	"640*1024": {
    		width: 640,
    		height: 1024,
    		order: 11
    	},

    	"640*960": {
    		width: 640,
    		height: 960,
    		order: 10
    	},

    	"640*480": {
    		width: 640,
    		height: 480,
    		order: 9
    	},

    	"640*360": {
    		width: 640,
    		height: 360,
    		order: 8
    	},

    	"508*360": {
    		width: 508,
    		height: 360,
    		order: 7
    	},

    	"480*854": {
    		width: 480,
    		height:854,
    		order: 6
    	},

    	"480*800": {
    		width: 480,
    		height:800,
    		order: 5
    	},

    	"320*480": {
    		width: 320,
    		height: 480,
    		order: 4
    	},

    	"320*240": {
    		width: 320,
    		height: 240,
    		order: 3
    	},

    	"320*180": {
    		width: 320,
    		height: 180,
    		order: 2
    	},

    	"160*120": {
    		width: 160,
    		height: 120,
    		order: 1
    	}
    };

    /**
     * @desc 分辨率设置类型枚举
     * @enum {number}
     */
    var ResolutionSetType = {
    	 /**
    	  * @desc  强制
    	  */
    	 exact: 0,

    	 /**
    	  * @desc  期望，摄像头不支持，可以向下兼容
    	  */
    	 ideal: 1
    };

    /**
     * @desc 网络状态枚举
     * @enum {number}
     */
    var ConnectionStatus = {
    	/**
    	 * @desc 初始状态
    	*/
    	init: 0,

    	/**
    	 * @desc  连接中
    	 */
    	connecting: 1,

    	/**
    	 * @desc  连接成功
    	 */
    	connected: 2,

    	/**
    	 * @desc  连接失败
    	 */
    	connectFailed: 3,

    	/**
    	 * @desc  重新加会超时
    	 */
    	reJoinRoomTimeOut: 4,

    	/**
    	 * @desc 重新加会成功
    	 */
    	reJoinConnected: 5,

    	/**
    	 * @desc 重连成功
    	 */
    	reconnected:6
    };

    /**
     * @desc MCU PeerConnection枚举
     * @enum {number}
     * @ignore
     */
    var MCUPeerConnectionStatus = {
    	failed: 0,
    	completed: 1
    };

    /**
     * @desc 房间状态枚举
     * @enum {number}
     */
    var RoomStatus = {
    	scheduled: 0,
    	opening: 1,
    	locked: 2,
    	closed: 3
    };

    /**
     * @desc 流状态枚举
     * @enum {number}
     */
    var StreamStatus = {
        none: 0,

        /**
         * @desc 初始状态
         */
        init: 1,

        /**
         * @desc 流发布状态
         */
        published: 2,

        muted: 3,
        forbided: 4,
        subed: 5,
        opened: 6
    };

    /**
     * @desc 摄像头前后置枚举
     * @enum {number}
     */
    var CameraType = {
    	/**
    	 * @desc 未知
    	 */
    	unknown: 0,

    	/**
    	 * @desc 前置
    	 */
    	front: 1,

    	/**
    	 * @desc 后置
    	 */
    	back: 2
    };

    /**
     * @desc 视频质量枚举
     * @enum {number}
     */
    var VideoQualityType = {
    	/**
    	 * @desc 高
    	 */
    	high: 4,

    	/**
    	 * @desc 中
    	 */
    	normal: 3,

    	/**
    	 * @desc 低
    	 */
    	low: 2
    };

    /**
     *  @desc 桌面共享弹窗显示内容选项
     *  @enum {string}
     */
    var ScreenDisplaySurface = {
    	browser: "browser",//Prefer to share a browser tab
    	window: "window", //Prefer to share a window
    	monitor: "monitor" ,//Prefer to share an entire screen
    	preferCurrentTab: "preferCurrentTab" //refer Current browser Tab
    };

    /**
     * @desc 房间级别callback枚举
     * @enum {String}
     */
    var RoomCallback = {
    	connection_status: "connection.status",
    	connection_indicator: "connection.indicator",
    	room_status_notify: "room.status.notify",

    	app_data_notify: "app.data.notify",
    	user_data_notify: "user.data.notify",
    	user_name_notify: "user.name.notify" ,

    	public_data: "public.data",
    	private_data: "private.data",

    	private_data_to_user: "private.data.to.user",

    	public_message: "public.message",
    	private_message: "private.message",

    	user_join_notify: "user.join.notify",
    	user_leave_notify: "user.leave.notify",
    	leave_indication: "leave.indication",
    	close_room_result: "close.room.result",
    	close_room_notify: "close.room.notify",

    	screen_sharing_ended: "screen.sharing.ended",

    	mcu_peerconnection_completed: "mcu.peerconnection.completed",

    	outgoing_invite_status_notify: "outgoing.invite.status.notify",

    	room_control_change_notify: "room.control.change.notify",

    	mediaplay_started_notify: "mediaplay.started.notify",

    	mediaplay_stoped_notify: "mediaplay.stoped.notify",

    	mediaplay_progress_notify: "mediaplay.progress.notify",

    	stream_keep_alive_timeout_notify: "stream.keep.alive.timeout.notify",

    	room_asr_status_changed_notify: "room.asr.status.changed.notify",

    	room_asr_text_msg: "room.asr.text.msg"
    };

    /**
     * @desc 用户级别callback枚举
     * @enum {String}
     *
     */
    var UserCallback = {
    	microphone_status_notify: "microphone.status.notify",
    	camera_status_notify: "camera.status.notify",
    	screen_status_notify: "screen.status.notify",
    	screen_audio_status_notify: "screen,audio.status.notify",

    	camera_data_notify: "camera.data.notify",
    	screen_data_notify: "screen.data.notify",

    	publish_camera_notify: "publish.camera.notify",
    	unpublish_camera_notify: "unpublish.camera.notify",
    	subscrible_camera_result: "subscrible.camera.result",
    	unsubscrible_camera_result: "unsubscrible.camera.result",

    	publish_screen_notify: "publish.screen.notify",
    	unpublish_screen_notify: "unpublish.screen.notify",
    	subscrible_screen_result: "subscrible.screen.result",
    	unsubscrible_screen_result: "unsubscrible.screen.result",

        publish_microphone_notify: "publish.microphone.notify",
        unpublish_microphone_notify: "unpublish.microphone.notify",
    	subscrible_microphone_result: "subscrible.microphone.result",
    	unsubscrible_microphone_result: "unsubscrible.microphone.result",

    	board_add_result: "board.add.result",
    	board_update_result: "board.update.result",
    	board_remove_result: "board.remove.result",
    	board_share_result: "board.share.result",
    	board_close_result: "board.close.result",

    	room_set_stream_name_rep_success:"room.set.stream.name.rep.success",
    	room_set_stream_name_rep_error:"room.set.stream.name.rep.error",

        video_stream_control_rep_success: "video.stream.control.rep.success",
    	video_stream_control_rep_error: "video.stream.control.rep.error",

        subscrible_screen_audio_result: "subscrible.screen.audio.result",
        unsubscrible_screen_audio_result: "unsubscrible.screen.audio.result"
    };

    var ExporderCallBack = {
    	stop_stream_rep_success: "stop.stream.rep.success",
    	stop_stream_rep_error: "stop.stream.rep.error",

    	pause_stream_rep_error: "pause.stream.rep.error",
    	pause_stream_rep_success: "pause.stream.rep.success",

    	mix_media_rep_error: "mix.media.rep.error",
    	mix_media_rep_success: "mix.media.rep.success",

    	select_stream_rep_success: "select.stream.rep.success",
    	select_stream_rep_error: "select.stream.rep.error",

    	create_server_recorder_rep_success: "create.server.recorder.rep.success",
    	create_server_recorder_rep_error: "create.server.recorder.rep.error",

    	bind_audio2video_rep_success: "bind.audio2video.rep.success",
    	bind_audio2video_rep_error: "bind.audio2video.rep.error",

    	set_focus_video_rep_success:"set.focus.video.rep.success",
    	set_focus_video_rep_error:"set.focus.video.rep.error",

    	get_exporter_info_rep_success:"get.exporter.info.rep.success",
    	get_exporter_info_rep_error:"get.exporter.info.rep.error"
    };

    /**
     * @desc 操作类型枚举
     * @enum {number}
     */
    var OperType = {
    	add: 1,
    	remove: 2,
    	update: 3,
    	share: 4,
    	close: 5
    };

    /**
     * @desc 录制各种类型枚举
     * @enum {number}
     */
    var RecordEnum = {

    	VideoType: {
    		novideo: 0,
    		mainflow: 1,
    		auxiliaryflow1: 2,
    		auxiliaryflow2: 3
    	},
    	AudioType: {
    		noaudio: 0,
    		singleuser: 1,
    		allusers: 2
    	},
    	FileType: {
    		mp4: 0,
    		webM: 1
    	}
    };

    /**
     * @desc 直播的各种类型枚举
     * @enum {number}
     */
    var LiveEnum = {

    	VideoType: {
    		novideo: 0,
    		mainflow: 1,
    		auxiliaryflow1: 2,
    		auxiliaryflow2: 3
    	},
    	AudioType: {
    		noaudio: 0,
    		singleuser: 1,
    		allusers: 2
    	}
    };

    /**
     * @desc 注释形状类别
     * @enum {String}
     */
    var shapeTypeEnum = {
    	mouse: 1,
    	line: 2,
    	rect: 3,
    	ellipse: 4,
    	polyline: 5,
    	hlight_point: 7,
    	hlight_texttag: 8,
    	eraser: 9,
    	rhomb: 11,
    	arrow: 12,
    	success: 13,
    	failure: 14,
    	clear: 17,
    	img: 18,
    	txt: 20,
    };

    /**
     * @desc 批注层初始化类型枚举
     * @enum {String}
     */
    var AnnotationInitTypeEnum = {
        /**
    	 * @desc 按比例缩放，推荐外部容器为div，此模式下SDK会根据外部容器元素宽高计算渲染的白板宽高，渲染的远端白板可以保持比例，不会造成画笔或者背景图的形变；SDK会自动创建背景层，无需应用层自动创建，SDK会自动更新背景图和背景色及下载白板时可以带背景层下载
    	 */
    	proportional: 'proportional',
        /**
         * @desc 平铺，外部容器可以为div也可以直接传入canvas，此模式下白板会撑满容器的宽高，可能会和远端白板比例不一致，造成画笔或者背景图的形变
         */
    	full: 'full',
    };

    /**
     * @desc 注释选择类别
     * @enum {number}
     */
    var boardStatusEnum = {
    	close: 0,
    	open: 1
    };
    /**
     * @desc 注释选择类别
     * @enum {number}
     */
    var annoSelectTypeEnum = {
    	mouse: 1,
    	draw: 2,
    	eraser: 3
    };

    /**
     * @desc 注释形状类别
     * @enum {number}
     */
    var canvasTypeEnum = {
    	mouse: 1,
    	line: 2,
    	rect: 3,
    	ellipse: 4,
    	polyline: 5,
    	hlight_point: 7,
    	hlight_texttag: 8,
    	eraser: 9,
    	rhomb: 11,
    	arrow: 12,
    	success: 13,
    	failure: 14,
    	clear: 17
    };

    /**
     * @desc 填充类别
     * @enum {number}
     */
    var fillTypeEnum = {
    	none: 1,
    	full: 2
    };

    /**
     * @desc 箭头类别
     * @enum {number}
     */
    var arrowTypeEnum = {
    	none: 1,
    	begin: 2,
    	end: 3,
    	double: 4
    };

    /**
     * @desc 箭头类别
     * @enum {number}
     */
    var connectionEventTypeEnum = {
    	sendVideo: 1,
    	recvVideo: 2,
    	sendAudio: 3,
    	recvAudio: 4,
    	conndidate: 5
    };

    /**
     * @desc 创建流导出类型枚举
     * @enum {number}
     */

    var exporterTypeEnum = {
    	record: 0,
    	record_real_time:1,
    	liver:2,
    	avc_media_mixer:7
    }

    /**
     * @desc 混屏布局枚举
     * @enum {number}
     */

    var viewLayoutModeEnum = {
    	fixation: 0,    //手动布局
    	auto:1,         //画廊自动布局
    	auto_orato:2    //演讲者自动布局
    }

    /**
     * @desc 录制状态枚举
     * @enum {number}
     */

    var exporterStatusEnum = {
    	stop:0,
    	live:1,
    	pause:2
    }

    /**
     * @desc 录制声音枚举
     * @enum {string}
     */
    var recorderAudioEnum = {
    	/**
    	 * @desc 所有用户
    	 */
    	AVD_userId_allUser : "userId2allUser",

    	/**
    	 * @desc 除自己外的所有用户
    	 */
    	AVD_userId_allUserWithoutMe :"userId2withoutMe",

    	/**
    	 * @desc 没有用户
    	 */
    	AVD_userId_noneUser:"userId2None"
    }

    /**
     * @desc 房间级别的AppData中KEY枚举
     * @enum {String}
     */
    var appDataKeyEnum = {
    	lecturer:"meeting_lecturer",       //当前发言人userId，通过语音激励来获取音量最大的用户
    	voiceActivated:"voice_activated"     //服务器下发的要求汇报人userId,如等于自己,进行语音激励汇报
    };

    /**
     * @desc 引擎级别设备变化事件类型枚举
     * @enum {number}
     */
    var changeTypeEnum = {
        remove: 0,
        add: 1
    };

    /**
     * @desc 房间状态
     * @enum {String}
     */
     var RoomStateEnum = {
        DISCONNECTED: 'DISCONNECTED', //未通过join加入房间或者已经通过leave离开房间
        CONNECTING: 'CONNECTING', //调用join时为此状态
        CONNECTED: 'CONNECTED', //已经加入房间
        RECONNECTING: 'RECONNECTING', //正在重新加会
        DISCONNECTING: 'DISCONNECTING' //调用leave、重连中、重新加会中
    }