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
096e7203
Commit
096e7203
authored
Aug 18, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加新版直播页面
parent
ba2ce170
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
22 deletions
+82
-22
src/components/AddVideoPlay.vue
+2
-0
src/constants/token.ts
+1
-1
src/pages/OnlyVideoLive/index.vue
+39
-21
src/pages/OnlyVideoLive/indexV2.vue
+0
-0
src/service/CreateLive.ts
+40
-0
No files found.
src/components/AddVideoPlay.vue
View file @
096e7203
...
@@ -52,6 +52,8 @@ import { onBeforeRouteLeave } from 'vue-router';
...
@@ -52,6 +52,8 @@ import { onBeforeRouteLeave } from 'vue-router';
import
{
injectWindow
}
from
'@/utils/pyqt'
;
import
{
injectWindow
}
from
'@/utils/pyqt'
;
import
{
scriptTypePhonetics
}
from
'@/service/CreateLive'
;
import
{
scriptTypePhonetics
}
from
'@/service/CreateLive'
;
// 再加一个动作视频标签
const
props
=
withDefaults
(
const
props
=
withDefaults
(
defineProps
<
{
defineProps
<
{
playMainIndex
:
number
|
null
;
playMainIndex
:
number
|
null
;
...
...
src/constants/token.ts
View file @
096e7203
...
@@ -71,7 +71,7 @@ export const getRoutes = () => {
...
@@ -71,7 +71,7 @@ export const getRoutes = () => {
{
{
path
:
routerConfig
.
onlyVideoLive
.
path
,
path
:
routerConfig
.
onlyVideoLive
.
path
,
name
:
routerConfig
.
onlyVideoLive
.
name
,
name
:
routerConfig
.
onlyVideoLive
.
name
,
component
:
()
=>
import
(
'@/pages/OnlyVideoLive/index.vue'
),
component
:
()
=>
import
(
'@/pages/OnlyVideoLive/index
V2
.vue'
),
meta
:
{
title
:
'snowhome'
,
header
:
false
,
navbar
:
false
},
meta
:
{
title
:
'snowhome'
,
header
:
false
,
navbar
:
false
},
},
},
// 只有人工回复的页面
// 只有人工回复的页面
...
...
src/pages/OnlyVideoLive/index.vue
View file @
096e7203
...
@@ -55,6 +55,8 @@ const imgs = {
...
@@ -55,6 +55,8 @@ const imgs = {
mp4
:
new
URL
(
'../../assets/img/1.mp4'
,
import
.
meta
.
url
).
href
,
mp4
:
new
URL
(
'../../assets/img/1.mp4'
,
import
.
meta
.
url
).
href
,
};
};
// 本次测试用的变量
const
requestNum
=
ref
(
0
);
const
isFirst
=
ref
(
true
);
const
isFirst
=
ref
(
true
);
// 定时检测python的方法是否注入成功
// 定时检测python的方法是否注入成功
...
@@ -434,19 +436,46 @@ const getDetail = async (type: string = '') => {
...
@@ -434,19 +436,46 @@ const getDetail = async (type: string = '') => {
if
(
isDev
())
{
if
(
isDev
())
{
// 创建url
// 创建url
res
.
data
=
{};
res
.
data
=
{};
res
.
data
.
url
=
[
let
list
=
[
'http://yunyi-live.oss-cn-hangzhou.aliyuncs.com/live/output/87.mp4'
,
{
'http://yunyi-live.oss-cn-hangzhou.aliyuncs.com/live/output/87.mp4'
,
url
:
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/e9f3d546-05f2-4dc1-a37d-d6c0ca960e43.mp4'
,
'http://yunyi-live.oss-cn-hangzhou.aliyuncs.com/live/output/87.mp4'
,
type
:
1
,
},
{
url
:
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/9604b4aa-e509-4f74-a73f-a0dc130f8f28.mp4'
,
type
:
3
,
// 是否需要播放
},
{
url
:
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/f2112aea-6f69-4403-acef-33d0fda7e736.mp4'
,
type
:
1
,
},
];
];
res
.
data
.
type_content
=
[
// 哪些时间段不能播放动作视频和互动视频
res
.
data
.
period
=
[
{
{
content
:
'测试文案提交'
,
start
:
1
,
end
:
5
,
},
{
start
:
12
,
end
:
30
,
},
},
];
];
res
.
data
.
url
=
list
;
}
}
if
(
DataType
(
res
.
data
,
'object'
)
&&
res
.
data
.
url
&&
res
.
data
.
url
.
length
)
{
if
(
DataType
(
res
.
data
,
'object'
)
&&
res
.
data
.
url
&&
res
.
data
.
url
.
length
)
{
//
// 初始化视频列表的状态
res
.
data
.
url
.
forEach
((
item
:
any
)
=>
{
// 是否播放完毕
item
.
status
=
false
;
// 是否取走
item
.
remove
=
false
;
// 是否正在播放
item
.
play
=
false
;
});
// 取出所有 type==1 的主视频,计算总时长
realVideoList
.
value
.
push
({
realVideoList
.
value
.
push
({
url
:
res
.
data
.
url
,
url
:
res
.
data
.
url
,
// 合并后的地址
// 合并后的地址
...
@@ -459,27 +488,16 @@ const getDetail = async (type: string = '') => {
...
@@ -459,27 +488,16 @@ const getDetail = async (type: string = '') => {
play
:
false
,
play
:
false
,
// 是否已经提交给python
// 是否已经提交给python
submit
:
false
,
submit
:
false
,
// 下一个视频的状态
// 下一个视频的状态
(洗稿状态)
confuse
:
CONFUSE_STATUS
.
CONFUSE_STATUS_WAIT
,
confuse
:
CONFUSE_STATUS
.
CONFUSE_STATUS_WAIT
,
// 洗稿任务的uuid
uuid
:
v4
(),
});
});
if
(
isDev
())
{
if
(
isDev
())
{
let
list
=
[
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/e9f3d546-05f2-4dc1-a37d-d6c0ca960e43.mp4'
,
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/9604b4aa-e509-4f74-a73f-a0dc130f8f28.mp4'
,
'http://yunyi-tiktok.oss-cn-shenzhen.aliyuncs.com/files/user/admin/f2112aea-6f69-4403-acef-33d0fda7e736.mp4'
,
];
// if (realVideoList.value.length > list.length) {
// console.log('不需要添加了');
// return;
// }
if
(
isFirst
.
value
)
{
if
(
isFirst
.
value
)
{
mergeCallback
({
mergeCallback
({
// video: imgs.mp4,
video
:
res
.
data
.
url
[
0
].
url
,
video
:
list
[
0
],
index
:
realVideoList
.
value
.
length
-
1
,
index
:
realVideoList
.
value
.
length
-
1
,
childIndex
:
0
,
});
});
isFirst
.
value
=
false
;
isFirst
.
value
=
false
;
}
}
...
...
src/pages/OnlyVideoLive/indexV2.vue
0 → 100644
View file @
096e7203
This diff is collapsed.
Click to expand it.
src/service/CreateLive.ts
View file @
096e7203
...
@@ -4,6 +4,7 @@ import { audioStart } from '@/service/Common';
...
@@ -4,6 +4,7 @@ import { audioStart } from '@/service/Common';
import
store
from
'@/store'
;
import
store
from
'@/store'
;
import
{
v4
}
from
'uuid'
;
import
{
v4
}
from
'uuid'
;
import
{
writeLog
}
from
'@/utils/pyqt'
;
import
{
writeLog
}
from
'@/utils/pyqt'
;
import
{
getDurationOfAudioFile
}
from
'@/utils/audio'
;
/**
/**
* 创建直播的版本
* 创建直播的版本
...
@@ -56,6 +57,45 @@ export const typeSoundColor = 2; // 音色
...
@@ -56,6 +57,45 @@ export const typeSoundColor = 2; // 音色
export
const
movementTypeStart
=
1
;
// 开头插入
export
const
movementTypeStart
=
1
;
// 开头插入
export
const
movementTypeEnd
=
2
;
// 结尾插入
export
const
movementTypeEnd
=
2
;
// 结尾插入
// 计算音频块列表的开始时间和结束时间
export
const
getAudioStartTimeAndEndTime
=
async
(
list
:
any
[])
=>
{
try
{
let
durationList
=
[];
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
data
=
list
[
i
].
data
;
let
params
:
any
=
{
audio_url
:
data
.
audio_address
,
};
// 计算音频块的起始与结束时间点
let
duration
=
await
getDurationOfAudioFile
(
data
.
audio_address
);
console
.
log
(
duration
);
params
.
duration
=
duration
;
// 默认值
params
.
start
=
0
;
params
.
end
=
duration
;
durationList
.
forEach
((
it
:
any
)
=>
{
// 开始时间
params
.
start
+=
it
.
duration
;
});
durationList
.
push
(
params
);
if
(
i
!==
0
)
{
durationList
.
forEach
((
it
:
any
,
index
:
number
)
=>
{
// 不包括自己
if
(
index
!==
durationList
.
length
-
1
)
{
// 结束时间
durationList
[
i
].
end
+=
it
.
duration
;
}
});
}
}
return
durationList
;
}
catch
(
e
)
{
console
.
log
(
e
);
}
};
// 合并同类项音频
// 合并同类项音频
export
const
mergeSameAudio
=
(
content
:
any
[])
=>
{
export
const
mergeSameAudio
=
(
content
:
any
[])
=>
{
let
list
=
[];
let
list
=
[];
...
...
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