This commit is contained in:
parent
5f611d2192
commit
545848844c
@ -9,7 +9,6 @@ const { MessageHistory } = require('./src/message_history.js');
|
|||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
const io = socketIo(server, {
|
const io = socketIo(server, {
|
||||||
path: '/emotion-male-app/socket.io',
|
|
||||||
pingTimeout: 300000, // 60秒超时
|
pingTimeout: 300000, // 60秒超时
|
||||||
pingInterval: 25000, // 25秒心跳间隔
|
pingInterval: 25000, // 25秒心跳间隔
|
||||||
upgradeTimeout: 30000, // 30秒升级超时
|
upgradeTimeout: 30000, // 30秒升级超时
|
||||||
|
|||||||
@ -532,7 +532,7 @@
|
|||||||
<video id="localVideo" autoplay muted playsinline style="display: none;"></video>
|
<video id="localVideo" autoplay muted playsinline style="display: none;"></video>
|
||||||
<video id="remoteVideo" autoplay playsinline style="display: none;"></video>
|
<video id="remoteVideo" autoplay playsinline style="display: none;"></video>
|
||||||
|
|
||||||
<script src="/socket.io/socket.io.js"></script>
|
<script src="/emotion-male-app/socket.io/socket.io.js"></script>
|
||||||
<script type="module" src="./index.js"></script>
|
<script type="module" src="./index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
12
src/index.js
12
src/index.js
@ -172,9 +172,7 @@ class WebRTCChat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initializeSocket() {
|
initializeSocket() {
|
||||||
this.socket = io({
|
this.socket = io();
|
||||||
path: '/emotion-male-app/socket.io'
|
|
||||||
});
|
|
||||||
|
|
||||||
this.socket.on('connect', () => {
|
this.socket.on('connect', () => {
|
||||||
this.updateStatus('已连接到服务器', 'connected');
|
this.updateStatus('已连接到服务器', 'connected');
|
||||||
@ -247,7 +245,7 @@ class WebRTCChat {
|
|||||||
console.log('开始初始化开场白音频...');
|
console.log('开始初始化开场白音频...');
|
||||||
|
|
||||||
// 获取当前场景的开场白
|
// 获取当前场景的开场白
|
||||||
const response = await fetch('/api/current-scene/opening-line');
|
const response = await fetch('/emotion-male-app/api/current-scene/opening-line');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (data.success && data.openingLine) {
|
if (data.success && data.openingLine) {
|
||||||
@ -347,7 +345,7 @@ class WebRTCChat {
|
|||||||
|
|
||||||
async loadVideoMapping() {
|
async loadVideoMapping() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/video-mapping');
|
const response = await fetch('/emotion-male-app/api/video-mapping');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
this.videoMapping = data.mapping;
|
this.videoMapping = data.mapping;
|
||||||
this.interactionVideo = data.mapping['8-4-sh'];
|
this.interactionVideo = data.mapping['8-4-sh'];
|
||||||
@ -360,7 +358,7 @@ class WebRTCChat {
|
|||||||
|
|
||||||
async loadDefaultVideo() {
|
async loadDefaultVideo() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/default-video');
|
const response = await fetch('/emotion-male-app/api/default-video');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
this.defaultVideo = data.defaultVideo;
|
this.defaultVideo = data.defaultVideo;
|
||||||
this.logMessage('默认视频配置加载成功', 'success');
|
this.logMessage('默认视频配置加载成功', 'success');
|
||||||
@ -371,7 +369,7 @@ class WebRTCChat {
|
|||||||
|
|
||||||
async loadVideoList() {
|
async loadVideoList() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/videos');
|
const response = await fetch('/emotion-male-app/api/videos');
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
this.renderVideoList(data.videos);
|
this.renderVideoList(data.videos);
|
||||||
this.logMessage('视频列表加载成功', 'success');
|
this.logMessage('视频列表加载成功', 'success');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user