Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
roncoo
roncoo-education-admin
提交
5a32d814
R
roncoo-education-admin
项目概览
roncoo
/
roncoo-education-admin
9 个月 前同步成功
通知
47
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roncoo-education-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5a32d814
编写于
6月 06, 2023
作者:
F
fengyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化配置
上级
6412e9a3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
46 deletion
+42
-46
src/utils/mixin/uploadVideo.js
src/utils/mixin/uploadVideo.js
+38
-42
src/utils/vod.js
src/utils/vod.js
+4
-4
未找到文件。
src/utils/mixin/uploadVideo.js
浏览文件 @
5a32d814
import
{
mapGetters
}
from
'
vuex
'
import
{
vodConfig
}
from
'
@/api/upload
'
import
{
mapGetters
}
from
'
vuex
'
import
{
vodConfig
}
from
'
@/api/upload
'
import
PlvVideoUpload
from
'
@polyv/vod-upload-js-sdk
'
;
import
UploadFragment
from
'
@/utils/mixin/UploadFragment
'
;
// import uploaderCC from '@/utils/uploadCC'
...
...
@@ -55,7 +55,6 @@ export default {
// this.initPolyv()
},
methods
:
{
startUpload
(
_file
,
cb
)
{
console
.
log
(
_file
)
if
(
this
.
uploading
)
{
...
...
@@ -67,12 +66,9 @@ export default {
_file
.
vodModel
=
res
.
vodModel
if
(
this
.
videoPlatType
===
2
)
{
// 上传保利威
this
.
getPolyvVideoSign
(
res
.
polyv
Config
,
()
=>
{
this
.
getPolyvVideoSign
(
res
.
vodUpload
Config
,
()
=>
{
this
.
polyvUpload
(
_file
,
cb
)
})
}
else
if
(
this
.
videoPlatType
===
3
)
{
// 上传百家云
// this.baijiayunUpload(_file, cb)
}
else
{
// 其他的分片上传
this
.
initSimpleUpload
(
JSON
.
parse
(
res
.
vodUploadConfig
))
...
...
@@ -150,16 +146,16 @@ export default {
},
// 获取保利威上传sign
getPolyvVideoSign
(
res
,
cb
)
{
if
(
!
this
.
polyvClient
)
this
.
initPolyv
()
this
.
polyvClient
.
updateUserData
({
userid
:
res
.
userid
,
// Polyv云点播账号的ID
ptime
:
res
.
ptime
,
// 时间戳,注意:系统时间不正确会导致校验失败
sign
:
res
.
sign
,
// 是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值
hash
:
res
.
hash
// 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值
});
if
(
cb
)
{
cb
()
}
if
(
!
this
.
polyvClient
)
this
.
initPolyv
()
this
.
polyvClient
.
updateUserData
({
userid
:
res
.
userid
,
// Polyv云点播账号的ID
ptime
:
res
.
ptime
,
// 时间戳,注意:系统时间不正确会导致校验失败
sign
:
res
.
sign
,
// 是根据将secretkey和ts按照顺序拼凑起来的字符串进行MD5计算得到的值
hash
:
res
.
hash
// 是根据将ts和writeToken按照顺序拼凑起来的字符串进行MD5计算得到的值
});
if
(
cb
)
{
cb
()
}
},
// polyv上传
polyvUpload
(
_file
)
{
...
...
@@ -168,7 +164,7 @@ export default {
const
fileSetting
=
{
title
:
undefined
,
// 标题
desc
:
undefined
,
// 描述
cataid
:
_file
.
polyv
Config
.
cataid
,
// 上传分类目录ID
cataid
:
_file
.
vodUpload
Config
.
cataid
,
// 上传分类目录ID
tag
:
'
course
'
,
// 标签
luping
:
1
,
// 是否录屏优化。当值为1时,上传的视频不再采取默认的压缩编码机制,视频尺寸不再压缩,保证视频的清晰度。默认值为0
keepsource
:
0
,
// 是否源文件播放(不对视频进行编码):0为编码,1为不编码
...
...
@@ -218,32 +214,32 @@ export default {
const
_that
=
this
// console.log(_stat)
_that
.
cancelToken
=
{}
// console.log(res)
uploadBaijiayun
(
_file
.
file
,
_file
.
config
.
uploadUrl
,
(
p
)
=>
{
// console.log(p)
_file
.
progress
=
parseInt
(
p
)
_file
.
status
=
'
uploading
'
if
(
cb
)
cb
(
parseInt
(
p
))
},
_that
.
cancelToken
).
then
(
result
=>
{
_that
.
uploading
=
false
if
(
result
.
msg
===
'
success
'
)
{
_file
.
status
=
'
success
'
_file
.
file
=
null
;
_that
.
savaVideo
(
Object
.
assign
({
vid
:
result
.
fid
,
materialName
:
_file
.
name
},
_file
),
_file
)
}
else
{
this
.
$message
.
error
(
'
上传失败
'
)
_file
.
status
=
'
fail
'
if
(
_that
.
nextUpload
)
_that
.
nextUpload
()
}
}).
catch
((
msgs
)
=>
{
_that
.
uploading
=
false
// console.log(res)
uploadBaijiayun
(
_file
.
file
,
_file
.
config
.
uploadUrl
,
(
p
)
=>
{
// console.log(p)
_file
.
progress
=
parseInt
(
p
)
_file
.
status
=
'
uploading
'
if
(
cb
)
cb
(
parseInt
(
p
))
},
_that
.
cancelToken
).
then
(
result
=>
{
_that
.
uploading
=
false
if
(
result
.
msg
===
'
success
'
)
{
_file
.
status
=
'
success
'
_file
.
file
=
null
;
_that
.
savaVideo
(
Object
.
assign
({
vid
:
result
.
fid
,
materialName
:
_file
.
name
},
_file
),
_file
)
}
else
{
this
.
$message
.
error
(
'
上传失败
'
)
_file
.
status
=
'
fail
'
if
(
_that
.
nextUpload
)
_that
.
nextUpload
()
console
.
log
(
'
error
'
,
msgs
)
})
}
}).
catch
((
msgs
)
=>
{
_that
.
uploading
=
false
_file
.
status
=
'
fail
'
if
(
_that
.
nextUpload
)
_that
.
nextUpload
()
console
.
log
(
'
error
'
,
msgs
)
})
}
}
}
src/utils/vod.js
浏览文件 @
5a32d814
...
...
@@ -61,10 +61,10 @@ export function getPolyvVideoSign() {
vodConfig
().
then
(
res
=>
{
//console.log(res)
polyvClient
.
updateUserData
({
userid
:
res
.
polyv
Config
.
userid
,
ptime
:
res
.
polyv
Config
.
ptime
,
sign
:
res
.
polyv
Config
.
sign
,
hash
:
res
.
polyv
Config
.
hash
userid
:
res
.
vodUpload
Config
.
userid
,
ptime
:
res
.
vodUpload
Config
.
ptime
,
sign
:
res
.
vodUpload
Config
.
sign
,
hash
:
res
.
vodUpload
Config
.
hash
});
// 更新用户数据(由于sign等用户信息有效期为3分钟,需要每隔3分钟更新一次)
setTimeout
(()
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录