|
@@ -48,7 +48,6 @@
|
|
return {
|
|
return {
|
|
vodPlayerJs: 'https://web.sdk.qcloud.com/player/tcplayer/release/v5.1.0/tcplayer.v5.1.0.min.js',
|
|
vodPlayerJs: 'https://web.sdk.qcloud.com/player/tcplayer/release/v5.1.0/tcplayer.v5.1.0.min.js',
|
|
videoToastShow: false,
|
|
videoToastShow: false,
|
|
- hasStart: false,
|
|
|
|
config: null,
|
|
config: null,
|
|
Elevideo: false,
|
|
Elevideo: false,
|
|
isInitSeek: false,
|
|
isInitSeek: false,
|
|
@@ -88,24 +87,24 @@
|
|
playbackRate = JSON.parse(JSON.stringify(this.playbackRate));
|
|
playbackRate = JSON.parse(JSON.stringify(this.playbackRate));
|
|
}
|
|
}
|
|
const TCPlayer = window.TCPlayer;
|
|
const TCPlayer = window.TCPlayer;
|
|
- console.log("是否显示进度条", this.progressControl);
|
|
|
|
|
|
+ console.log("腾讯视频是否允许拖拽进度条", this.progressControl)
|
|
this.$api.tcVideoSign(this.fileId).then(async (res) => {
|
|
this.$api.tcVideoSign(this.fileId).then(async (res) => {
|
|
- console.log('腾讯视频res', res)
|
|
|
|
|
|
+ console.log('请求腾讯视频参数', res)
|
|
let option = {
|
|
let option = {
|
|
|
|
+ fakeFullscreen: true,
|
|
|
|
+ licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323759362_1/v_cube.license',
|
|
plugins: {
|
|
plugins: {
|
|
ContinuePlay: {
|
|
ContinuePlay: {
|
|
auto: true, // 是否禁用续播功能,取值:{true,false}。
|
|
auto: true, // 是否禁用续播功能,取值:{true,false}。
|
|
SafeCheck: true // 安全检查
|
|
SafeCheck: true // 安全检查
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- fakeFullscreen: true,
|
|
|
|
- licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323759362_1/v_cube.license',
|
|
|
|
|
|
+ autoplay: this.autoplay, // 自动播放
|
|
|
|
+ playbackRates: playbackRate,
|
|
controlBar: {
|
|
controlBar: {
|
|
progressControl: this.progressControl, // 是否禁止拖拽(隐藏)进度条
|
|
progressControl: this.progressControl, // 是否禁止拖拽(隐藏)进度条
|
|
playbackRateMenuButton: playbackRateIndex // 是否显示倍速切换的按钮。
|
|
playbackRateMenuButton: playbackRateIndex // 是否显示倍速切换的按钮。
|
|
},
|
|
},
|
|
- autoplay: this.autoplay, // 自动播放
|
|
|
|
- playbackRates: playbackRate,
|
|
|
|
sources: [{
|
|
sources: [{
|
|
src: 'https://1500005692.vod2.myqcloud.com/43843706vodtranscq1500005692/62656d94387702300542496289/v.f100240.m3u8',
|
|
src: 'https://1500005692.vod2.myqcloud.com/43843706vodtranscq1500005692/62656d94387702300542496289/v.f100240.m3u8',
|
|
}],
|
|
}],
|
|
@@ -121,11 +120,26 @@
|
|
appID: res.data.data.appID,
|
|
appID: res.data.data.appID,
|
|
psign: res.data.data.psign
|
|
psign: res.data.data.psign
|
|
});
|
|
});
|
|
|
|
+ tcPlayerContext.currentTime(
|
|
|
|
+ this.currentTime || 0);
|
|
} else {
|
|
} else {
|
|
- option = {
|
|
|
|
- height: 218,
|
|
|
|
- ...option,
|
|
|
|
- };
|
|
|
|
|
|
+ uni.getSystemInfo({
|
|
|
|
+ success: (res) => {
|
|
|
|
+ // // *****高度宽度的单位都是px
|
|
|
|
+ // console.log(res.screenHeight); // 屏幕高度,包含导航栏
|
|
|
|
+ // console.log(res.windowHeight); // 能够使用的窗口高度,不包含导航栏
|
|
|
|
+ // console.log(res.screenWidth); // 屏幕宽度
|
|
|
|
+ // console.log(res.windowWidth); // 能够使用的窗口宽度
|
|
|
|
+ // // 能够使用的窗口高度,将px转换rpx
|
|
|
|
+ // this.windowHeight = (res.windowHeight * (750 / res.windowWidth))
|
|
|
|
+ // console.log(this.windowHeight)
|
|
|
|
+ option = {
|
|
|
|
+ width: res.windowWidth,
|
|
|
|
+ height: 218,
|
|
|
|
+ ...option,
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ })
|
|
let player_tencent = document.createElement("video");
|
|
let player_tencent = document.createElement("video");
|
|
player_tencent.style.width = "100%";
|
|
player_tencent.style.width = "100%";
|
|
player_tencent.id = "player-tencent";
|
|
player_tencent.id = "player-tencent";
|
|
@@ -146,7 +160,6 @@
|
|
console.log("腾讯视频恢复播放");
|
|
console.log("腾讯视频恢复播放");
|
|
if (!this.PlayStart) {
|
|
if (!this.PlayStart) {
|
|
this.onPlayStart();
|
|
this.onPlayStart();
|
|
- return;
|
|
|
|
}
|
|
}
|
|
// 设置播放时间会重复触发
|
|
// 设置播放时间会重复触发
|
|
if (this.needSeek) {
|
|
if (this.needSeek) {
|
|
@@ -174,12 +187,11 @@
|
|
// this.$emit('isSeeking', this.isSeeking);
|
|
// this.$emit('isSeeking', this.isSeeking);
|
|
// }
|
|
// }
|
|
// },
|
|
// },
|
|
- onSeeked() {
|
|
|
|
- console.log("触发拖拽结束");
|
|
|
|
- this.isSeeking = false;
|
|
|
|
- this.$emit('isSeeking', this.isSeeking);
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
|
|
+ // onSeeked() {
|
|
|
|
+ // console.log("触发拖拽结束");
|
|
|
|
+ // this.isSeeking = false;
|
|
|
|
+ // this.$emit('isSeeking', this.isSeeking);
|
|
|
|
+ // },
|
|
resumeVideo() {
|
|
resumeVideo() {
|
|
tcPlayerContext.play();
|
|
tcPlayerContext.play();
|
|
},
|
|
},
|
|
@@ -192,14 +204,14 @@
|
|
if (!this.PlayStart) return
|
|
if (!this.PlayStart) return
|
|
time = this.PlayStart == 1 ? (this.currentTime || 0) : this.playCurrentTime();
|
|
time = this.PlayStart == 1 ? (this.currentTime || 0) : this.playCurrentTime();
|
|
|
|
|
|
- if (!this.isInitSeek) {
|
|
|
|
- if (time >= this.ct) {
|
|
|
|
- this.isInitSeek = true;
|
|
|
|
- } else {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- this.onVideoSeek1(time);
|
|
|
|
|
|
+ // if (!this.isInitSeek) {
|
|
|
|
+ // if (time >= this.ct) {
|
|
|
|
+ // this.isInitSeek = true;
|
|
|
|
+ // } else {
|
|
|
|
+ // return;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // this.onVideoSeek1(time);
|
|
|
|
|
|
this.PlayStart++
|
|
this.PlayStart++
|
|
this.$emit("timeupdate", time);
|
|
this.$emit("timeupdate", time);
|