Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
a142dcfd
提交
a142dcfd
authored
4月 15, 2020
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加F键新窗口打开直播页面
上级
a5b61453
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
66 行增加
和
1 行删除
+66
-1
PlayerAction.js
client/src/action/PlayerAction.js
+2
-0
player_api.js
client/src/api/player_api.js
+4
-0
courseDetail.vue
client/src/pages/learn/courseDetail.vue
+60
-1
没有找到文件。
client/src/action/PlayerAction.js
浏览文件 @
a142dcfd
...
...
@@ -282,4 +282,6 @@ export default class PlayerAction extends BaseACTION {
getNewLiveMsg
()
{
return
Player
.
getNewLiveMsg
().
then
(
res
=>
res
)
}
/* 获取手机直播列表 */
getLiveList
()
{
return
Player
.
getLiveList
().
then
(
res
=>
res
)
}
/* 获取云课堂 url */
getCloudUrl
()
{
return
Player
.
getCloudUrl
().
then
(
res
=>
res
)
}
}
client/src/api/player_api.js
浏览文件 @
a142dcfd
...
...
@@ -97,4 +97,8 @@ export default class PlayerAPI extends BaseAPI {
* 手机端 获取列表接口
*/
getLiveList
=
(
obj
=
{})
=>
this
.
get
(
'/v2/education/lives/courses'
,
obj
)
/**
* 跨域接口请求 - 直接获取云课堂设置
*/
getCloudUrl
=
(
obj
=
{})
=>
this
.
get
(
'https://node-server.ezijing.com/get/cloud-class'
,
obj
)
}
client/src/pages/learn/courseDetail.vue
浏览文件 @
a142dcfd
...
...
@@ -339,10 +339,18 @@ export default {
{
required
:
true
,
message
:
'请输入标题'
,
trigger
:
'blur'
}
]
},
isOpenNewTabFlag
:
false
,
arrFn
:
[],
cloudClassUrls
:
{},
timeHeart
:
null
}
},
mounted
()
{
/* 获取云课堂所有地址 */
cAction
.
Player
.
getCloudUrl
().
then
(
json
=>
{
this
.
cloudClassUrls
=
json
})
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
''
,
spinner
:
''
,
background
:
'rgba(255, 255, 255, 0.9)'
})
if
(
this
.
cid
===
'0'
&&
this
.
sid
===
'0'
)
{
this
.
$message
({
...
...
@@ -389,6 +397,7 @@ export default {
// this.timeHeart = setInterval(() => {
// this.updatePages()
// }, 3000)
this
.
arrFn
=
this
.
initBindKeyfn
()
},
destroyed
()
{
window
.
removeEventListener
(
'resize'
,
this
.
resizeRoot
.
bind
(
this
),
false
)
...
...
@@ -396,6 +405,7 @@ export default {
this
.
ckeditor
&&
this
.
ckeditor
.
destroy
(
true
)
this
.
ckeditor
=
null
if
(
this
.
timeHeart
)
{
clearInterval
(
this
.
timeHeart
);
this
.
timeHeart
=
null
}
if
(
this
.
arrFn
.
length
)
{
this
.
destroyKeyfn
(
this
.
arrFn
)
}
},
updated
()
{
this
.
resizeRoot
()
...
...
@@ -489,6 +499,42 @@ export default {
}
}
},
/* 直接跳转打开新页面 */
openNewTab
(
sid
,
cid
,
_id
)
{
cAction
.
Player
.
getChapterList
(
cid
,
sid
,
_id
).
then
(
json
=>
{
this
.
live
=
(
json
.
curJson
&&
json
.
curJson
.
live
)
||
{}
if
(
this
.
live
.
id
)
{
if
(
this
.
live
.
record_id
&&
this
.
live
.
live_status
===
103
)
{
this
.
live
.
url
=
'https://view.csslcloud.net/api/view/callback?recordid='
+
this
.
live
.
record_id
+
'&roomid='
+
this
.
live
.
room_id
+
'&userid='
+
this
.
live
.
user_id
+
'&autoLogin=true&viewername='
+
(
this
.
live
.
viewer_name
||
'匿名'
)
+
'&viewertoken='
+
this
.
live
.
viewer_token
// + '&groupid=xxx'
}
else
{
this
.
live
.
viewer_name
=
window
.
G
.
UserInfo
.
student_info
.
personal_name
||
window
.
G
.
UserInfo
.
nickname
this
.
live
.
url
=
'https://view.csslcloud.net/api/view/index?roomid='
+
this
.
live
.
room_id
+
'&userid='
+
this
.
live
.
user_id
+
'&autoLogin=true&viewername='
+
(
this
.
live
.
viewer_name
||
'匿名'
)
+
'&viewertoken='
+
this
.
live
.
viewer_token
// + '&groupid=xxx'
}
// this.CCLiveInit(this.live)
this
.
isOpenNewTabFlag
=
false
window
.
open
(
this
.
live
.
url
)
}
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
},
initBindKeyfn
()
{
const
_fn1
=
(
e
)
=>
{
if
(
e
.
keyCode
===
70
)
{
this
.
isOpenNewTabFlag
=
true
}
}
const
_fn2
=
(
e
)
=>
{
if
(
e
.
keyCode
===
70
)
{
this
.
isOpenNewTabFlag
=
false
}
}
document
.
addEventListener
(
'keydown'
,
_fn1
,
false
)
document
.
addEventListener
(
'keyup'
,
_fn2
,
false
)
return
[
_fn1
,
_fn2
]
},
destroyKeyfn
(
arr
)
{
document
.
removeEventListener
(
'keydown'
,
arr
[
0
])
document
.
removeEventListener
(
'keyup'
,
arr
[
1
])
},
/**
* 跳转到对应音视频播放页
*/
...
...
@@ -535,7 +581,20 @@ export default {
this
.
$message
.
info
(
'该直播没有回放'
)
return
}
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
/* 判别如果为 云课堂记录 id 则直接进入 云课堂 */
if
(
this
.
cloudClassUrls
[
_id
])
{
const
viewerName
=
window
.
G
.
UserInfo
.
student_info
.
personal_name
||
window
.
G
.
UserInfo
.
nickname
const
url
=
this
.
cloudClassUrls
[
_id
]
+
'&viewername='
+
viewerName
+
'&autoLogin=true'
window
.
open
(
url
)
return
}
if
(
this
.
isOpenNewTabFlag
)
{
this
.
openNewTab
(
sid
,
cid
,
_id
)
}
else
{
this
.
$router
.
push
({
path
:
`/player/
${
sid
}
/
${
cid
}
/live/
${
_id
}
`
})
}
}
return
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论