|
@@ -27,10 +27,10 @@
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
- controlBar: {
|
|
|
+ progressControl: {
|
|
|
type: Boolean,
|
|
|
default: () => {
|
|
|
- return true //是否禁止拖拽进度条,取值:{true,false}。
|
|
|
+ return false //是否禁止拖拽进度条,取值:{true,false}。
|
|
|
}
|
|
|
},
|
|
|
currentTime: {
|
|
@@ -79,14 +79,18 @@
|
|
|
},
|
|
|
// 播放视频
|
|
|
loadPlayer() {
|
|
|
+ let playbackRateIndex = true;
|
|
|
+ let playbackRate = [1];
|
|
|
if (this.playbackRate.length <= 1) {
|
|
|
- var playbackRate = [1];
|
|
|
+ playbackRateIndex = false;
|
|
|
} else {
|
|
|
- var playbackRate = JSON.parse(JSON.stringify(this.playbackRate));
|
|
|
+ playbackRateIndex = true;
|
|
|
+ playbackRate = JSON.parse(JSON.stringify(this.playbackRate));
|
|
|
}
|
|
|
const TCPlayer = window.TCPlayer;
|
|
|
- console.log("是否显示进度条", this.controlBar);
|
|
|
+ console.log("是否显示进度条", this.progressControl);
|
|
|
this.$api.tcVideoSign(this.fileId).then(async (res) => {
|
|
|
+ console.log('腾讯视频res', res)
|
|
|
let option = {
|
|
|
plugins: {
|
|
|
ContinuePlay: {
|
|
@@ -94,15 +98,23 @@
|
|
|
SafeCheck: true // 安全检查
|
|
|
},
|
|
|
},
|
|
|
+ controlBar: {
|
|
|
+ progressControl: this.progressControl, // 是否禁止拖拽(隐藏)进度条
|
|
|
+ playbackRateMenuButton: playbackRateIndex // 是否显示倍速切换的按钮。
|
|
|
+ },
|
|
|
+ playbackRates: playbackRate,
|
|
|
+ autoplay: this.autoplay, // 自动播放
|
|
|
+ fakeFullscreen: true,
|
|
|
+
|
|
|
sources: [{
|
|
|
src: 'https://1500005692.vod2.myqcloud.com/43843706vodtranscq1500005692/62656d94387702300542496289/v.f100240.m3u8',
|
|
|
}],
|
|
|
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323759362_1/v_cube.license',
|
|
|
- playbackRates: playbackRate,
|
|
|
- autoplay: this.autoplay, // 自动播放
|
|
|
- controlBar: {
|
|
|
- progressControl: this.controlBar
|
|
|
- } // 是否禁止拖拽(隐藏)进度条
|
|
|
+
|
|
|
+ // fileID: res.data.data.fileID,
|
|
|
+ // appID: res.data.data.appID,
|
|
|
+ // psign: res.data.data.psign,
|
|
|
+ // licenseUrl: res.data.data.licenseUrl,
|
|
|
};
|
|
|
if (tcPlayerContext) {
|
|
|
tcPlayerContext.currentTime(
|
|
@@ -129,7 +141,7 @@
|
|
|
});
|
|
|
},
|
|
|
playing() {
|
|
|
- if(this.isSeeking) return;
|
|
|
+ // if (this.isSeeking) return;
|
|
|
console.log("腾讯视频恢复播放");
|
|
|
if (!this.PlayStart) {
|
|
|
this.onPlayStart();
|
|
@@ -176,7 +188,7 @@
|
|
|
console.log("腾讯视频播放err", err);
|
|
|
},
|
|
|
timeupdate(e) {
|
|
|
- if(this.isSeeking) return;
|
|
|
+ // if (this.isSeeking) return;
|
|
|
let time = 0;
|
|
|
if (!this.PlayStart) return
|
|
|
time = this.PlayStart == 1 ? (this.currentTime || 0) : this.playCurrentTime();
|
|
@@ -237,7 +249,7 @@
|
|
|
// }).then((res) => {});
|
|
|
},
|
|
|
onVideoSeek1(time) {
|
|
|
- if (!this.controlBar) {
|
|
|
+ if (!this.progressControl) {
|
|
|
if (Math.abs(time - this.playTime) > 5) {
|
|
|
console.log("进度条回拉", this.playTime, this.ct);
|
|
|
this.seekVideo(this.playTime);
|