提交 139a1d63 authored 作者: 王鹏飞's avatar 王鹏飞

remore: 移除无用文件

上级 a479a04d
......@@ -5,7 +5,6 @@
"pages/login/phone",
"pages/login/password",
"pages/outSite/outSite",
"pages/videoPlayer/show",
"pages/learnSystem/home/home",
"pages/learnSystem/courseSquare/courseSquare",
"pages/learnSystem/courseContent/courseContent",
......
// pages/videoPlayer/AllBugPages/page1/bugPage1.js
const util = require('../../../../utils/util.js')
Page({
data: {
isVideoShow: false,
currentTime: 0,
totalTime: 0,
video: {
src: ''
}
},
_audio: null,
_video: null,
playVideo: false,
playAudio: false,
onHide: function () { this.videoPause() },
onReady: function () {
this.setData({ 'isVideoShow': true })
this.setData({ 'video.src': 'https://cd15-c120-1.play.bokecc.com/flvs/C67C24BF493FE39E/2016-03-29/CD319C8C0265B11A9C33DC5901307461-20.m3u8?t=1536297247&key=2467F8448E028A1614E354B75A457951' })
setTimeout(() => {
this._video = wx.createVideoContext('video-play')
}, 1000)
this._audio = wx.createAudioContext('audio-play')
},
audioPlay: function () { this._audio.play(); this.playAudio = true; this.playVideo = false; },
videoPlay: function () { this._video.play(); this.playAudio = false; this.playVideo = true; },
audioPause: function () { this._audio.pause(); this.playAudio = false; },
videoPause: function () { this._video.pause(); this.playVideo = false; },
videoShowOrHide: function () { this.setData({ 'isVideoShow': !this.data.isVideoShow }) },
changeVideo: function () { this.setData({ 'video.src': 'https://pd4t7ae3m.bkt.clouddn.com/test.mp4' }); },
timeUpdate: function (e) {
let _data = this.data, _status = _data.status, _detail = e.detail, _obj = {}
console.log('视频时间变化', parseInt(_detail.currentTime))
_obj.currentTime = parseInt(_detail.currentTime)
_obj.totalTime = parseInt(_detail.duration)
this.setData({ 'ctrlBar.progress': _obj.currentTime / _obj.totalTime * 100 + '%' });
this.setData({ 'currentTime': util.durationToTimeString(_obj.currentTime) });
this.setData({ 'totalTime': util.durationToTimeString(_obj.totalTime) })
},
/**
* 第一种情况:
* 在播放音视频时,打开预览大图,会暂停播放音视频。
*/
viewImage1: function () {
let _ = this
wx.previewImage({
urls: [
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
],
current: 0,
success: () => {
_.playAudio && _._audio.play()
_.playVideo && _._video.play()
}
})
_.playAudio && _._audio.play()
_.playVideo && _._video.play()
},
/**
* 第二种情况:
* 音视频播放过程中,在打开预览图片前,手动调用方法暂停播放,但是关闭预览图片后,发现问题。
* android 视频播放未暂停,ios 正常
*/
viewImage2: function () {
let _ = this
this.audioPause()
this.videoPause()
wx.previewImage({
urls: [
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
],
current: 0,
success: () => {}
})
}
})
\ No newline at end of file
<!--pages/videoPlayer/AllBugPages/page1/bugPage1.wxml-->
<button bindtap='viewImage1'>点击预览图片-方法1</button>
<button bindtap='viewImage2'>点击预览图片-方法2</button>
<button bindtap='changeVideo'>视频切换</button>
<button bindtap='audioPlay'>音频播放</button>
<button bindtap='audioPause'>音频暂停</button>
<button bindtap='videoPlay'>视频播放</button>
<button bindtap='videoPause'>视频暂停</button>
<button bindtap='videoShowOrHide'>视频显示/隐藏</button>
<view class='start-time'>播放时间:{{currentTime}}</view>
<view class='end-time'>总时间:{{totalTime}}</view>
<audio id='audio-play' src='https://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3'></audio>
<view style='{{isVideoShow ? "": "display:none"}}'>
<video id='video-play' style="width: 750rpx;" src='{{video.src}}' bindtimeupdate='timeUpdate' show-center-play-btn='{{false}}' controls='{{false}}'></video>
</view>
\ No newline at end of file
/* pages/videoPlayer/AllBugPages/page1/bugPage1.wxss */
.start-time { float: left; margin-left: 20rpx; }
.end-time { float: right; margin-right: 20rpx; }
\ No newline at end of file
// pages/videoPlayer/AllBugPages/test.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
<!--pages/videoPlayer/AllBugPages/test.wxml-->
<text>pages/videoPlayer/AllBugPages/test.wxml</text>
/* pages/videoPlayer/AllBugPages/test.wxss */
\ No newline at end of file
/**
* 创建一个audio对象
* @param {[string]} src [audio组件对应音频源]
* @param {[object]} _that [当前组件所在页面对应this]
*/
var Audio = function (src, _that) {
if (!(this instanceof Audio)) {
return new Audio(src, _that)
} else {
this._audio = this.init(src, _that)
this.currentTime = 0 // 当前时间
this.totalTime = 0 // 总时间
this.rateIndex = 2 // 取值为 RATE中的 下标 0,1,2,3,4
}
}
/**
* audio对象创建后,提供的方法
* init - 初始化方法
* play - 视频播放
* pause - 视频暂停
* stop - 视频停止
* seek - 视频跳到某个位置再播放
* rate - 视频播放速率调整
*
*/
Audio.prototype = {
constructor: Audio,
RATE: ['0.5', '0.8', '1.0', '1.25', '1.5'],
init: function (src, _that) {
let _auCtx = wx.createInnerAudioContext()
_auCtx.autoplay = false
_auCtx.src = src
/* 使用绑定事件,代替wxml中的事件绑定 */
_auCtx.onTimeUpdate(() => {
let e = {
detail: { currentTime: _auCtx.currentTime, duration: _auCtx.duration }
}
_that.timeUpdate(e)
})
_auCtx.onPlay(() => {
_that.beginPlayVA()
})
_auCtx.onError((e) => {
_that.playError(e)
})
_auCtx.onEnded(() => {
_that.playEnded
})
return _auCtx
},
play: function () {
this._audio.play()
},
pause: function () {
this._audio.pause()
},
stop: function () {
this._audio.stop()
},
seek: function (time) {
this._audio.seek(time)
},
fastSlow15: function (timeStr) {
this._audio.seek(this.currentTime + parseInt(timeStr))
},
rate: function () {
this.rateIndex++
if (this.rateIndex > 4) this.rateIndex = 0
this._audio.playbackRate(parseFloat(this.RATE[this.rateIndex]))
}
}
module.exports = {
Audio: Audio
}
<template name='contentAudio'>
<view class='content-audio'
style='{{status.isSet && status.isAudio ? "display: none;" : "" }} {{status.isImages && status.isAudio ? "display: none;" : "" }} {{status.isVideo ? "display: none;" : "" }}'
>
<image src='./contentAudio/icons/loading_small.gif' class='loading-image {{status.imagesLoaded && "none"}}' mode='aspectFit'/>
<image wx:if='{{image.imgUrls[image.current]}}' src='{{image.imgUrls[image.current]}}' class='slide-image' mode='aspectFill' bindload='imagesLoaded'/>
<view wx:if='{{!image.imgUrls[image.current]}}' class='slide-image'>本课程暂无PPT</view>
<!-- <audio id="my-audio" class='my-audio' src='{{audio.src}}' controls='{{false}}' bindtimeupdate='timeUpdate' bindplay='beginPlayVA' binderror='playError' bindended='playEnded'></audio> -->
</view>
</template>
\ No newline at end of file
.content-audio { position: absolute; z-index: 0; top: 0; left: 0; right: 0; bottom: 300rpx; background: #313131; }
.content-audio .slide-image { position: absolute; top: 50%; left: 50%; display: block; width: 750rpx; height: 422rpx; color: #7d7d7d; font-size: 30rpx; text-align: center; line-height: 450rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
/* 图片过大时,都要先加载再显示 */
.content-audio .loading-image { position: absolute; z-index: 1; top: 50%; left: 50%; display: block; width: 750rpx; height: 50rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background: transparent; }
.content-audio .loading-image.none { display: none; }
\ No newline at end of file
<template name='contentImages'>
<view class='content-images'>
<block wx:if='{{image.imgUrls.length}}'>
<swiper class='swiper-images' bindchange='imageSelectIndexUpdate' current='{{image.current}}'>
<block wx:for='{{image.imgUrls}}' wx:key='{{index}}'>
<swiper-item>
<image src='{{item}}' class='slide-image' mode='aspectFit' bindtap='showBigImage'/>
</swiper-item>
</block>
</swiper>
</block>
<block wx:else>
<view class='swiper-images'><view class='slide-image'>本课程暂无PPT</view></view>
</block>
</view>
</template>
.content-images { position: absolute; z-index: 1; top: 0; left: 0; right: 0; bottom: 300rpx; background: #313131; }
.content-images .swiper-images { position: absolute; top: 50%; width: 750rpx; height: 422rpx; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
.content-images .swiper-images .slide-image { display: block; width: 750rpx; height: 422rpx; color: #7d7d7d; font-size: 30rpx; text-align: center; line-height: 450rpx; background: #313131; }
/* 图片过大时,都要先加载再显示 */
.content-images .swiper-images .loading-image { position: absolute; z-index: 1; top: 50%; left: 50%; display: block; width: 750rpx; height: 50rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background: transparent; }
.content-images .swiper-images .loading-image.none { display: none; }
\ No newline at end of file
<template name='contentVideo'>
<!-- 这里加 这么多判断原因,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": "" }}'
>
<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>
</view>
</template>
\ No newline at end of file
.content-video { position: absolute; top: 0; left: 0; right: 0; bottom: 300rpx; background: #313131; }
.content-video .my-video { position: absolute; top: 50%; width: 750rpx; height: 422rpx; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
\ No newline at end of file
/**
* 创建一个video对象
* @param {[string]} selectorId [video组件id对应选择器字符串]
*/
var Video = function (selectorId) {
if (!(this instanceof Video)) {
return new Video(selectorId);
} else {
this._video = this.init(selectorId);
this.currentTime = 0; // 当前时间
this.totalTime = 0; // 总时间
this.rateIndex = 2; // 取值为 RATE中的 下标 0,1,2,3,4
}
}
/**
* video对象创建后,提供的方法
* init - 初始化方法
* play - 视频播放
* pause - 视频暂停
* stop - 视频停止
* seek - 视频跳到某个位置再播放
* rate - 视频播放速率调整
*
*/
Video.prototype = {
constructor: Video,
RATE: ['0.5', '0.8', '1.0', '1.25', '1.5'],
init: function (selectorId) {
return wx.createVideoContext(selectorId);
},
play: function () {
this._video.play();
},
pause: function () {
this._video.pause();
},
stop: function () {
this._video.stop();
},
seek: function (time) {
this._video.seek(time);
},
fastSlow15: function (timeStr) {
this._video.seek(this.currentTime + parseInt(timeStr));
},
rate: function () {
this.rateIndex ++;
if (this.rateIndex > 4) this.rateIndex = 0;
this._video.playbackRate(parseFloat(this.RATE[this.rateIndex]));
}
}
module.exports = {
Video: Video
}
<template name='controlBar'>
<view class='control-bar'>
<view class='ctrl {{status.isImages && "ppt"}} {{status.isAudio && "audio"}} {{status.isVideo && "normal"}}'>
<image class='img see-audio' src='./controlBar/icons/see-audio.png' mode='scaleToFill' bindtap='showContentAudio'></image>
<image class='img see-video' src='./controlBar/icons/see-video.png' mode='scaleToFill' bindtap='showContentVideo'></image>
<image class='img see-ppt' src='./controlBar/icons/see-ppt.png' mode='scaleToFill' bindtap='openContentImages'></image>
<image class='img see-notppt' src='./controlBar/icons/see-notppt.png' mode='scaleToFill' bindtap='closeContentImages'></image>
<!-- <image class='img see-set' src='./controlBar/icons/see-set.png' mode='scaleToFill'></image> -->
</view>
<view class='control-progress' bindtouchstart='tapToSeek'>
<view class='progress-line'>
<view class='cache-line' style='width: 100%;'></view>
<view class='current-line' style='width: {{ctrlBar.progress}};'></view>
</view>
<view class='progress-time'>
<view class='current-time'>{{ctrlBar.currentTime}}</view>
<view class='total-time'>{{ctrlBar.totalTime}}</view>
</view>
</view>
<view class='control-btns'>
<view class='left-btn' bindtap='openSelectChapterList'>
<image class='img normal' src='./controlBar/icons/left-btn-normal.png' mode='scaleToFill'></image>
<image class='img active' src='./controlBar/icons/left-btn-active.png' mode='scaleToFill'></image>
<view class='text'>章节</view>
</view>
<view class='main-btns'>
<view class='btn-back'>
<image class='img' src='./controlBar/icons/btn-back.png' mode='scaleToFill' data-id='{{chapterList.prevVideo.id}}' data-hasVA='{{chapterList.prevVideo.time}}' data-name='{{chapterList.prevVideo.name}}' bindtap='prevChapter' data-type='{{chapterList.nextVideo.videoType}}' ></image>
</view>
<view class='opt'>
<image class='img init-page {{initVAFlag ? "" : "none"}}' src='./controlBar/icons/loading_small.gif' mode='aspectFit'></image>
<image class='img play {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "" : "none"}}' src='./controlBar/icons/btn-play.png' mode='scaleToFill' bindtap='playVA'></image>
<image class='img pause {{initVAFlag ? "none" : ""}} {{!ctrlBar.isPlay ? "none" : ""}}' src='./controlBar/icons/btn-pause.png' mode='scaleToFill' bindtap='pauseVA'></image>
</view>
<view class='btn-front'>
<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 class='right-btn' bindtap='openSetContent'>
<image class='img' src='./controlBar/icons/see-set.png' mode='scaleToFill'></image>
<view class='text'>设置</view>
</view>
</view>
</view>
</template>
\ No newline at end of file
.control-bar { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 300rpx; background: #3f3f3f; }
/* 内容 控制区 控制看视频、音频还是PPT */
.control-bar .ctrl { position: absolute; top: -90rpx; width: 100%; text-align: center; }
.control-bar .ctrl .img { display: inline-block; vertical-align: middle; margin: 0 18rpx; padding: 20rpx; }
.control-bar .ctrl .img.see-audio { width: 29rpx; height: 42rpx; }
.control-bar .ctrl .img.see-video { width: 46rpx; height: 29rpx; }
.control-bar .ctrl .img.see-ppt { width: 33rpx; height: 41rpx; }
.control-bar .ctrl .img.see-notppt { width: 60rpx; height: 44rpx; }
.control-bar .ctrl.normal .img.see-video, .control-bar .ctrl.normal .img.see-notppt { display: none; }
.control-bar .ctrl.audio .img.see-audio, .control-bar .ctrl.audio .img.see-notppt { display: none; }
.control-bar .ctrl.ppt .img.see-ppt, .control-bar .ctrl.ppt .img.see-audio, .control-bar .ctrl.ppt .img.see-video { display: none; }
.control-bar .ctrl.ppt .img.see-notppt { display: inline-block; }
/* 进度条+时间 */
.control-bar .control-progress { margin: 7rpx 17rpx 0 17rpx; padding-top: 30rpx; overflow: hidden; }
.control-bar .control-progress .progress-line { position: relative; width: 100%; height: 4rpx; background: #898989; }
.cache-line { position: absolute; z-index: 1; left: 0; top: 0; height: 100%; background: #b5b5b5; }
.current-line { position: absolute; z-index: 2; left: 0; top: 0; height: 100%; background: #d3a010; }
.control-bar .control-progress .progress-time { width: 100%; overflow: hidden; }
.control-bar .control-progress .progress-time .current-time { float:left; height: 45rpx; font-size: 22rpx; color: #c9c9c9; line-height: 45rpx; }
.control-bar .control-progress .progress-time .total-time { float:right; height: 45rpx; font-size: 22rpx; color: #c9c9c9; line-height: 45rpx; }
/* 控制按钮 */
.control-btns { position: relative; margin: 25rpx 17rpx 0 17rpx; }
.control-btns .left-btn { float: left; margin: 20rpx 0 0 40rpx; padding: 10rpx 20rpx; }
.control-btns .left-btn .active, .control-btns .left-btn.on .normal { display: none; }
.control-btns .left-btn .normal, .control-btns .left-btn.on .active { display: block; }
.control-btns .left-btn .img { margin: 0 auto; width: 54rpx; height: 47rpx; }
.control-btns .left-btn .text { margin-top: 10rpx; font-size: 22rpx; line-height: 25rpx; color: #fff; text-align: center; }
.control-btns .right-btn { float: right; margin: 20rpx 40rpx 0 0; padding: 10rpx 20rpx; }
.control-btns .right-btn .img { margin: 0 auto; width: 47rpx; height: 47rpx; }
.control-btns .right-btn .text { margin-top: 10rpx; font-size: 22rpx; line-height: 25rpx; color: #fff; }
.control-btns .main-btns { position: absolute; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); }
.control-btns .main-btns .btn-back, .control-btns .main-btns .opt, .control-btns .main-btns .btn-front { display: inline-block; vertical-align: middle; overflow: hidden; }
.control-btns .main-btns .btn-back .img { display: block; width: 33rpx; height: 34rpx; }
.control-btns .main-btns .opt .img { display: block; margin: 0 54rpx; width: 121rpx; height: 120rpx; }
.control-btns .main-btns .opt .img.init-page { display: block; margin: 0 54rpx; width: 121rpx; height: 50rpx; padding: 35rpx 0; }
.control-btns .main-btns .opt .img.none { display: none; }
.control-btns .main-btns .btn-front .img { display: block; width: 32rpx; height: 34rpx; }
<template name='noSupport'>
<view class='no-support'>
<view class='text'>本课程暂不支持手机端播放</view>
</view>
</template>
\ No newline at end of file
.no-support { position: absolute; top: 0; left: 0; right: 0; bottom: 300rpx; background: #535353; }
.no-support .text { position: absolute; top: 50%; left: 50%; color: #7d7d7d; font-size: 30rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); }
\ No newline at end of file
<template name='pageLoading'>
<view class='page-loading'>
<image src='./pageLoading/icons/loading_small.gif' class='loading-image' mode='aspectFit'/>
<view class='text'>内容加载中</view>
</view>
</template>
\ No newline at end of file
.page-loading { position: absolute; z-index: 10; top: 0; left: 0; right: 0; bottom: 0; background: #313131; }
.page-loading .loading-image { position: absolute; z-index: 1; top: 50%; left: 50%; display: block; width: 750rpx; height: 50rpx; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background: transparent; }
.page-loading .text { position: absolute; z-index: 1; top: 55%; left: 50%; display: block; width: 750rpx; text-align: center; font-size: 20rpx; color: #fff; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); background: transparent; }
\ No newline at end of file
<template name='selectChapterList'>
<view class='select-chapter-list' style='{{!chapterList.isShow && "display:none;"}}'>
<view class='bg' bindtap='closeSelectChapterList'></view>
<scroll-view scroll-y class="content">
<block wx:for='{{chapterList.course}}' wx:key='{{index}}' wx:for-index='index'>
<view class='content-group'>
<view class='title'>{{item.title}}</view>
<block wx:for='{{item.chapters}}' wx:key='{{index1}}' wx:for-item="item1" wx:for-index='index1'>
<view class='body {{item1.id === chapterList.currentChapterId && "on"}}'>
<view class='name' data-id='{{item1.id}}' data-hasVA='{{item1.time}}' data-name='{{item1.name}}' bindtap='jumpToOtherVA' data-index='{{index}}' data-index1='{{index1}}' data-type='{{item1.videoType}}'>
{{item1.name}}
<view class='time'>{{item1.time}}</view>
</view>
</view>
</block>
</view>
</block>
</scroll-view>
</view>
</template>
\ No newline at end of file
.select-chapter-list { position: fixed; z-index: 10; top: 0; bottom: 0; left: 0; right: 0; }
.select-chapter-list .bg { position: absolute; z-index: 1; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0, 0, 0, 0.3); }
.select-chapter-list .content { position: absolute; z-index: 2; width: 750rpx; bottom: 0; top: 418rpx; overflow: auto; background-color: #eee; padding: 33rpx 0; }
.select-chapter-list .content .content-group { padding: 0 26rpx; }
.select-chapter-list .content .content-group.no-child { margin-bottom: 20rpx; }
.select-chapter-list .content .content-group .title { position: relative; padding: 20rpx 24rpx; color: #313131; font-size: 30rpx; line-height: 40rpx; background: #e5e5e5; }
.select-chapter-list .content .content-group .body { position: relative; padding: 0 24rpx; font-size: 30rpx; line-height: 42rpx; color: #505050; }
.select-chapter-list .content .content-group .body.on .name { color: #b2183e; }
.select-chapter-list .content .content-group .body .name { padding: 20rpx 70rpx 20rpx 40rpx; border-left: 2rpx solid #c9c9c9; }
.select-chapter-list .content .content-group .body .name:before { width: 30rpx; height: 30rpx; border-radius: 32rpx; border:4rpx solid #c9c9c9;
background: #e5e5e5; position: absolute; left: 6rpx; top: 20rpx; content: ""; display: block; z-index: 10; }
.select-chapter-list .content .content-group .body .name .time { position: absolute; right: 16rpx; top: 20rpx; }
/* .play-chapter-progress{position:absolute;left:7px;top:8px;z-index:60;display:none\0;}
.play-chapter .play-prog{position:absolute;top:8px;left:7px;z-index:10;} */
\ No newline at end of file
<template name='setContent'>
<view class='set-content'>
<view class='content'>
<view class='progress-time'>
<view class='time current-time'>{{ctrlBar.currentTime}}</view><view class='time'>/</view><view class='time total-time'>{{ctrlBar.totalTime}}</view>
</view>
<view class='ctrl-time-pos'>
<view class='skip-head {{ctrlBar.jumpFlag ? "on" : ""}}' bindtouchend='jumpHead'>
<image class='img normal' src='./setContent/icons/jump-normal.png' mode='scaleToFill'></image>
<image class='img active' src='./setContent/icons/jump-active.png' mode='scaleToFill'></image>
<view class='text'>跳过片头</view>
</view>
<image class='img slow-15s' src='./setContent/icons/slow-15s.png' mode='scaleToFill' bindtouchend='slow15s'></image>
<image class='img fast-15s' src='./setContent/icons/fast-15s.png' mode='scaleToFill' bindtouchend='fast15s'></image>
<view class='speed-rate' bindtouchend='setRate'>
<view class='rate'>{{ctrlBar.curRate}}</view>
<view class='text'>倍速播放</view>
</view>
</view>
</view>
<image class='back' src='./setContent/icons/back.png' mode='scaleToFill' bindtouchend='closeSetContent'></image>
</view>
</template>
\ No newline at end of file
.set-content { position: absolute; z-index: 2; top: 0; left: 0; right: 0; bottom: 300rpx; background: #eeeeee; }
.set-content .back { position: absolute; right: 40rpx; bottom: 30rpx; padding: 20rpx; width: 40rpx; height: 40rpx; }
.set-content .content { position: absolute; top: 50%; width: 100%; -webkit-transform: translateY(-50%); transform: translateY(-50%); }
/* 显示时间 */
.set-content .content .progress-time { font-size: 86rpx; line-height: 100rpx; font-weight: 700; color: #313131; text-align: center; }
.set-content .content .progress-time .time { display: inline-block; vertical-align: middle; }
.set-content .content .progress-time .current-time { color: #b2183e; }
/* 其他控制 */
.set-content .content .ctrl-time-pos { margin-top: 100rpx; text-align: center; color: #313131; }
.set-content .content .ctrl-time-pos .skip-head { display: inline-block; vertical-align: middle; margin-right: 20rpx; }
.set-content .content .ctrl-time-pos .skip-head .active, .set-content .content .ctrl-time-pos .skip-head.on .normal { display: none; }
.set-content .content .ctrl-time-pos .skip-head .normal, .set-content .content .ctrl-time-pos .skip-head.on .active { display: block; }
.set-content .content .ctrl-time-pos .skip-head .img { margin: 4rpx auto; width: 32rpx; height: 32rpx; }
.set-content .content .ctrl-time-pos .skip-head .text { margin-top: 15rpx; font-size: 22rpx; line-height: 30rpx; }
.set-content .content .ctrl-time-pos .img { display: inline-block; vertical-align: middle; margin: 0 20rpx; width: 118rpx; height: 111rpx; }
.set-content .content .ctrl-time-pos .speed-rate { display: inline-block; vertical-align: middle; margin-left: 20rpx; }
.set-content .content .ctrl-time-pos .speed-rate .rate { font-size: 32rpx; line-height: 40rpx; }
.set-content .content .ctrl-time-pos .speed-rate .text { margin-top: 10rpx; font-size: 22rpx; line-height: 30rpx; }
\ No newline at end of file
// pages/videoPlayer/show.js
const util = require('../../utils/util.js')
const objV = require('./contentVideo/videoCtrl.js')
const objA = require('./contentAudio/audioCtrl.js')
const ChapterApi = require('../../apiService/ChapterApi.js')
/**
* 目前优化进度:
* 1. 增加 autoplay = true属性,并在加载完成后,再手动出发一次 play。
* 2. 去掉一些 没用的 判断方式,如firstOpen、switchOpen等。合并成一个。
* 测试机型:
* 乐视 Letv X800、honor 7A、华为、小米 note、iphone6、iphone8、iphoneX
* 目前已知的存在问题:
* 1. 关闭,再进入后台时,视频播放不会自动播放,但按钮显示播放状态。
* 2. 打开预览大图,再回来,视频播放不会自动播放,但按钮也显示播放状态。
*/
Page({
data: {
/* 打开页面时,状态 */
status: {
isLoading: true, // 页面加载中
isSupport: true, // 是否支持视频播放
isSet: false, // 是否点击打开设置面板, 与isVideo和isAudio 互斥,只要其中有一个为 true, 这个isSet就为false
isAudio: false, // 是否播放音频
isImages: false, // 是否播放图片
isVideo: false, // 是否播放视频,独立存在,永远存在,只用isVideo属性控制
imagesLoaded: false // 图片是否加载完
},
/* 视频地址 */
video: {
src: '', // 视频播放地址
spareSrc: 'https://pd4t7ae3m.bkt.clouddn.com/test.mp4' // 正常视频播放地址,浏览器不支持时,使用备用地址
},
/* 音频地址 */
audio: {
src: '', // 音频播放地址
spareSrc: 'https://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3', // 音频备用地址
poster: 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' // 音频播放封面
},
/* PPT对象 */
image: {
imgUrls: [
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
], // 所有图片数组
current: 0, // 当前跟着音视频走,播放的是第几个图片
selectIndex: 0,
timeArr: [2, 10] // 时间数组,在这个时间时,图片需要切换到对应下角标图片
},
/* 音视频 控制显示 - 变量参数 */
ctrlBar: {
isPlay: false, // 是否在播放
initial_time: 0,
currentTime: '00:00', // 音视频 播放 当前时间
totalTime: '00:00', // 音视频 播放 总时间
progress: '0%', // 播放百分比率
curRate: '1.0X', // 当前播放倍率
jumpFlag: false, // 是否跳过片头
vid: 0 // 当前视频对应的 vid
},
/* 课程章节列表 */
chapterList: {
isShow: false, // 是否显示列表
currentChapterId: '11', // 当前章节id
course: [
{
title: '第一章:重要概念',
chapters: [
{ id: '11', time: '28:18', name: '1.1 现值(PV)和终值(FV)' },
{ id: '12', time: '19:09', name: '1.2 净现值(NPV)及实际收益率' }
]
},
{
title: '第二章:证券估值',
chapters: [
{
id: '21',
time: '27:49',
name: '2.1 债券和股票的现金流贴现估值方法'
},
{ id: '22', time: '16:04', name: '2.2 债券评级及债券协议' },
{ id: '23', time: '', name: '公司金融第二周测验' },
{ id: '24', time: '', name: '公司金融第二周作业' }
]
}
],
nextVideo: {}, // 下一章 音视频对象
prevVideo: {} // 上一章音视频对象
},
/* 初始化后,视频状态设置为true先播放,会增加控制等待按钮,一直等待不能进行其他操作,到达可以播放状态时,再改为false */
initVAFlag: false,
/* 从页面传过来的参数 */
options: null
},
/* 本组件当前 this */
_that: null,
/* 视频对象 */
_video: null,
/* 音频对象 */
_audio: null,
/* 接口返回的全部进度数据,用于实时上传进度 */
realTimeProgress: null,
/* 心跳机制(注意: 在播放时,打开心跳;在暂停时,关闭心跳) - 全局唯一一个定时器 - 不参与 this.setData */
heartbeat: null,
/* 点击放大图时,属于特殊打开,会调用 onHide,需要特殊处理加标记 */
isBigPicShow: false,
/* 是否切换到 后台 */
isBackend: false,
/* 是否首次初始化 视频 */
isFirstInitAndSwitchVideo: true,
/* 存储 第一次进入 或 切换时,控制信息的相关数据 */
_cache: null,
/* show页面 - 页面内容初始化(首次打开时,data.status本身就是初始状态,则不用再调用statusClear方法进行初始化) - 1. 根据数据初始化音视频对象;2. 根据数据初始化到视频页面;3. 根据进度数据初始化视频进度 */
initPage: function (res, vid) {
/* 默认先 显示视频 */
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
}
/* 加载中时,重置控制内容 全部为 0 */
this.setData({ ctrlBar: this._cache })
/* 一定会 存在值 */
if (res) {
console.log('set res', res)
let tempVid = wx.getStorageSync('videoCacheCtrlBar').vid
if (vid == tempVid) {
this._cache = wx.getStorageSync('videoCacheCtrlBar') || {}
res.cpt = Math.max(this._cache.initial_time || '', res.cpt)
}
this._cache.initial_time = res.cpt
this.realTimeProgress = res
}
wx.setStorageSync('videoCacheCtrlBar', this._cache)
wx.setStorageSync('audioCacheCtrlBar', this._cache)
/* 将旧的对象全部抛弃掉 */
!this._video && (this._video = objV.Video('my-video'))
this._audio = objA.Audio(this.data.audio.src, this)
/* setData、视频设置等 异步,需要时间,所以加个延时,为true时播放按钮不可用 */
this.setData({ initVAFlag: true })
this.setData({ 'ctrlBar.isPlay': true })
setTimeout(() => {
/* android 手机有时候 播放失效,追加 autoPlay 自动播放 */
this.playVA()
this.setData({ 'status.isLoading': false })
/* 这里 设置倍速还有点问题 */
let _vObj = this._video
for (let i = 0; i < _vObj.RATE.length; i++) {
let _ = _vObj.RATE[i]
if (this.data.ctrlBar.curRate.replace(/X/, '') == _) {
_vObj.rateIndex = i - 1
this.setRate()
}
}
}, 200)
},
/* 页面初始入口,会 先走 AJAX 读取 章节列表数据、音视频和PPT数据、进度数据 */
ajaxInitGetInfo: function (vid, videoType) {
let cid = this.data.options.cid,
sid = this.data.options.sid,
did = 'jjhz92fn0.le2a6c06c9g0.thhg7ekb1f8'
ChapterApi.getChapterList(cid, sid, vid, json => {
this.setData({ chapterList: json })
})
// CC视频走这个接口
ChapterApi.getCurrentChapterDetail(sid, vid, videoType, json => {
// 播放的视频数据
this.setData({ video: json.video })
this.setData({ audio: json.audio })
this.setData({ image: json.image })
ChapterApi.getProgress(vid, did, sid, res => {
console.log('get', res)
if (!res) {
wx.showToast({ title: '获取视频进度失败', icon: 'none' })
}
res.did = did
res.vid = vid
res.cid = cid
res.sid = sid
this.initPage(res, vid)
ChapterApi.endVideo(res)
})
})
},
onLoad: function (options) {
if (!options.vid) {
wx.showToast({
title: '获取视频失败',
icon: 'loading',
duration: 3000,
success: function () {
setTimeout(function () {
wx.navigateBack({
delta: 1
})
}, 2000)
}
})
}
this.data.options = options
},
onHide: function () {
this.isBackend = true
this.pauseVA()
clearInterval(this.heartbeat)
ChapterApi.endVideo(this.realTimeProgress)
},
onUnload: function () {
this.pauseVA()
ChapterApi.endVideo(this.realTimeProgress)
},
onShow: function () {
/* 兼容 android 这里发现 android 打开预览大图,然后关闭 自动播放视频,而且关不掉, 兼容android强制关闭视频 */
/* 这里没有 预览大图 关闭监听,所以 isBigPicShow 状态永远为 true */
if (this.isBigPicShow) {
this.playVA()
this.isBigPicShow = false
this.isBackend = false
return
}
if (this.isBackend) {
// this.setData({ 'initVAFlag': true });
this.playVA()
/* 这里调用,跟初始化调用时保持一致,其主要也是为了解决android从后台进入前台时出现的问题 */
this.isBackend = false
}
},
/* 生命周期函数--监听页面初次渲染完成 */
onReady: function () {
this.ajaxInitGetInfo(this.data.options.vid, this.data.options.type)
},
/* controlBar页面 - 切换音频页面 - bindTap事件 */
showContentAudio: function () {
if (!this.data.audio.src) {
wx.showToast({ title: '暂无音频文件', icon: 'none' })
return
}
this.changeVideoAndAudio({
content: '当前视频将暂停播放,请确认?',
setStorage: 'videoCacheCtrlBar',
getStorage: 'audioCacheCtrlBar',
isAudio: true,
isVideo: false
})
},
/* controlBar页面 - 切换视频页面 - bindTap事件 */
showContentVideo: function () {
this.changeVideoAndAudio({
content: '当前音频将暂停播放,请确认?',
setStorage: 'audioCacheCtrlBar',
getStorage: 'videoCacheCtrlBar',
isAudio: false,
isVideo: true
})
},
/* controlBar页面 - 切换音视频页面:辅助方法 - 1. 关闭音频或视频;2. 需要提示;3. 初始化视频记录或音频记录 */
changeVideoAndAudio: function (obj) {
this.pauseVA()
wx.showModal({
title: '提示',
content: obj.content,
success: res => {
if (res.confirm) {
// wx.setStorageSync(obj.setStorage, obj.getStorage)
let cache = wx.getStorageSync(obj.getStorage)
this.setData(
{
ctrlBar: cache,
'status.isAudio': obj.isAudio,
'status.isVideo': obj.isVideo,
initVAFlag: true
},
function () {
this.seekVA(cache.initial_time)
this.playVA()
}
)
} else {
this.playVA()
}
}
})
},
/* controlBar页面 和 selectChapterList页面 - 切换章节列表 - bindTap事件 */
jumpToOtherVA: function (e) {
/* 跳转时,清空当前播放状态 */
this.heartbeat && clearInterval(this.heartbeat)
let _data = e.target.dataset
if (!_data.hasva) {
/* 如果存在 - 课后习题类型, type:3、work_type:1 */
let i1 = _data.index,
i2 = _data.index1
let _course = this.data.chapterList.course[i1]
if (_course && _course.chapters[i2] && _course.chapters[i2].homework) {
let _hw = _course.chapters[i2].homework
wx.setStorageSync('_homework', _hw)
wx.navigateTo({
url: '/pages/learnSystem/courseContent/examDetail/examDetail'
})
return
}
wx.showToast({ title: '请在PC上使用该功能', icon: 'none' })
return
}
this.isFirstInitAndSwitchVideo = true
this.statusClear(_data.name, _data.id)
this.ajaxInitGetInfo(_data.id, _data.type)
},
/* controlBar页面 和 selectChapterList页面 - 切换章节列表: 辅助方法 - 1. 暂停视频;2. 关闭章节选择列表;3. 状态清理(status、videoCacheCtrlBar、audioCacheCtrlBar);4. 设置微信导航头 */
statusClear: function (name, id) {
this.pauseVA()
this.closeSelectChapterList()
let initStatus = {
isLoading: true,
isSupport: true,
isSet: false,
isAudio: false,
isImages: false,
isVideo: false,
imagesLoaded: false
}
this.setData({ status: initStatus })
let initCtrlBar = {
isPlay: false,
initial_time: 0,
currentTime: '00:00',
totalTime: '00:00',
progress: '0%',
curRate: '1.0X',
jumpFlag: false,
vid: id
}
wx.setStorageSync('videoCacheCtrlBar', initCtrlBar)
wx.setStorageSync('audioCacheCtrlBar', initCtrlBar)
wx.setNavigationBarTitle({ title: name || '音视频' })
},
/* controlBar页面 - 上一章 - bindTap事件 */
prevChapter: function (e) {
if (!e.target.dataset.id) {
wx.showToast({ title: '已经是第一章了.', icon: 'none' })
return
}
this.jumpToOtherVA(e)
},
/* controlBar页面 - 下一章 - bindTap事件 */
nextChapter: function (e) {
if (!e.target.dataset.id) {
wx.showToast({ title: '已经是最后一章了.', icon: 'none' })
return
}
this.jumpToOtherVA(e)
},
/* controlBar页面 - 打开切换章节列表 - bindTap事件 */
openSelectChapterList: function () {
this.setData({ 'chapterList.isShow': true })
},
/* controlBar页面 - 关闭切换章节列表 - bindTap事件和内部调用 */
closeSelectChapterList: function () {
this.setData({ 'chapterList.isShow': false })
},
/* controlBar页面 - 打开图片轮播页面 - bindTap事件 */
openContentImages: function () {
this.pauseVA()
this.setData({ 'status.isImages': true })
},
/* controlBar页面 - 关闭图片轮播页面 - bindTap事件 */
closeContentImages: function () {
this.playVA()
this.setData({ 'status.isImages': false })
/* 兼容 android 发现打开previewImage后,从swiper 切换回 视频播放页,视频会自动暂停 */
// this.data.status.isVideo && this.pauseVA();
// wx.getStorageSync('videoCacheCtrlBar').isPlay && this.playVA();
},
/* controlBar页面 - 打开设置面板 - bindTap事件 */
openSetContent: function () {
this.data.status.isSet ? this.playVA() : this.pauseVA()
this.setData({ 'status.isSet': !this.data.status.isSet })
},
/* controlBar页面 - 关闭设置面板 - bindTap事件 */
closeSetContent: function () {
this.setData({ 'status.isSet': false }, function () {
this.playVA()
})
},
/* contentImages页面 - 点击放大图 - bindTap事件 */
showBigImage: function () {
let _obj = this.data.image
/* 兼容 android 暂停后 回退回来,视频未暂停还在继续播放,但进度条失去作用,所以需要 onShow中 重新调用 暂停方法 */
this.isBigPicShow = true
wx.previewImage({
current: _obj.imgUrls[_obj.selectIndex],
urls: _obj.imgUrls
})
},
/* Swiper标签 - 轮播图切换时 - bindchange事件 */
imageSelectIndexUpdate: function (e) {
this.setData({ 'image.selectIndex': e.detail.current })
},
/* VideoOrAudio image标签 - 图片开始加载 注意:图片过大时,有个加载状态 */
imagesLoadBegin: function () {
this.setData({ 'status.imagesLoaded': false })
},
/* contentAudio页面 - 图片加载完成 - bindload事件 */
imagesLoaded: function () {
this.setData({ 'status.imagesLoaded': true })
},
/* controlBar页面 - 播放音视频 - bindTap事件和内部调用 */
playVA: function () {
let _data = this.data,
_status = _data.status
this.setData({ 'ctrlBar.isPlay': true })
_status.isVideo && this._video.play()
_status.isAudio && this._audio.play()
this.setHeartbeat()
},
/* controlBar页面 - 暂停音视频 - bindTap事件和内部调用 */
pauseVA: function () {
let _data = this.data,
_status = _data.status
this.setData({ 'ctrlBar.isPlay': false })
_status.isVideo && this._video.pause()
_status.isAudio && this._audio.pause()
clearInterval(this.heartbeat)
},
/* 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))
},
/* VideoOrAudio - 跳到某个点开始播放 */
seekVA: function (time) {
let _data = this.data,
_status = _data.status
_status.isVideo && this._video.seek(time)
_status.isAudio && this._audio.seek(time)
},
/* setContent页面 - 跳过片头 - bindTap事件 */
jumpHead: function () {
this.setData({ 'ctrlBar.jumpFlag': !this.data.ctrlBar.jumpFlag })
},
/* setContent页面 - 后退15s音视频 - bindTap事件 */
slow15s: function () {
let _data = this.data,
_status = _data.status
_status.isVideo && this._video.fastSlow15('-15')
_status.isAudio && this._audio.fastSlow15('-15')
},
/* setContent页面 - 快进15s音视频 - bindTap事件 */
fast15s: function () {
let _data = this.data,
_status = _data.status
_status.isVideo && this._video.fastSlow15('15')
_status.isAudio && this._audio.fastSlow15('15')
},
/* setContent页面 - 改变播放倍率 注意:音频不支持倍速 - bindTap事件 */
setRate: function () {
let _data = this.data,
_status = _data.status
if (_status.isAudio) {
wx.showToast({ title: '音频暂不支持倍速', icon: 'none' })
return
}
let _obj = this._video
_obj.rate()
this.setData({ 'ctrlBar.curRate': _obj.RATE[_obj.rateIndex] + 'X' })
},
/* 视频进入 或者 退出全屏时 触发 */
beginAndOutFullScreen: function (e) {},
/* VideoOrAudio标签 - 开始/继续播放时触发play事件时,触发 - bindplay事件 */
beginPlayVA: function () {
if (this.data.initVAFlag) {
this.setData({ initVAFlag: false })
this.setHeartbeat() //安卓手机播放之后才会上送进度
}
/* iphone6 8.4.1 首次初始化时,不能直接 设置进度并播放 */
if (this.isFirstInitAndSwitchVideo) {
if (!this._cache) this._cache = wx.getStorageSync('videoCacheCtrlBar') || {}
this.seekVA(this._cache.initial_time)
this.isFirstInitAndSwitchVideo = false
}
},
/* VideoOrAudio标签 - 暂停播放时触发pause事件时,触发 - bindpause事件 */
beginPauseVA: function () {},
/* VideoOrAudio标签 - 当播放到末尾时,触发 - bindended事件 */
playEnded: function () {
wx.showToast({ title: '当前音/视频播放完毕。', icon: 'none' })
this.pauseVA()
},
/* VideoOrAudio标签 - 视频播放错误时,触发 - binderror事件 */
playError: function (e) {},
/* VideoOrAudio标签 - 视频播放发生变化时 - bindtimeupdate事件 */
timeUpdate: function (e) {
console.log('timeupdate', e)
let _data = this.data,
_status = _data.status,
_detail = e.detail,
_obj = _status.isVideo ? this._video : this._audio
_obj.currentTime = parseInt(_detail.currentTime)
_obj.totalTime = parseInt(_detail.duration)
this.setData({
'ctrlBar.progress': (_obj.currentTime / _obj.totalTime) * 100 + '%'
})
this.setData({
'ctrlBar.currentTime': util.durationToTimeString(_obj.currentTime)
})
this.setData({
'ctrlBar.totalTime': util.durationToTimeString(_obj.totalTime)
})
console.log(_obj.currentTime, _obj.totalTime)
/* 实时改变 当前的PPT当前页 */
let arr = this.data.image.timeArr
for (let i = 0; i < arr.length; i++) {
if (_obj.currentTime >= arr[i] && (i + 1 < arr.length ? _obj.currentTime < arr[i + 1] : 1)) {
this.setData({ 'image.current': i })
break
}
}
// 记录播放时间点,进度上传后会清空
if (!_obj.currentTime) {
return
}
this.realTimeProgress.ps = this.realTimeProgress.ps || []
const hasTimePoint = this.realTimeProgress.ps.includes(_obj.currentTime)
if (!hasTimePoint) {
this.realTimeProgress.ps.push(_obj.currentTime)
}
},
/* 增加定时器,每过10000ms,把数据存入localStorage一次 并 提交一次 */
setHeartbeat: function () {
let _data = this.data
/* 页面进入时只初始化一次 */
clearInterval(this.heartbeat)
this.heartbeat = setInterval(() => {
console.log(this.data.initVAFlag)
/* 如果是初始加载状态,就不计算时间状态 和 提交进度了 */
if (this.data.initVAFlag) return
let arr = _data.ctrlBar.currentTime.split(':'),
tempTime = parseInt(arr[0] * 60) + parseInt(arr[1])
this.setData({ 'ctrlBar.initial_time': tempTime })
/* 这里改成异步的,试一下 */
wx.setStorage({
key: 'videoCacheCtrlBar',
data: _data.ctrlBar
})
wx.setStorage({
key: 'audioCacheCtrlBar',
data: _data.ctrlBar
})
/* 由于 音视频相同,所以 设置方式设置成一致就可以了 */
/* 提交进度请求, 进度进行中,才计算上进度时间 */
if (this.realTimeProgress && tempTime != this.realTimeProgress.cpt) {
let _rProgress = this.realTimeProgress
_rProgress.pt = parseInt(_rProgress.pt) + (10000 / 1000) * 1.5
_rProgress.cpt = tempTime
_rProgress.mpt = tempTime > _rProgress.mpt ? tempTime : _rProgress.mpt
_rProgress.ps = _rProgress.ps || []
ChapterApi.updateProgress(Object.assign({}, _rProgress, { ps: _rProgress.ps.join(',') }))
this.realTimeProgress.ps = []
}
}, 10000)
}
})
{
"navigationBarBackgroundColor": "#3f3f3f",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "学习系统",
"backgroundColor": "#535353",
"disableScroll": true
}
<!--pages/videoPlayer/show.wxml-->
<import src='contentAudio/contentAudio.wxml' />
<import src='contentVideo/contentVideo.wxml' />
<import src='contentImages/contentImages.wxml' />
<import src='pageLoading/pageLoading.wxml' />
<import src='noSupport/noSupport.wxml' />
<import src='setContent/setContent.wxml' />
<import src='controlBar/controlBar.wxml' />
<import src='selectChapterList/selectChapterList.wxml' />
<block wx:if='{{status.isLoading}}'>
<template is='pageLoading'></template>
</block>
<block wx:if='{{status.isSupport}}'>
<template is='contentAudio' data='{{status, audio, image, ctrlBar}}'></template>
<template is='contentVideo' data='{{status, video, chapterList, ctrlBar}}'></template>
<block wx:if='{{status.isSet}}'>
<template is='setContent' data='{{ctrlBar}}'></template>
</block>
<block wx:elif='{{status.isImages}}'>
<template is='contentImages' data='{{status, image}}'></template>
</block>
</block>
<block wx:else>
<template is='noSupport'></template>
</block>
<template is='controlBar' data='{{status, video, ctrlBar, chapterList, initVAFlag}}'></template>
<template is='selectChapterList' data='{{status, chapterList}}'></template>
/* pages/videoPlayer/show.wxss */
@import "contentAudio/contentAudio.wxss";
@import "contentVideo/contentVideo.wxss";
@import "contentImages/contentImages.wxss";
@import "pageLoading/pageLoading.wxss";
@import "noSupport/noSupport.wxss";
@import "setContent/setContent.wxss";
@import "controlBar/controlBar.wxss";
@import "selectChapterList/selectChapterList.wxss";
\ No newline at end of file
......@@ -90,12 +90,6 @@
"query": "",
"scene": null
},
{
"name": "pages/videoPlayer/show",
"pathName": "pages/videoPlayer/show",
"query": "cid=6549489626027917312&sid=6552021107166150656&vid=6414742983802880000&type=3",
"scene": null
},
{
"name": "pages/course/player",
"pathName": "pages/course/player",
......@@ -105,4 +99,4 @@
]
}
}
}
\ No newline at end of file
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论