|
@@ -30,6 +30,10 @@
|
|
|
<div v-show="showYtbtns" @click="kzYt(2)" class="ytBtns yt-right"></div>
|
|
|
<div v-show="showYtbtns" @click="kzYt(3)" class="ytBtns yt-top"></div>
|
|
|
<div v-show="showYtbtns" @click="kzYt(4)" class="ytBtns yt-bottom"></div>
|
|
|
+ <!-- 加载条 -->
|
|
|
+ <div v-if="showVideoLoading" class="videoloading">
|
|
|
+ <a-spin size="large" tip="加载中..."/>
|
|
|
+ </div>
|
|
|
<!-- 播放器 -->
|
|
|
<div class="prism-player" id="player-con"></div>
|
|
|
</div>
|
|
@@ -194,6 +198,7 @@
|
|
|
el: '#app',
|
|
|
data: {
|
|
|
xdType: 'video', // 巡店类型
|
|
|
+ showVideoLoading: false, // 视频加载进度
|
|
|
videoStatus: false, // 获取视频失败
|
|
|
player: null, // 播放器对象
|
|
|
videoPlayerStatus:'',// 视频播放状态
|
|
@@ -288,10 +293,14 @@
|
|
|
// 重置播放器
|
|
|
this.showYt = false
|
|
|
this.showYtbtns = false
|
|
|
+ this.showVideoLoading = true
|
|
|
if(this.player){
|
|
|
- this.player.dispose()
|
|
|
+ // this.player.dispose()
|
|
|
+ // document.getElementById('player-con').innerHTML = ""
|
|
|
+ this.player.loadByUrl(url)
|
|
|
+ }else{
|
|
|
+ this.videoInit(url)
|
|
|
}
|
|
|
- this.videoInit(url)
|
|
|
},
|
|
|
// 获取视频地址失败
|
|
|
getVideoUrlError(err){
|
|
@@ -307,17 +316,19 @@
|
|
|
'source': videoSrc,
|
|
|
'width': '100%',
|
|
|
'height': '240px',
|
|
|
- 'autoplay': false,
|
|
|
+ 'autoplay': true,
|
|
|
'isLive': true,
|
|
|
'rePlay': true,
|
|
|
- 'playsinline': true,
|
|
|
- 'preload': true,
|
|
|
+ 'playsinline': false,
|
|
|
+ 'showBuffer': true,
|
|
|
+ 'preload': false,
|
|
|
'language': 'zh-cn',
|
|
|
'useH5Prism': true,
|
|
|
'extraInfo': {
|
|
|
'crossOrigin': 'anonymous'
|
|
|
},
|
|
|
- 'skinLayout': [{
|
|
|
+ 'skinLayout': [
|
|
|
+ {
|
|
|
'name': 'bigPlayButton',
|
|
|
'align': 'cc'
|
|
|
},
|
|
@@ -328,7 +339,8 @@
|
|
|
'y': 0
|
|
|
},
|
|
|
{
|
|
|
- 'name': 'infoDisplay'
|
|
|
+ 'name': 'infoDisplay',
|
|
|
+ 'align': 'cc'
|
|
|
},
|
|
|
{
|
|
|
'name': 'controlBar',
|
|
@@ -359,13 +371,29 @@
|
|
|
}, function(player) {
|
|
|
_this.sendMsg('message', 'The player is created')
|
|
|
})
|
|
|
+
|
|
|
// 控制栏
|
|
|
+ _this.player.on('ready', function(e) {
|
|
|
+ console.log('ready')
|
|
|
+ })
|
|
|
+ _this.player.on('play', function(e) {
|
|
|
+ console.log('play')
|
|
|
+ })
|
|
|
+ _this.player.on('canplay', function(e) {
|
|
|
+ console.log('canplay')
|
|
|
+ })
|
|
|
_this.player.on('playing', function() {
|
|
|
+ console.log('playing')
|
|
|
// _this.showYt = true
|
|
|
_this.videoPlayerStatus = 'playing'
|
|
|
+ _this.showVideoLoading = false
|
|
|
+ })
|
|
|
+ _this.player.on('waiting', function(e) {
|
|
|
+ console.log('waiting')
|
|
|
})
|
|
|
_this.player.on('error', function(e) {
|
|
|
console.log(JSON.stringify(e), 'error')
|
|
|
+ _this.player.loadByUrl(videoSrc)
|
|
|
})
|
|
|
// 全屏时设置横屏
|
|
|
_this.player.on('requestFullScreen', function(e) {
|