提交 56c4b08d authored 作者: 何喜's avatar 何喜

修改视频类型的字段

...@@ -24,11 +24,11 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback) ...@@ -24,11 +24,11 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
name: _.children[j-1].name name: _.children[j-1].name
} }
} else if (i-1>=0) { } else if (i-1>=0) {
let _temp = res.data.chapters[i - 1] let _temp = res.data.chapters[i - 1];
prevVideo = { prevVideo = {
id: _temp.children[_temp.children.length-1].resource_id, id: _temp.children[_temp.children.length-1].resource_id,
time: _temp.children[_temp.children.length-1].video && util.durationToTimeString(_temp.children[_temp.children.length-1].video.video_length) || '', time: _temp.children[_temp.children.length-1].video && util.durationToTimeString(_temp.children[_temp.children.length-1].video.video_length) || '',
videoType: _.children[_temp.children.length-1].video && _.children[_temp.children.length-1].video.video_provider || '', videoType: _temp.children[_temp.children.length-1].video && _temp.children[_temp.children.length-1].video.video_provider || '',
name: _temp.children[_temp.children.length-1].name name: _temp.children[_temp.children.length-1].name
} }
} }
...@@ -44,7 +44,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback) ...@@ -44,7 +44,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
nextVideo = { nextVideo = {
id: _temp.children[0].resource_id, id: _temp.children[0].resource_id,
time: _temp.children[0].video && util.durationToTimeString(_temp.children[0].video.video_length) || '', time: _temp.children[0].video && util.durationToTimeString(_temp.children[0].video.video_length) || '',
videoType: _.children[0].video && _.children[0].video.video_provider || '', videoType: _temp.children[0].video && _temp.children[0].video.video_provider || '',
name: _temp.children[0].name name: _temp.children[0].name
} }
} }
...@@ -77,7 +77,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback) ...@@ -77,7 +77,7 @@ const getChapterList = (cur_course_id, cur_semester_id, cur_video_id, callback)
}), }),
nextVideo: nextVideo, nextVideo: nextVideo,
prevVideo: prevVideo prevVideo: prevVideo
} };
callback(json) callback(json)
} }
}) })
...@@ -102,7 +102,7 @@ const getCurrentChapterDetail = (vid, videoType,callback) => { ...@@ -102,7 +102,7 @@ const getCurrentChapterDetail = (vid, videoType,callback) => {
let json = { let json = {
video: { video: {
src: videoType == 3 ? res.data.video &&res.data.video.LD : res.data.video[0] && res.data.video[0].playurl, src: videoType == 3 ? res.data.video &&res.data.video.LD : res.data.video[0] && res.data.video[0].playurl,
spareSrc: 'http://pd4t7ae3m.bkt.clouddn.com/test.mp4' // 正式环境时,需要将 contentVideo 中 spareSrc 改成 src spareSrc: '' // 正式环境时,需要将 contentVideo 中 spareSrc 改成 src
}, },
audio: { audio: {
src: videoType == 3 ? res.data.video &&res.data.video.SQ : res.data.audio[0].url, src: videoType == 3 ? res.data.video &&res.data.video.SQ : res.data.audio[0].url,
......
...@@ -224,7 +224,7 @@ Page({ ...@@ -224,7 +224,7 @@ Page({
/* 如果未选课,不能查看课程内容 */ /* 如果未选课,不能查看课程内容 */
if (!this.data.headerInfo.isStart) { wx.showToast({ title: '先选课,才能看', icon: 'none', duration: 1500 }); return ; } if (!this.data.headerInfo.isStart) { wx.showToast({ title: '先选课,才能看', icon: 'none', duration: 1500 }); return ; }
let _data = e.target.dataset let _data = e.target.dataset
let cid = _data.cid, sid = _data.sid, vid = _data.vid,video_type = _data.videoType; let cid = _data.cid, sid = _data.sid, vid = _data.vid,video_type = _data.type;
if (!_data.hasva) { if (!_data.hasva) {
/* 如果存在 - 课后习题类型, type:3、work_type:1 */ /* 如果存在 - 课后习题类型, type:3、work_type:1 */
let i1 = _data.index, i2 = _data.index1 let i1 = _data.index, i2 = _data.index1
...@@ -239,7 +239,7 @@ Page({ ...@@ -239,7 +239,7 @@ Page({
} }
wx.showToast({ title: '请在PC上使用该功能', icon: 'none' }); return ; wx.showToast({ title: '请在PC上使用该功能', icon: 'none' }); return ;
} }
wx.navigateTo({ wx.navigateTo({
url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid + '&type=' + video_type url: '/pages/videoPlayer/show' + '?cid=' + cid + '&sid=' + sid + '&vid=' + vid + '&type=' + video_type
}) })
......
...@@ -28,7 +28,7 @@ Page({ ...@@ -28,7 +28,7 @@ Page({
audioPause: function () { this._audio.pause(); this.playAudio = false; }, audioPause: function () { this._audio.pause(); this.playAudio = false; },
videoPause: function () { this._video.pause(); this.playVideo = false; }, videoPause: function () { this._video.pause(); this.playVideo = false; },
videoShowOrHide: function () { this.setData({ 'isVideoShow': !this.data.isVideoShow }) }, videoShowOrHide: function () { this.setData({ 'isVideoShow': !this.data.isVideoShow }) },
changeVideo: function () { this.setData({ 'video.src': 'http://pd4t7ae3m.bkt.clouddn.com/test.mp4' }); }, changeVideo: function () { this.setData({ 'video.src': 'https://pd4t7ae3m.bkt.clouddn.com/test.mp4' }); },
timeUpdate: function (e) { timeUpdate: function (e) {
let _data = this.data, _status = _data.status, _detail = e.detail, _obj = {} let _data = this.data, _status = _data.status, _detail = e.detail, _obj = {}
console.log('视频时间变化', parseInt(_detail.currentTime)) console.log('视频时间变化', parseInt(_detail.currentTime))
...@@ -46,9 +46,9 @@ Page({ ...@@ -46,9 +46,9 @@ Page({
let _ = this let _ = this
wx.previewImage({ wx.previewImage({
urls: [ urls: [
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
], ],
current: 0, current: 0,
success: () => { success: () => {
...@@ -71,9 +71,9 @@ Page({ ...@@ -71,9 +71,9 @@ Page({
wx.previewImage({ wx.previewImage({
urls: [ urls: [
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
], ],
current: 0, current: 0,
success: () => {} success: () => {}
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<button bindtap='videoShowOrHide'>视频显示/隐藏</button> <button bindtap='videoShowOrHide'>视频显示/隐藏</button>
<view class='start-time'>播放时间:{{currentTime}}</view> <view class='start-time'>播放时间:{{currentTime}}</view>
<view class='end-time'>总时间:{{totalTime}}</view> <view class='end-time'>总时间:{{totalTime}}</view>
<audio id='audio-play' src='http://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3'></audio> <audio id='audio-play' src='https://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3'></audio>
<view style='{{isVideoShow ? "": "display:none"}}'> <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> <video id='video-play' style="width: 750rpx;" src='{{video.src}}' bindtimeupdate='timeUpdate' show-center-play-btn='{{false}}' controls='{{false}}'></video>
</view> </view>
\ No newline at end of file
...@@ -31,20 +31,20 @@ Page({ ...@@ -31,20 +31,20 @@ Page({
/* 视频地址 */ /* 视频地址 */
video: { video: {
src: '', // 视频播放地址 src: '', // 视频播放地址
spareSrc: 'http://pd4t7ae3m.bkt.clouddn.com/test.mp4' // 正常视频播放地址,浏览器不支持时,使用备用地址 spareSrc: 'https://pd4t7ae3m.bkt.clouddn.com/test.mp4' // 正常视频播放地址,浏览器不支持时,使用备用地址
}, },
/* 音频地址 */ /* 音频地址 */
audio: { audio: {
src: '', // 音频播放地址 src: '', // 音频播放地址
spareSrc: 'http://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3', // 音频备用地址 spareSrc: 'https://pd4t7ae3m.bkt.clouddn.com/audio-test.mp3', // 音频备用地址
poster: 'http://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' // 音频播放封面 poster: 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' // 音频播放封面
}, },
/* PPT对象 */ /* PPT对象 */
image: { image: {
imgUrls: [ imgUrls: [
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test1.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg', 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test2.jpg',
'http://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg' 'https://pd4t7ae3m.bkt.clouddn.com/imgs-test3.jpg'
], // 所有图片数组 ], // 所有图片数组
current: 0, // 当前跟着音视频走,播放的是第几个图片 current: 0, // 当前跟着音视频走,播放的是第几个图片
selectIndex: 0, selectIndex: 0,
......
...@@ -11,7 +11,7 @@ const url_test = { ...@@ -11,7 +11,7 @@ const url_test = {
URL_PATH2: 'https://sso2.ezijing.com', // 正式域名 - 由于项目变动域名 URL_PATH2: 'https://sso2.ezijing.com', // 正式域名 - 由于项目变动域名
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
tenant: 'classes', tenant: 'classes',
version: '3.1.0' version: '3.1.2'
}; };
const url_online = { const url_online = {
URL_PATH: 'https://api.ezijing.com/tenant', // 正式域名 - 由于项目变动域名 URL_PATH: 'https://api.ezijing.com/tenant', // 正式域名 - 由于项目变动域名
...@@ -19,7 +19,7 @@ const url_online = { ...@@ -19,7 +19,7 @@ const url_online = {
URL_PATH2: 'https://sso.ezijing.com', // 正式域名 - 由于项目变动域名 URL_PATH2: 'https://sso.ezijing.com', // 正式域名 - 由于项目变动域名
outSiteLink: 'https://e-learning.ezijing.com', // 正式外链 outSiteLink: 'https://e-learning.ezijing.com', // 正式外链
tenant: 'classes', tenant: 'classes',
version: '3.1.0' version: '3.1.2'
} }
let config = url_online; let config = url_online;
/* 请求接口统一 重定义 */ /* 请求接口统一 重定义 */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论