|
@@ -144,14 +144,17 @@ class LessonScene extends scene {
|
|
|
if (list && list.length >= 1) {
|
|
|
playUrl = Utils.videoUrlFormat(list[0].url);
|
|
|
}
|
|
|
+ /*
|
|
|
let videoViewDom =
|
|
|
- `
|
|
|
- <div id="view-full-screen" fe-role="Widget" class="view-full-screen-video">
|
|
|
- </div>
|
|
|
- <div id="view-video-start" fe-role="Widget">
|
|
|
- <div class="transparent-btn">播放</div>
|
|
|
- </div>
|
|
|
- `;
|
|
|
+ `
|
|
|
+ <div id="view-full-screen" fe-role="Widget" class="view-full-screen-video">
|
|
|
+ </div>
|
|
|
+ <div id="view-video-start" fe-role="Widget">
|
|
|
+ <div class="transparent-btn">播放</div>
|
|
|
+ </div>
|
|
|
+ `;
|
|
|
+ */
|
|
|
+ let videoViewDom = '';
|
|
|
document.getElementById('view-bottom').innerHTML = videoViewDom;
|
|
|
this.moye.root.reRender();
|
|
|
this.renderVideoView(title, playUrl, type);
|
|
@@ -161,12 +164,12 @@ class LessonScene extends scene {
|
|
|
`
|
|
|
<div id="view-full-screen" fe-role="Widget" class="view-full-screen-img"></div>
|
|
|
<div id="view-previous" fe-role="Widget">
|
|
|
- <div class="transparent-btn">上一页</div>
|
|
|
- </div>
|
|
|
+ <div class="transparent-btn">上一页</div>
|
|
|
+ </div>
|
|
|
<div id="view-page">1/1</div>
|
|
|
- <div id="view-next" fe-role="Widget">
|
|
|
- <div class="transparent-btn">下一页</div>
|
|
|
- </div>
|
|
|
+ <div id="view-next" fe-role="Widget">
|
|
|
+ <div class="transparent-btn">下一页</div>
|
|
|
+ </div>
|
|
|
`;
|
|
|
document.getElementById('view-bottom').innerHTML = imageViewDom;
|
|
|
this.moye.root.reRender();
|
|
@@ -194,25 +197,25 @@ class LessonScene extends scene {
|
|
|
* 渲染视频视图
|
|
|
*/
|
|
|
renderVideoView(name, url, type) {
|
|
|
- if (window.efunbox) {
|
|
|
- window.efunbox.initAndroidPlayer(
|
|
|
- name,
|
|
|
- url,
|
|
|
- 1, //与android里的音视频类型定义有关,这里写死为type=1
|
|
|
- this.videoPosition.top,
|
|
|
- this.videoPosition.left,
|
|
|
- this.videoPosition.width,
|
|
|
- this.videoPosition.height,
|
|
|
- false
|
|
|
- );
|
|
|
- window.efunbox.start();
|
|
|
- this.videoPlayer = window.efunbox;
|
|
|
- } else {
|
|
|
- const videoDom = `<div id="hls-video"></div>`;
|
|
|
- document.getElementById('view-content').innerHTML = videoDom;
|
|
|
- this.videoPlayer = new EfunVideoPlayer();
|
|
|
- this.videoPlayer.initPlayer(url, 'hls-video');
|
|
|
- }
|
|
|
+ if (window.efunbox) {
|
|
|
+ window.efunbox.initAndroidPlayer(
|
|
|
+ name,
|
|
|
+ url,
|
|
|
+ 1, //与android里的音视频类型定义有关,这里写死为type=1
|
|
|
+ this.videoPosition.top,
|
|
|
+ this.videoPosition.left,
|
|
|
+ this.videoPosition.width,
|
|
|
+ this.videoPosition.height,
|
|
|
+ false
|
|
|
+ );
|
|
|
+ window.efunbox.start();
|
|
|
+ this.videoPlayer = window.efunbox;
|
|
|
+ } else {
|
|
|
+ const videoDom = `<div id="hls-video"></div>`;
|
|
|
+ document.getElementById('view-content').innerHTML = videoDom;
|
|
|
+ this.videoPlayer = new EfunVideoPlayer();
|
|
|
+ this.videoPlayer.initPlayer(url, 'hls-video');
|
|
|
+ }
|
|
|
// 监控到初始化视频成功后暂停画面
|
|
|
this.timer = window.setInterval(() => {
|
|
|
if (this.videoPlayer.playStatus()) {
|
|
@@ -235,29 +238,31 @@ class LessonScene extends scene {
|
|
|
if (list && list.length >= 1) {
|
|
|
playUrl = Utils.videoUrlFormat(list[0].url);
|
|
|
}
|
|
|
- let playText = '播放';
|
|
|
- if (this.videoPlayer && this.videoPlayer.playStatus()) {
|
|
|
- playText = '暂停';
|
|
|
- }
|
|
|
+ /*
|
|
|
+ let playText = '播放';
|
|
|
+ if (this.videoPlayer && this.videoPlayer.playStatus()) {
|
|
|
+ playText = '暂停';
|
|
|
+ }
|
|
|
let videoViewDom =
|
|
|
- `
|
|
|
- <div id="view-full-screen" fe-role="Widget" class="view-full-screen-video">
|
|
|
- </div>
|
|
|
- <div id="view-video-start" fe-role="Widget">
|
|
|
- <div class="transparent-btn">${playText}</div>
|
|
|
- </div>
|
|
|
- `;
|
|
|
- document.getElementById('view-bottom').innerHTML = videoViewDom;
|
|
|
+ `
|
|
|
+ <div id="view-full-screen" fe-role="Widget" class="view-full-screen-video">
|
|
|
+ </div>
|
|
|
+ <div id="view-video-start" fe-role="Widget">
|
|
|
+ <div class="transparent-btn">${playText}</div>
|
|
|
+ </div>
|
|
|
+ `;
|
|
|
+ */
|
|
|
+ document.getElementById('view-bottom').innerHTML = '';
|
|
|
this.moye.root.reRender();
|
|
|
- //如果是H5播放器,则重新创建video标签
|
|
|
- if (window.efunbox) {
|
|
|
- window.efunbox.customScreen(270, 790, 1072, 603);
|
|
|
- } else {
|
|
|
- const videoDom = `<video id="hls-video" controls>你的浏览器不支持视频播放</video>`;
|
|
|
- document.getElementById('view-content').innerHTML = videoDom;
|
|
|
- this.videoPlayer = new EfunVideoPlayer();
|
|
|
- this.videoPlayer.initPlayer(playUrl, 'hls-video');
|
|
|
- }
|
|
|
+ //如果是H5播放器,则重新创建video标签
|
|
|
+ if (window.efunbox) {
|
|
|
+ window.efunbox.customScreen(270, 790, 1072, 603);
|
|
|
+ } else {
|
|
|
+ const videoDom = `<div id="hls-video"></div>`;
|
|
|
+ document.getElementById('view-content').innerHTML = videoDom;
|
|
|
+ this.videoPlayer = new EfunVideoPlayer();
|
|
|
+ this.videoPlayer.initPlayer(playUrl, 'hls-video');
|
|
|
+ }
|
|
|
break;
|
|
|
case Consts.TYPE_IMAGE:
|
|
|
let imageViewDom =
|
|
@@ -275,8 +280,8 @@ class LessonScene extends scene {
|
|
|
this.moye.root.reRender();
|
|
|
this.renderImageView();
|
|
|
break;
|
|
|
- default:
|
|
|
- break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|