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
a86dda13
Commit
a86dda13
authored
Aug 01, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
播放数字人视频改为优先从python获取
parent
5add2379
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
142 deletions
+45
-142
src/App.vue
+7
-7
src/components/AddVideoPlay.vue
+0
-2
src/components/pageTitle.vue
+0
-114
src/pages/InteractiveResponse/components/human.vue
+2
-0
src/pages/createLive/components/ChoseDigitalPerson.vue
+10
-3
src/pages/home/index.vue
+12
-0
src/pages/startLive/components/video.vue
+0
-14
src/utils/pyqt.ts
+14
-2
No files found.
src/App.vue
View file @
a86dda13
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<router-view
:class=
"[mode]"
/>
<router-view
:class=
"[mode]"
/>
</
template
>
</
template
>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
computed
,
on
BeforeUnmount
,
on
Mounted
}
from
'vue'
;
import
{
computed
,
onMounted
}
from
'vue'
;
import
{
useStore
}
from
'vuex'
;
import
{
useStore
}
from
'vuex'
;
import
config
from
'@/config/style'
;
import
config
from
'@/config/style'
;
import
{
useREM
}
from
'@/utils/rem'
;
import
{
useREM
}
from
'@/utils/rem'
;
...
@@ -17,14 +17,14 @@ const mode = computed(() => {
...
@@ -17,14 +17,14 @@ const mode = computed(() => {
return
store
.
getters
[
'setting/mode'
];
return
store
.
getters
[
'setting/mode'
];
});
});
const
contextMenuListener
=
(
event
:
any
)
=>
{
//
const contextMenuListener = (event: any) => {
event
.
preventDefault
();
//
event.preventDefault();
};
//
};
// 销毁
// 销毁
const
destroyContextMenuListener
=
()
=>
{
//
const destroyContextMenuListener = () => {
document
.
removeEventListener
(
'contextmenu'
,
contextMenuListener
);
//
document.removeEventListener('contextmenu', contextMenuListener);
};
//
};
onMounted
(()
=>
{
onMounted
(()
=>
{
store
.
dispatch
(
'setting/changeTheme'
,
{
...
config
});
store
.
dispatch
(
'setting/changeTheme'
,
{
...
config
});
...
...
src/components/AddVideoPlay.vue
View file @
a86dda13
...
@@ -187,7 +187,6 @@ const updateTime = () => {
...
@@ -187,7 +187,6 @@ const updateTime = () => {
};
};
// 减小正在播放的视频音量
// 减小正在播放的视频音量
const
lowerVideoVolume
=
()
=>
{
const
lowerVideoVolume
=
()
=>
{
console
.
error
(
'减小音量'
);
let
num
=
0.5
;
let
num
=
0.5
;
if
(
showFirstVideo
.
value
)
{
if
(
showFirstVideo
.
value
)
{
// 第一个正在播放
// 第一个正在播放
...
@@ -199,7 +198,6 @@ const lowerVideoVolume = () => {
...
@@ -199,7 +198,6 @@ const lowerVideoVolume = () => {
// 恢复音量,两个视频标签都恢复
// 恢复音量,两个视频标签都恢复
const
videoVolumeRestoration
=
()
=>
{
const
videoVolumeRestoration
=
()
=>
{
console
.
error
(
'恢复音量'
);
firstVideoVolume
.
value
=
initVolume
;
firstVideoVolume
.
value
=
initVolume
;
secondVideoVolume
.
value
=
initVolume
;
secondVideoVolume
.
value
=
initVolume
;
};
};
...
...
src/components/pageTitle.vue
deleted
100644 → 0
View file @
5add2379
<
template
>
<div
class=
"custom-earncoins-header"
:style=
"
{ backgroundImage: backgroundImage }">
<div
class=
"header-title"
>
<div
class=
"title_t1"
>
{{
title1
}}
</div>
<div
class=
"title_t2"
>
{{
title2
}}
</div>
</div>
<div
class=
"header-assets"
v-if=
"right"
:style=
"
{
height: height + 'px',
}"
>
<div>
{{
title
}}
</div>
<div
class=
"card-content-box"
>
<slot
name=
"assets"
></slot>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
const
props
=
withDefaults
(
defineProps
<
{
title1
:
string
;
title2
:
string
;
backgroundImage
?:
string
|
null
;
// 右侧模块的值
right
?:
boolean
;
height
?:
number
;
title
?:
string
;
}
>
(),
{
backgroundImage
:
''
,
right
:
false
,
height
:
160
,
title
:
''
,
},
);
</
script
>
<
style
lang=
"less"
>
@import
'@/style/flex.less'
;
@import
'@/style/variables.less'
;
.custom-earncoins-header
{
margin
:
0px
;
background
:
url(@/assets/img/EarnCoins.png)
no-repeat
;
background-size
:
100%
40%
;
background-attachment
:
fixed
;
/*改变背景图的长和宽*/
height
:
398px
;
.dj(space-between);
padding
:
@
homepadding
;
overflow
:
hidden
;
&
>
*
{
margin-top
:
100px
;
}
.header-title
{
.title_t1
{
font-size
:
45px
;
font-weight
:
800
;
line-height
:
53px
;
}
.title_t2
{
font-size
:
20px
;
line-height
:
40px
;
font-weight
:
800
;
max-width
:
600px
;
}
}
.header-assets
{
width
:
432px
;
border-radius
:
14px
;
background
:
#fefefe
;
opacity
:
0.95
;
border
:
1.5px
solid
#e3e3e3
;
box-shadow
:
30px
28px
20px
rgba
(
16
,
16
,
16
,
0.1
);
padding
:
30px
;
.card-content-box
{
.dj(space-between);
flex-wrap
:
wrap
;
row-gap
:
12px
;
&
>
*
{
width
:
50%
;
}
&
>
:nth-child
(
2n
)
{
text-align
:
right
;
}
.card-content
{
&
>
:not(:first-child)
{
margin-top
:
12px
;
}
.card-label
{
font-weight
:
800
;
font-size
:
16px
;
color
:
#595a5a
;
}
.user-assets
{
font-weight
:
800
;
font-size
:
16px
;
color
:
#222222
;
}
.conversion-assets
{
font-weight
:
600
;
font-size
:
12px
;
color
:
#222222
;
}
.green
{
color
:
#25a69a
;
}
}
}
}
}
</
style
>
src/pages/InteractiveResponse/components/human.vue
View file @
a86dda13
...
@@ -158,6 +158,8 @@ const closeLive = async () => {
...
@@ -158,6 +158,8 @@ const closeLive = async () => {
changeRouteQuery
();
changeRouteQuery
();
// 通知python刷新所有首页的直播列表
// 通知python刷新所有首页的直播列表
callPyjsInWindow
(
'reloadLiveTaskList'
);
callPyjsInWindow
(
'reloadLiveTaskList'
);
// 通知python关闭视频播放页面
callPyjsInWindow
(
'closeLivePage'
);
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
...
...
src/pages/createLive/components/ChoseDigitalPerson.vue
View file @
a86dda13
...
@@ -39,6 +39,7 @@ import { createLiveKeys } from '@/service/CreateLive';
...
@@ -39,6 +39,7 @@ import { createLiveKeys } from '@/service/CreateLive';
import
{
useLiveInfoSubmit
}
from
'@/hooks/useStoreCommit'
;
import
{
useLiveInfoSubmit
}
from
'@/hooks/useStoreCommit'
;
import
{
getDigitalPeopleList
}
from
'@/service/Common'
;
import
{
getDigitalPeopleList
}
from
'@/service/Common'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
callPyjsInWindow
}
from
'@/utils/pyqt'
;
const
[
commitInfo
]
=
useLiveInfoSubmit
();
const
[
commitInfo
]
=
useLiveInfoSubmit
();
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
...
@@ -124,14 +125,20 @@ const onSelectChange = (value: string) => {
...
@@ -124,14 +125,20 @@ const onSelectChange = (value: string) => {
checkPerson
();
checkPerson
();
};
};
// 从python获取视频路径
const
getVideoPath
=
async
(
row
:
any
)
=>
{
let
url
=
await
callPyjsInWindow
(
'getDigimonVideo'
,
row
,
true
);
// 将对应的图片传给右侧工具
// store.commit('live/setLiveImage', row.cover_url);
store
.
commit
(
'live/setLiveImage'
,
url
?
url
:
row
.
video_url
);
};
const
onCardChange
=
(
id
:
string
|
number
,
row
:
any
)
=>
{
const
onCardChange
=
(
id
:
string
|
number
,
row
:
any
)
=>
{
currentCard
.
value
=
id
;
currentCard
.
value
=
id
;
commitInfo
({
commitInfo
({
[
createLiveKeys
.
id
]:
id
,
[
createLiveKeys
.
id
]:
id
,
});
});
// 将对应的图片传给右侧工具
getVideoPath
(
row
);
// store.commit('live/setLiveImage', row.cover_url);
store
.
commit
(
'live/setLiveImage'
,
row
.
video_url
);
};
};
// 数字人列表
// 数字人列表
...
...
src/pages/home/index.vue
View file @
a86dda13
...
@@ -79,6 +79,7 @@ import routerConfig from '@/router/tool';
...
@@ -79,6 +79,7 @@ import routerConfig from '@/router/tool';
import
{
useRouter
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
getDigitalPeopleList
}
from
'@/service/Common'
;
import
{
getDigitalPeopleList
}
from
'@/service/Common'
;
import
Button
from
'@/components/Button.vue'
;
import
Button
from
'@/components/Button.vue'
;
import
{
callPyjsInWindow
}
from
'@/utils/pyqt'
;
const
router
=
useRouter
();
const
router
=
useRouter
();
...
@@ -174,6 +175,17 @@ const getList = async () => {
...
@@ -174,6 +175,17 @@ const getList = async () => {
digitalPeopleList
.
list
=
digitalPeopleList
.
myList
.
concat
(
digitalPeopleList
.
adminList
).
slice
(
0
,
5
);
digitalPeopleList
.
list
=
digitalPeopleList
.
myList
.
concat
(
digitalPeopleList
.
adminList
).
slice
(
0
,
5
);
}
}
digitalPeopleList
.
loading
=
false
;
digitalPeopleList
.
loading
=
false
;
// 通知python下载数字人视频
let
oldList
=
res
.
adminList
.
concat
(
res
.
myList
);
let
newList
=
[];
oldList
.
forEach
((
item
:
any
)
=>
{
let
obj
=
{
id
:
item
.
id
,
video_url
:
item
.
video_url
,
};
newList
.
push
(
obj
);
});
callPyjsInWindow
(
'downloadDigitalPeopleVideo'
,
newList
);
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
digitalPeopleList
.
loading
=
false
;
digitalPeopleList
.
loading
=
false
;
...
...
src/pages/startLive/components/video.vue
View file @
a86dda13
<
template
>
<
template
>
<div
class=
"start-live-video"
>
<div
class=
"start-live-video"
>
<!--
<Button
theme=
"green"
@
click=
"playVideo"
>
开始播放
</Button>
-->
<AddVideoPlay
<AddVideoPlay
v-model:progress=
"progress"
v-model:progress=
"progress"
:playId=
"playId"
:playId=
"playId"
...
@@ -12,7 +11,6 @@
...
@@ -12,7 +11,6 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
Button
from
'@/components/Button.vue'
;
import
{
onBeforeUnmount
,
ref
,
watch
}
from
'vue'
;
import
{
onBeforeUnmount
,
ref
,
watch
}
from
'vue'
;
import
AddVideoPlay
from
'@/components/AddVideoPlay.vue'
;
import
AddVideoPlay
from
'@/components/AddVideoPlay.vue'
;
...
@@ -50,18 +48,6 @@ const closeInterval = () => {
...
@@ -50,18 +48,6 @@ const closeInterval = () => {
interval1
=
null
;
interval1
=
null
;
};
};
const
playVideo
=
()
=>
{
console
.
log
(
videoRef1
.
value
);
videoRef1
.
value
.
play
();
closeInterval
();
interval1
=
window
.
setInterval
(()
=>
{
// 播放结束
if
(
videoRef1
.
value
.
ended
)
{
closeInterval
();
}
},
100
);
};
onBeforeUnmount
(()
=>
{
onBeforeUnmount
(()
=>
{
closeInterval
();
closeInterval
();
});
});
...
...
src/utils/pyqt.ts
View file @
a86dda13
...
@@ -24,9 +24,21 @@ export const injectWindow = (key: string, value: any, parent: string = '') => {
...
@@ -24,9 +24,21 @@ export const injectWindow = (key: string, value: any, parent: string = '') => {
/**
/**
* 调用python指定方法
* 调用python指定方法
*/
*/
export
const
callPyjsInWindow
=
(
name
:
string
,
value
:
any
=
''
)
=>
{
export
const
callPyjsInWindow
=
(
name
:
string
,
value
:
any
=
''
,
callback
:
boolean
=
false
,
timeout
:
number
=
1000
)
=>
{
try
{
try
{
window
.
pyjs
[
name
](
JSON
.
stringify
(
value
));
if
(
callback
)
{
// 返回一个Promise
return
new
Promise
(
function
(
resolve
,
reject
)
{
window
.
pyjs
[
name
](
JSON
.
stringify
(
value
),
function
(
response
:
any
)
{
// 在这里处理返回的值
resolve
(
response
);
});
setTimeout
(()
=>
{
reject
(
false
);
},
timeout
);
});
}
return
window
.
pyjs
[
name
](
JSON
.
stringify
(
value
));
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
);
console
.
error
(
e
);
}
}
...
...
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