mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-17 16:36:03 +08:00
1.播放器修改
This commit is contained in:
@@ -137,8 +137,9 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$refs.player.registercallback('loadingTimeout', this.TimeoutCallback);
|
this.$refs.player.registercallback('loadingTimeout', this.TimeoutCallback);
|
||||||
this.$refs.player.registercallback('delayTimeout', this.TimeoutCallback);
|
this.$refs.player.registercallback('delayTimeout', this.TimeoutCallback);
|
||||||
|
// this.$refs.player.play("https://sample-videos.com/video321/flv/480/big_buck_bunny_480p_1mb.flv");
|
||||||
if (this.playrecord) {
|
if (this.playrecord) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
startPlay(this.deviceId, this.channelId).then((response) => {
|
startPlay(this.deviceId, this.channelId).then((response) => {
|
||||||
console.log('开始推流: [' + this.streamId + ']');
|
console.log('开始推流: [' + this.streamId + ']');
|
||||||
|
|||||||
@@ -46,7 +46,9 @@ export default {
|
|||||||
if (this.playinfo && this.playinfo.playtype !== '') {
|
if (this.playinfo && this.playinfo.playtype !== '') {
|
||||||
this.playtype = this.playinfo.playtype;
|
this.playtype = this.playinfo.playtype;
|
||||||
}
|
}
|
||||||
this.init();
|
this.$nextTick(() => {
|
||||||
|
this.init();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
@@ -58,19 +60,12 @@ export default {
|
|||||||
console.log('暂不支持webGPU,降级到webgl渲染');
|
console.log('暂不支持webGPU,降级到webgl渲染');
|
||||||
this.useWebGPU = false;
|
this.useWebGPU = false;
|
||||||
}
|
}
|
||||||
|
this.initplayer();
|
||||||
const useVconsole = this.isMobile() || this.isPad();
|
|
||||||
if (useVconsole && window.VConsole) {
|
|
||||||
new window.VConsole();
|
|
||||||
}
|
|
||||||
this.$forceUpdate(() => {
|
|
||||||
this.initplayer();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
initplayer() {
|
initplayer() {
|
||||||
this.isPlaybackPause = false;
|
this.isPlaybackPause = false;
|
||||||
this.initconf();
|
this.initconf();
|
||||||
jessibucaPlayer[this._uid] = new window.Jessibuca({
|
let options = {
|
||||||
container: this.$refs.container,
|
container: this.$refs.container,
|
||||||
decoder: '/js/jessibuca/decoder.js',
|
decoder: '/js/jessibuca/decoder.js',
|
||||||
videoBuffer: Number(0.2), // 缓存时长
|
videoBuffer: Number(0.2), // 缓存时长
|
||||||
@@ -80,19 +75,17 @@ export default {
|
|||||||
useSIMD: true,
|
useSIMD: true,
|
||||||
wcsUseVideoRender: false,
|
wcsUseVideoRender: false,
|
||||||
loadingText: '加载中',
|
loadingText: '加载中',
|
||||||
debug: false,
|
debug: true,
|
||||||
debugLevel: "debug",
|
|
||||||
showBandwidth: true, // 显示网速
|
showBandwidth: true, // 显示网速
|
||||||
showPlaybackOperate: true,
|
showPlaybackOperate: true,
|
||||||
operateBtns: this.operateBtns,
|
operateBtns: this.operateBtns,
|
||||||
forceNoOffscreen: true,
|
forceNoOffscreen: true,
|
||||||
isNotMute: false,
|
isNotMute: false,
|
||||||
showPerformance: false,
|
showPerformance: false,
|
||||||
// playFailedAndReplay: true,
|
useWebGPU: this.useWebGPU,
|
||||||
// networkDelayTimeoutReplay: true,
|
};
|
||||||
playbackForwardMaxRateDecodeIFrame: 4,
|
jessibucaPlayer[this._uid] = new window.Jessibuca({...options});
|
||||||
useWebGPU: this.useWebGPU, // 使用WebGPU
|
console.log('initplayer2');
|
||||||
});
|
|
||||||
let jessibuca = jessibucaPlayer[this._uid];
|
let jessibuca = jessibucaPlayer[this._uid];
|
||||||
this.initcallback(jessibuca);
|
this.initcallback(jessibuca);
|
||||||
this.isInit = true;
|
this.isInit = true;
|
||||||
@@ -102,17 +95,13 @@ export default {
|
|||||||
//直播按钮配置
|
//直播按钮配置
|
||||||
this.operateBtns = {
|
this.operateBtns = {
|
||||||
fullscreen: true,
|
fullscreen: true,
|
||||||
zoom: true,
|
|
||||||
ptz: true,
|
|
||||||
play: true,
|
play: true,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
//录像回放按钮配置
|
//录像回放按钮配置
|
||||||
this.operateBtns = {
|
this.operateBtns = {
|
||||||
fullscreen: true,
|
fullscreen: true,
|
||||||
zoom: true,
|
|
||||||
play: true,
|
play: true,
|
||||||
ptz: false,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -151,22 +140,18 @@ export default {
|
|||||||
jessibuca.on('timeout', function (error) {
|
jessibuca.on('timeout', function (error) {
|
||||||
console.log('timeout:', error);
|
console.log('timeout:', error);
|
||||||
});
|
});
|
||||||
jessibuca.on('playbackPreRateChange', (rate) => {
|
// let pre = 0;
|
||||||
jessibuca.forward(rate);
|
// let cur = 0;
|
||||||
});
|
// jessibuca.on('timeUpdate', function (ts) {
|
||||||
|
// cur = parseInt(ts / 60000);
|
||||||
let pre = 0;
|
// if (pre !== cur) {
|
||||||
let cur = 0;
|
// pre++;
|
||||||
jessibuca.on('timeUpdate', function (ts) {
|
// }
|
||||||
cur = parseInt(ts / 60000);
|
// });
|
||||||
if (pre !== cur) {
|
// jessibuca.on("ptz", (arrow) => {
|
||||||
pre++;
|
// console.log('ptz arrow', arrow);
|
||||||
}
|
// _this.handlePtz(arrow);
|
||||||
});
|
// });
|
||||||
jessibuca.on(JessibucaPro.EVENTS.ptz, (arrow) => {
|
|
||||||
console.log('ptz arrow', arrow);
|
|
||||||
_this.handlePtz(arrow);
|
|
||||||
});
|
|
||||||
jessibuca.on('crashLog', (data) => {
|
jessibuca.on('crashLog', (data) => {
|
||||||
console.log('crashLog is', data);
|
console.log('crashLog is', data);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user