From b1c62419aa9a4ebc4a470e94d061910f4b69a4cf Mon Sep 17 00:00:00 2001 From: "https://blog.iamtsm.cn" <1905333456@qq.com> Date: Sun, 20 Aug 2023 23:26:40 +0800 Subject: [PATCH] feat: socket heartbeat feat: video face mode feat: change nickname feat: update self connect css feat: docker-compose inner env fix: some lang error --- docker-compose-with-all-env.yml | 184 ++++++++++++++++++ svr/conf/cfg.json | 2 +- svr/res/css/index.css | 15 +- svr/res/index.html | 34 ++-- svr/res/js/index.js | 111 ++++++++++- svr/res/js/language.js | 8 + svr/res/js/videoShare.js | 4 +- svr/src/bussiness/notify/notifyHandler.js | 20 +- svr/src/socket/connect.js | 12 ++ .../rtcChangeNickName/changeNickName.js | 105 ++++++++++ svr/src/socket/rtcConstant.js | 8 + svr/src/socket/rtcHeartbeat/heartbeat.js | 26 +++ svr/static/layui/font-ext/demo_index.html | 75 ++++++- svr/static/layui/font-ext/iconfont.css | 18 +- svr/static/layui/font-ext/iconfont.js | 2 +- svr/static/layui/font-ext/iconfont.json | 21 ++ svr/static/layui/font-ext/iconfont.ttf | Bin 38572 -> 39952 bytes svr/static/layui/font-ext/iconfont.woff | Bin 22820 -> 23684 bytes svr/static/layui/font-ext/iconfont.woff2 | Bin 19456 -> 20236 bytes 19 files changed, 604 insertions(+), 41 deletions(-) create mode 100644 docker-compose-with-all-env.yml create mode 100644 svr/src/socket/rtcChangeNickName/changeNickName.js create mode 100644 svr/src/socket/rtcHeartbeat/heartbeat.js diff --git a/docker-compose-with-all-env.yml b/docker-compose-with-all-env.yml new file mode 100644 index 0000000..caa841b --- /dev/null +++ b/docker-compose-with-all-env.yml @@ -0,0 +1,184 @@ +## !!!!!!用于docker-compose部署并启动官方镜像!!!!!! +## !!!!!!内置配置的形式启动!!!!!!!!!!!!!!!!!!!!!!! + +version: '3' + +################## 按需修改好配置 +x-tlrtcfile-env: &tlrtcfile-env + ## api服务端口 + tl_rtc_file_api_port: 9092 + ## websocket服务端口 + tl_rtc_file_socket_port: 8444 + ## websocket服务地址 + tl_rtc_file_socket_host: 127.0.0.1:8444 + ## webrtc-stun中继服务地址 + tl_rtc_file_webrtc_stun_host: stun:127.0.0.1:3478 + ## webrtc-turn中继服务地址 + tl_rtc_file_webrtc_turn_host: turn:127.0.0.1:3478?transport=udp + ## webrtc中继服务用户名 + tl_rtc_file_webrtc_turn_username: tlrtcfile + ## webrtc中继服务密码 + tl_rtc_file_webrtc_turn_credential: tlrtcfile + ## webrtc中继服务Secret + tl_rtc_file_webrtc_turn_secret: tlrtcfile + ## webrtc中继服务帐号过期时间 (毫秒) + tl_rtc_file_webrtc_turn_expire: 86400000 + ## 是否开启数据库 + tl_rtc_file_db_open: true + ## 数据库地址 + tl_rtc_file_db_mysql_host: mysql + ## 数据库端口 + tl_rtc_file_db_mysql_port: 3306 + ## 数据库名称 + tl_rtc_file_db_mysql_dbName: webchat + ## 数据库用户名 + tl_rtc_file_db_mysql_user: tlrtcfile + ## 数据库密码 + tl_rtc_file_db_mysql_password: tlrtcfile + ## oss-seafile存储库ID + tl_rtc_file_oss_seafile_repoid: + ## oss-seafile地址 + tl_rtc_file_oss_seafile_host: + ## oss-seafile用户名 + tl_rtc_file_oss_seafile_username: + ## oss-seafile密码 + tl_rtc_file_oss_seafile_password: + ## oss-alyun存储accessKey + tl_rtc_file_oss_alyun_AccessKey: + ## oss-aly存储SecretKey + tl_rtc_file_oss_alyun_Secretkey: + ## oss-aly存储bucket + tl_rtc_file_oss_alyun_bucket: + ## oss-txyun存储accessKey + tl_rtc_file_oss_txyun_AccessKey: + ## oss-txyunt存储SecretKey + tl_rtc_file_oss_txyun_Secretkey: + ## oss-txyun存储bucket + tl_rtc_file_oss_txyun_bucket: + ## oss-qiniuyun存储accessKey + tl_rtc_file_oss_qiniuyun_AccessKey: + ## oss-qiniuyunt存储SecretKey + tl_rtc_file_oss_qiniuyun_Secretkey: + ## oss-qiniuyun存储bucket + tl_rtc_file_oss_qiniuyun_bucket: + ## 管理后台房间号 + tl_rtc_file_manage_room: tlrtcfile + ## 管理后台密码 + tl_rtc_file_manage_password: tlrtcfile + ## openai-key,如果有多个key,逗号分隔 + tl_rtc_file_openai_keys: + ## 企业微信通知开关 + tl_rtc_file_notify_open: false + ## 企业微信通知机器人KEY,正常通知,如果有多个key,逗号分隔 + tl_rtc_file_notify_qiwei_normal: + ## 企业微信通知机器人KEY,错误通知,如果有多个key,逗号分隔 + tl_rtc_file_notify_qiwei_error: + + +services: + + #http模式启动api服务 + api-http: + profiles: ['http'] + image: iamtsm/tl-rtc-file-api + container_name: api + environment: + <<: *tlrtcfile-env + tl_rtc_file_env_mode: http + command: + - tlapi + ports: + - 9092:9092 + links: + - mysql + depends_on: + - mysql + - coturn + + #https模式启动api服务 + api-https: + profiles: ['https'] + image: iamtsm/tl-rtc-file-api + container_name: api + environment: + <<: *tlrtcfile-env + tl_rtc_file_env_mode: https + command: + - tlapi + ports: + - 9092:9092 + links: + - mysql + depends_on: + - mysql + - coturn + + #http模式启动socket服务 + socket-http: + profiles: ['http'] + image: iamtsm/tl-rtc-file-socket + container_name: socket + command: + - tlsocket + environment: + <<: *tlrtcfile-env + tl_rtc_file_env_mode: http + ports: + - 8444:8444 + links: + - mysql + depends_on: + - mysql + - coturn + + #https模式启动socket服务 + socket-https: + profiles: ['https'] + image: iamtsm/tl-rtc-file-socket + container_name: socket + command: + - tlsocket + environment: + <<: *tlrtcfile-env + tl_rtc_file_env_mode: https + ports: + - 8444:8444 + links: + - mysql + depends_on: + - mysql + - coturn + + #mysql服务 + mysql: + profiles: ['http','https'] + image: iamtsm/tl-rtc-file-mysql + container_name: mysql + restart: always + environment: + #设置root密码 + MYSQL_ROOT_PASSWORD: tlrtcfile + #设置数据库 + MYSQL_DATABASE: webchat + #设置用户 + MYSQL_USER: tlrtcfile + #设置用户密码 + MYSQL_PASSWORD: tlrtcfile + ports: + - 3306:3306 + volumes: + - ./db:/var/lib/mysql + - ./my.cnf:/etc/mysql/conf.d/my.cnf + - ./log:/var/log/mysql + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + + #coturn服务 + coturn: + profiles: ['http','https'] + image: iamtsm/tl-rtc-file-coturn + container_name: coturn + ports: + - "3478:3478/udp" + - "3478:3478/tcp" + volumes: + - ./turnserver-with-secret-user.conf:/etc/turnserver.conf \ No newline at end of file diff --git a/svr/conf/cfg.json b/svr/conf/cfg.json index 9c62bc4..c78f0f9 100644 --- a/svr/conf/cfg.json +++ b/svr/conf/cfg.json @@ -1,5 +1,5 @@ { - "version": "10.4.5", + "version": "10.4.6", "socket": { "port": "请到 tlrtcfile.env 中进行配置", "host": "请到 tlrtcfile.env 中进行配置" diff --git a/svr/res/css/index.css b/svr/res/css/index.css index cf36284..5cd0d0a 100644 --- a/svr/res/css/index.css +++ b/svr/res/css/index.css @@ -258,7 +258,6 @@ body { .tl-rtc-file-user { padding: 10px 20px 0px 10px; cursor: pointer; - background-color: rgb(248, 253, 255); border-radius: 10px; box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 3px; transition: box-shadow 0.3s; @@ -1081,7 +1080,6 @@ body { user-select: none; } - .chating_input_body{ bottom: 0px; position: absolute; @@ -1111,7 +1109,6 @@ body { border-radius: 5px; } - .remote_user_info{ text-align: left; padding: 20px 20px 0 20px; @@ -1142,7 +1139,7 @@ body { max-width: 40px; width: 5% !important; margin-left: 50% !important; - } +} .tl-rtc-file-tool-mobile { padding: 5px !important; @@ -1157,7 +1154,7 @@ body { word-break: keep-all !important; margin: 0 !important; bottom: 0 !important; - -webkit-transform-origin-x: 0 !important; + -webkit-transform-origin-x: 0 !important; transform: scale(0.6) !important; -webkit-transform: scale(0.6) !important; } @@ -1167,18 +1164,18 @@ body { margin: 10px 20px; border-radius: 8px; cursor: pointer; - transition: all 0.5s; + transition: all 0.3s; font-weight: bold; - color: #595252e3; + color: black; } .tl-rtc-file-live-user-choose svg{ - font-size: 3rem; + font-size: 2rem; margin-bottom: 5px; } .tl-rtc-file-live-user-choose:hover{ - color: black; + color: #79b0e8; } /* 500px以下 */ diff --git a/svr/res/index.html b/svr/res/index.html index 18a2736..bcaa55c 100644 --- a/svr/res/index.html +++ b/svr/res/index.html @@ -330,11 +330,13 @@