Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
13b6278a
Commit
13b6278a
authored
Aug 30, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回复页面也在轮询的bug
parent
4532a364
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
140 deletions
+10
-140
src/pages/InteractiveResponse/components/human.vue
+10
-4
src/pages/InteractiveResponse/index.vue
+0
-136
No files found.
src/pages/InteractiveResponse/components/human.vue
View file @
13b6278a
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
:disabled=
"disabled"
:disabled=
"disabled"
v-model:value=
"soundColorValue"
v-model:value=
"soundColorValue"
:list=
"lists.soundColor"
:list=
"lists.soundColor"
:reset=
"true"
@
itemChange=
"soundColorItemChange"
@
itemChange=
"soundColorItemChange"
>
>
<div>
<div>
...
@@ -173,14 +174,19 @@ const submit = async () => {
...
@@ -173,14 +174,19 @@ const submit = async () => {
}
}
try
{
try
{
loading
.
value
=
true
;
loading
.
value
=
true
;
let
res
:
any
=
await
liveInteractionReply
(
route
.
query
.
id
,
{
let
params
=
{
phonetic_timbres_id
:
soundColorValue
.
value
,
phonetic_timbres_id
:
soundColorValue
.
value
,
reply_content
:
textareaValue
.
value
,
reply_content
:
textareaValue
.
value
,
tone_id
:
textTonesValue
.
value
,
tone_id
:
textTonesValue
.
value
,
});
};
if
(
res
.
code
==
0
)
{
let
res
:
any
=
await
liveInteractionReply
(
route
.
query
.
id
,
params
);
if
(
res
.
code
==
0
&&
res
.
data
.
status
)
{
console
.
log
(
'播放音频'
);
// 播放音频
// 播放音频
emit
(
'createAudio'
,
res
.
data
.
status
);
emit
(
'createAudio'
,
res
.
data
.
status
);
}
else
{
console
.
log
(
'没有音频'
,
res
.
data
);
console
.
log
(
route
.
query
.
id
,
params
);
}
}
loading
.
value
=
false
;
loading
.
value
=
false
;
}
catch
(
e
)
{
}
catch
(
e
)
{
...
@@ -214,7 +220,7 @@ const onJump = () => {
...
@@ -214,7 +220,7 @@ const onJump = () => {
};
};
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
let
res
=
await
getTonesList
();
let
res
=
await
getTonesList
(
true
);
lists
.
tones
=
res
.
tones
;
lists
.
tones
=
res
.
tones
;
lists
.
soundColor
=
res
.
soundColor
;
lists
.
soundColor
=
res
.
soundColor
;
});
});
...
...
src/pages/InteractiveResponse/index.vue
View file @
13b6278a
...
@@ -44,142 +44,6 @@ const audioEnded = () => {
...
@@ -44,142 +44,6 @@ const audioEnded = () => {
// 通知python将直播页面的音量恢复
// 通知python将直播页面的音量恢复
callPyjsInWindow
(
'videoVolumeRestoration'
);
callPyjsInWindow
(
'videoVolumeRestoration'
);
};
};
// 定时检测python的方法是否注入成功
let
interval
=
null
;
// 定时获取直播互动内容
let
intervalLive
=
null
;
// 处理后的视频
const
realVideo
=
ref
(
''
);
// 新增视频(当前)
const
addVideo
=
ref
(
imgs
.
mp4
);
// 视频列表
const
addVideoList
=
ref
([]);
// 当前播放id
const
addVideoId
=
ref
(
''
);
const
stopInterval
=
()
=>
{
window
.
clearInterval
(
interval
);
clearInterval
(
interval
);
interval
=
null
;
};
// 获取最新的内容
const
openInterval
=
()
=>
{
interval
=
window
.
setInterval
(()
=>
{
// 找到第一个没有播放的
for
(
let
i
=
0
;
i
<
addVideoList
.
value
.
length
;
i
++
)
{
let
item
=
addVideoList
.
value
[
i
];
if
(
item
.
play_status
===
false
&&
item
.
remove
)
{
// 已有取走的任务正在执行
// console.log('已有取走的任务正在执行');
break
;
}
if
(
item
.
play_status
===
false
&&
item
.
remove
===
false
)
{
if
(
addVideo
.
value
==
item
.
reply_content
)
{
// 本次播放的视频与上次一致,通知视频模块重新播放
store
.
commit
(
'live/videoReload'
);
// console.log('本次视频与上次一致');
}
addVideoList
.
value
[
i
].
remove
=
true
;
addVideo
.
value
=
item
.
reply_content
;
addVideoId
.
value
=
item
.
id
;
break
;
}
}
},
100
);
};
// 获取直播互动内容
const
getLive
=
async
()
=>
{
try
{
let
res
:
any
=
await
getliveTaskReply
(
route
.
query
.
id
);
if
(
res
.
code
==
0
&&
res
.
data
&&
res
.
data
.
length
)
{
// if (isDev()) {
// num += 1;
// res.data = [
// {
// id: num,
// reply_content:
// num % 2 == 1
// ? 'https://yunyi-live.oss-cn-hangzhou.aliyuncs.com/live/output/1.mp4'
// : 'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/5c8eeb9e-6a7b-45e6-85f9-1c75c945b8b1.mp4',
// },
// {
// id: num++,
// reply_content:
// num % 2 == 1
// ? 'https://yunyi-live.oss-cn-hangzhou.aliyuncs.com/live/output/1.mp4'
// : 'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/5c8eeb9e-6a7b-45e6-85f9-1c75c945b8b1.mp4',
// },
// ];
// }
res
.
data
.
forEach
((
item
:
any
)
=>
{
item
.
play_status
=
false
;
item
.
remove
=
false
;
});
//id
// problem
// reply_content
addVideoList
.
value
=
addVideoList
.
value
.
concat
(
res
.
data
);
}
}
catch
(
e
)
{
console
.
log
(
e
);
}
};
// 开启
const
startLiveInterval
=
()
=>
{
closeLiveInterval
();
intervalLive
=
window
.
setInterval
(()
=>
{
getLive
();
},
3000
);
};
// 关闭
const
closeLiveInterval
=
()
=>
{
window
.
clearInterval
(
intervalLive
);
clearInterval
(
intervalLive
);
intervalLive
=
null
;
};
// python 回调
const
mergeCallback
=
(
params
:
any
)
=>
{
try
{
if
(
params
.
video
)
{
realVideo
.
value
=
params
.
video
;
}
if
(
params
.
add_video
)
{
addVideo
.
value
=
params
.
add_video
;
}
}
catch
(
e
)
{
writeLog
({
name
:
'mergeCallback error'
,
value
:
e
,
});
console
.
log
(
e
);
}
};
onMounted
(
async
()
=>
{
// 将通知方法注入window
injectWindow
(
'mergeCallback'
,
mergeCallback
);
// if (isDev()) {
// mergeCallback({
// video: imgs.mp4,
// });
// }
// 打开定时任务
startLiveInterval
();
openInterval
();
});
onBeforeUnmount
(()
=>
{
closeLiveInterval
();
stopInterval
();
});
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment