Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online
Commits
b72d5486
提交
b72d5486
authored
12月 09, 2019
作者:
何喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
特定人员,首次不让改变进度
上级
43f2f66c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
29 行增加
和
11 行删除
+29
-11
ChapterApi.js
learnOnline/apiService/ChapterApi.js
+2
-1
contentVideo.wxml
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
+2
-1
controlBar.wxml
learnOnline/pages/videoPlayer/controlBar/controlBar.wxml
+1
-1
show.js
learnOnline/pages/videoPlayer/show.js
+19
-6
project.config.json
learnOnline/project.config.json
+5
-2
没有找到文件。
learnOnline/apiService/ChapterApi.js
浏览文件 @
b72d5486
...
@@ -113,7 +113,8 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
...
@@ -113,7 +113,8 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
current
:
0
,
current
:
0
,
selectIndex
:
0
,
selectIndex
:
0
,
timeArr
:
res
.
data
.
ppts
&&
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_point
})
timeArr
:
res
.
data
.
ppts
&&
res
.
data
.
ppts
.
map
(
function
(
_
,
i
)
{
return
_
.
ppt_point
})
}
},
'is_locked'
:
res
.
data
.
is_locked
}
}
callback
(
json
)
callback
(
json
)
}
}
...
...
learnOnline/pages/videoPlayer/contentVideo/contentVideo.wxml
浏览文件 @
b72d5486
...
@@ -3,6 +3,6 @@
...
@@ -3,6 +3,6 @@
<view class='content-video'
<view class='content-video'
style='{{status.isSet && status.isVideo ? "display: none;" : "" }} {{status.isImages && status.isVideo ? "display: none;" : "" }} {{status.isAudio ? "display: none;" : "" }} {{chapterList.isShow && status.isVideo ? "display: none;" : "" }} {{ status.isLoading ? "display: none": "" }}'
style='{{status.isSet && status.isVideo ? "display: none;" : "" }} {{status.isImages && status.isVideo ? "display: none;" : "" }} {{status.isAudio ? "display: none;" : "" }} {{chapterList.isShow && status.isVideo ? "display: none;" : "" }} {{ status.isLoading ? "display: none": "" }}'
>
>
<video id='my-video' class='my-video' src='{{video.src}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindfullscreenchange='beginAndOutFullScreen' bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{true}}'></video>
<video id='my-video' class='my-video' src='{{video.src}}' show-center-play-btn='{{false}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindfullscreenchange='beginAndOutFullScreen'
enable-progress-gesture='{{!status.disable}}'
bindpause='beginPauseVA' bindplay='beginPlayVA' binderror='playError' bindended='playEnded' autoplay='{{true}}'></video>
</view>
</view>
</template>
</template>
\ No newline at end of file
learnOnline/pages/videoPlayer/controlBar/controlBar.wxml
浏览文件 @
b72d5486
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' data-type='{{chapterList.nextVideo.videoType}}' bindtap='nextChapter'></image>
<image class='img' src='./controlBar/icons/btn-front.png' mode='scaleToFill' data-id='{{chapterList.nextVideo.id}}' data-hasVA='{{chapterList.nextVideo.time}}' data-name='{{chapterList.nextVideo.name}}' data-type='{{chapterList.nextVideo.videoType}}' bindtap='nextChapter'></image>
</view>
</view>
</view>
</view>
<view class='right-btn' bindtap='openSetContent'>
<view class='right-btn'
style="display:{{status.disable ? 'none': 'block'}}"
bindtap='openSetContent'>
<image class='img' src='./controlBar/icons/see-set.png' mode='scaleToFill'></image>
<image class='img' src='./controlBar/icons/see-set.png' mode='scaleToFill'></image>
<view class='text'>设置</view>
<view class='text'>设置</view>
</view>
</view>
...
...
learnOnline/pages/videoPlayer/show.js
浏览文件 @
b72d5486
...
@@ -27,6 +27,7 @@ Page({
...
@@ -27,6 +27,7 @@ Page({
isImages
:
false
,
// 是否播放图片
isImages
:
false
,
// 是否播放图片
isVideo
:
false
,
// 是否播放视频,独立存在,永远存在,只用isVideo属性控制
isVideo
:
false
,
// 是否播放视频,独立存在,永远存在,只用isVideo属性控制
imagesLoaded
:
false
,
// 图片是否加载完
imagesLoaded
:
false
,
// 图片是否加载完
disable
:
true
,
// 是否禁止点击进度条
},
},
/* 视频地址 */
/* 视频地址 */
video
:
{
video
:
{
...
@@ -59,7 +60,8 @@ Page({
...
@@ -59,7 +60,8 @@ Page({
progress
:
'0%'
,
// 播放百分比率
progress
:
'0%'
,
// 播放百分比率
curRate
:
'1.0X'
,
// 当前播放倍率
curRate
:
'1.0X'
,
// 当前播放倍率
jumpFlag
:
false
,
// 是否跳过片头
jumpFlag
:
false
,
// 是否跳过片头
vid
:
0
// 当前视频对应的 vid
vid
:
0
,
// 当前视频对应的 vid
cumulativeDuration
:
''
,
// 累计播放时长
},
},
/* 课程章节列表 */
/* 课程章节列表 */
chapterList
:
{
chapterList
:
{
...
@@ -110,9 +112,7 @@ Page({
...
@@ -110,9 +112,7 @@ Page({
initPage
:
function
(
res
,
vid
)
{
initPage
:
function
(
res
,
vid
)
{
/* 默认先 显示视频 */
/* 默认先 显示视频 */
this
.
setData
({
'status.isVideo'
:
true
})
this
.
setData
({
'status.isVideo'
:
true
})
this
.
_cache
=
{
isPlay
:
false
,
initial_time
:
0
,
currentTime
:
'00:00'
,
totalTime
:
'00:00'
,
progress
:
'0%'
,
curRate
:
'1.0X'
,
jumpFlag
:
false
,
vid
:
vid
}
this
.
_cache
=
{
isPlay
:
false
,
initial_time
:
0
,
currentTime
:
'00:00'
,
totalTime
:
'00:00'
,
progress
:
'0%'
,
curRate
:
'1.0X'
,
jumpFlag
:
false
,
vid
:
vid
,
cumulativeDuration
:
''
}
/* 加载中时,重置控制内容 全部为 0 */
this
.
setData
({
'ctrlBar'
:
this
.
_cache
})
/* 一定会 存在值 */
/* 一定会 存在值 */
if
(
res
)
{
if
(
res
)
{
let
tempVid
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
vid
let
tempVid
=
wx
.
getStorageSync
(
'videoCacheCtrlBar'
).
vid
...
@@ -121,8 +121,12 @@ Page({
...
@@ -121,8 +121,12 @@ Page({
res
.
cpt
=
Math
.
max
(
this
.
_cache
.
initial_time
||
''
,
res
.
cpt
)
res
.
cpt
=
Math
.
max
(
this
.
_cache
.
initial_time
||
''
,
res
.
cpt
)
}
}
this
.
_cache
.
initial_time
=
res
.
cpt
this
.
_cache
.
initial_time
=
res
.
cpt
this
.
_cache
.
cumulativeDuration
=
res
.
mpt
this
.
realTimeProgress
=
res
this
.
realTimeProgress
=
res
}
}
/* 加载中时,重置控制内容 全部为 0 */
this
.
setData
({
'ctrlBar'
:
this
.
_cache
})
wx
.
setStorageSync
(
'videoCacheCtrlBar'
,
this
.
_cache
);
wx
.
setStorageSync
(
'videoCacheCtrlBar'
,
this
.
_cache
);
wx
.
setStorageSync
(
'audioCacheCtrlBar'
,
this
.
_cache
);
wx
.
setStorageSync
(
'audioCacheCtrlBar'
,
this
.
_cache
);
/* 将旧的对象全部抛弃掉 */
/* 将旧的对象全部抛弃掉 */
...
@@ -149,6 +153,9 @@ Page({
...
@@ -149,6 +153,9 @@ Page({
})
})
// CC视频走这个接口
// CC视频走这个接口
ChapterApi
.
getCurrentChapterDetail
(
vid
,
videoType
,
(
json
)
=>
{
ChapterApi
.
getCurrentChapterDetail
(
vid
,
videoType
,
(
json
)
=>
{
if
(
!
json
.
is_locked
&&
this
.
data
.
status
.
disable
){
this
.
setData
({
'status.disable'
:
false
})
}
// 播放的视频数据
// 播放的视频数据
this
.
setData
({
'video'
:
json
.
video
})
this
.
setData
({
'video'
:
json
.
video
})
this
.
setData
({
'audio'
:
json
.
audio
})
this
.
setData
({
'audio'
:
json
.
audio
})
...
@@ -304,7 +311,7 @@ Page({
...
@@ -304,7 +311,7 @@ Page({
this
.
setData
({
'ctrlBar.isPlay'
:
true
})
this
.
setData
({
'ctrlBar.isPlay'
:
true
})
_status
.
isVideo
&&
this
.
_video
.
play
();
_status
.
isVideo
&&
this
.
_video
.
play
();
_status
.
isAudio
&&
this
.
_audio
.
play
();
_status
.
isAudio
&&
this
.
_audio
.
play
();
this
.
setHeartbeat
()
this
.
setHeartbeat
()
},
},
/* controlBar页面 - 暂停音视频 - bindTap事件和内部调用 */
/* controlBar页面 - 暂停音视频 - bindTap事件和内部调用 */
pauseVA
:
function
()
{
pauseVA
:
function
()
{
...
@@ -315,7 +322,10 @@ Page({
...
@@ -315,7 +322,10 @@ Page({
clearInterval
(
this
.
heartbeat
)
clearInterval
(
this
.
heartbeat
)
},
},
/* controlBar页面 - 点击进度条跳到某个位置播放 - bindtouchstart事件 */
/* controlBar页面 - 点击进度条跳到某个位置播放 - bindtouchstart事件 */
tapToSeek
:
function
(
e
)
{
let
pLine
=
wx
.
getSystemInfoSync
().
windowWidth
-
e
.
currentTarget
.
offsetLeft
*
2
,
pos
=
e
.
touches
[
0
].
pageX
,
_data
=
this
.
data
,
_status
=
_data
.
status
,
_obj
=
_status
.
isVideo
?
this
.
_video
:
this
.
_audio
;
this
.
seekVA
(
parseInt
(
pos
/
pLine
*
_obj
.
totalTime
));
},
tapToSeek
:
function
(
e
)
{
// 第一次不让滑动视频
if
(
this
.
data
.
status
.
disable
)
return
;
let
pLine
=
wx
.
getSystemInfoSync
().
windowWidth
-
e
.
currentTarget
.
offsetLeft
*
2
,
pos
=
e
.
touches
[
0
].
pageX
,
_data
=
this
.
data
,
_status
=
_data
.
status
,
_obj
=
_status
.
isVideo
?
this
.
_video
:
this
.
_audio
;
this
.
seekVA
(
parseInt
(
pos
/
pLine
*
_obj
.
totalTime
));
},
/* VideoOrAudio - 跳到某个点开始播放 */
/* VideoOrAudio - 跳到某个点开始播放 */
seekVA
:
function
(
time
)
{
let
_data
=
this
.
data
,
_status
=
_data
.
status
;
_status
.
isVideo
&&
this
.
_video
.
seek
(
time
);
_status
.
isAudio
&&
this
.
_audio
.
seek
(
time
);
},
seekVA
:
function
(
time
)
{
let
_data
=
this
.
data
,
_status
=
_data
.
status
;
_status
.
isVideo
&&
this
.
_video
.
seek
(
time
);
_status
.
isAudio
&&
this
.
_audio
.
seek
(
time
);
},
/* setContent页面 - 跳过片头 - bindTap事件 */
/* setContent页面 - 跳过片头 - bindTap事件 */
...
@@ -360,6 +370,9 @@ Page({
...
@@ -360,6 +370,9 @@ Page({
let
_data
=
this
.
data
,
_status
=
_data
.
status
,
_detail
=
e
.
detail
,
_obj
=
_status
.
isVideo
?
this
.
_video
:
this
.
_audio
let
_data
=
this
.
data
,
_status
=
_data
.
status
,
_detail
=
e
.
detail
,
_obj
=
_status
.
isVideo
?
this
.
_video
:
this
.
_audio
_obj
.
currentTime
=
parseInt
(
_detail
.
currentTime
)
_obj
.
currentTime
=
parseInt
(
_detail
.
currentTime
)
_obj
.
totalTime
=
parseInt
(
_detail
.
duration
)
_obj
.
totalTime
=
parseInt
(
_detail
.
duration
)
if
(
_status
.
disable
&&
(
_data
.
ctrlBar
.
cumulativeDuration
>
_obj
.
totalTime
-
4
)
){
this
.
setData
({
'ctrlBar.cumulativeDuration'
:
false
})
}
this
.
setData
({
'ctrlBar.progress'
:
_obj
.
currentTime
/
_obj
.
totalTime
*
100
+
'%'
});
this
.
setData
({
'ctrlBar.progress'
:
_obj
.
currentTime
/
_obj
.
totalTime
*
100
+
'%'
});
this
.
setData
({
'ctrlBar.currentTime'
:
util
.
durationToTimeString
(
_obj
.
currentTime
)
});
this
.
setData
({
'ctrlBar.currentTime'
:
util
.
durationToTimeString
(
_obj
.
currentTime
)
});
this
.
setData
({
'ctrlBar.totalTime'
:
util
.
durationToTimeString
(
_obj
.
totalTime
)
})
this
.
setData
({
'ctrlBar.totalTime'
:
util
.
durationToTimeString
(
_obj
.
totalTime
)
})
...
...
learnOnline/project.config.json
浏览文件 @
b72d5486
...
@@ -6,6 +6,10 @@
...
@@ -6,6 +6,10 @@
"postcss"
:
true
,
"postcss"
:
true
,
"minified"
:
true
,
"minified"
:
true
,
"newFeature"
:
true
,
"newFeature"
:
true
,
"coverView"
:
true
,
"nodeModules"
:
false
,
"autoAudits"
:
false
,
"uglifyFileName"
:
true
,
"checkInvalidKey"
:
true
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"uploadWithSourceMap"
:
true
,
...
@@ -13,8 +17,7 @@
...
@@ -13,8 +17,7 @@
"ignore"
:
[],
"ignore"
:
[],
"disablePlugins"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
"outputPath"
:
""
},
}
"nodeModules"
:
false
},
},
"compileType"
:
"miniprogram"
,
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.3.0"
,
"libVersion"
:
"2.3.0"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论