fix:升级 jessibuca到jessibuca-pro;解决海康264和h265视频流无法播放问题

pull/611/head
liudan 2022-09-16 10:45:08 +08:00
parent 7462e2776b
commit b73d08879d
4 changed files with 392 additions and 287 deletions

View File

@ -1,5 +1,6 @@
<template> <template>
<div ref="container" @dblclick="fullscreenSwich" style="width:100%;height:100%;background-color: #000000;margin:0 auto;"> <div ref="container" @dblclick="fullscreenSwich"
style="width:100%;height:100%;background-color: #000000;margin:0 auto;">
<div class="buttons-box" id="buttonsBox"> <div class="buttons-box" id="buttonsBox">
<div class="buttons-box-left"> <div class="buttons-box-left">
<i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i> <i v-if="!playing" class="iconfont icon-play jessibuca-btn" @click="playBtnClick"></i>
@ -23,8 +24,8 @@
</template> </template>
<script> <script>
let jessibucaPlayer = {}; let jessibucaPlayer = {};
export default { export default {
name: 'jessibuca', name: 'jessibuca',
data() { data() {
return { return {
@ -89,20 +90,26 @@ export default {
let options = {}; let options = {};
console.log("hasAudio " + this.hasAudio) console.log("hasAudio " + this.hasAudio)
jessibucaPlayer[this._uid] = new window.Jessibuca(Object.assign( jessibucaPlayer[this._uid] = new window.JessibucaPro(Object.assign(
{ {
container: this.$refs.container, container: this.$refs.container,
videoBuffer: 0.2, // videoBuffer: 0.2, //
isResize: true, isResize: true,
decoder: "static/js/jessibuca/decoder.js", decoder: "static/js/jessibuca/decoder.js",
useMSE: false, useMSE: true,
showBandwidth: false, debug: false,
isFlv: true, useWCS:true,
useSIMD: false,
// showBandwidth: false,
// isFlv: true,
wcsUseVideoRender:true,
// autoWasm:true,
// text: "WVP-PRO", // text: "WVP-PRO",
// background: "static/images/zlm-logo.png", // background: "static/images/zlm-logo.png",
loadingText: "加载中", loadingText: "加载中",
hasAudio: typeof (this.hasAudio) == "undefined" ? true : this.hasAudio, // hasAudio: typeof (this.hasAudio) == "undefined" ? true : this.hasAudio,
debug: false, debug: true,
hasVideo:true,
supportDblclickFullscreen: false, // supportDblclickFullscreen: false, //
operateBtns: { operateBtns: {
fullscreen: false, fullscreen: false,
@ -111,10 +118,9 @@ export default {
audio: false, audio: false,
recorder: false, recorder: false,
}, },
record: "record", isNotMute: false,
vod: this.vod, heartTimeout: 10,
forceNoOffscreen: this.forceNoOffscreen, forceNoOffscreen: true,
isNotMute: this.isNotMute,
}, },
options options
)); ));
@ -224,13 +230,13 @@ export default {
jessibucaPlayer[this._uid].on("play", () => { jessibucaPlayer[this._uid].on("play", () => {
this.playing = true; this.playing = true;
this.loaded = true; this.loaded = true;
this.quieting = jessibuca.quieting; // this.quieting = jessibuca.quieting;
}); });
if (jessibucaPlayer[this._uid].hasLoaded()) { if (jessibucaPlayer[this._uid].hasLoaded()) {
jessibucaPlayer[this._uid].play(url); jessibucaPlayer[this._uid].play(url);
} else { } else {
jessibucaPlayer[this._uid].on("load", () => { jessibucaPlayer[this._uid].on("load", () => {
console.log("load 播放") console.log("load 播放", url)
jessibucaPlayer[this._uid].play(url); jessibucaPlayer[this._uid].play(url);
}); });
} }
@ -291,11 +297,11 @@ export default {
this.loaded = false; this.loaded = false;
this.performance = ""; this.performance = "";
}, },
} }
</script> </script>
<style> <style>
.buttons-box { .buttons-box {
width: 100%; width: 100%;
height: 28px; height: 28px;
background-color: rgba(43, 51, 63, 0.7); background-color: rgba(43, 51, 63, 0.7);
@ -307,9 +313,9 @@ export default {
bottom: 0; bottom: 0;
user-select: none; user-select: none;
z-index: 10; z-index: 10;
} }
.jessibuca-btn { .jessibuca-btn {
width: 20px; width: 20px;
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
line-height: 27px; line-height: 27px;
@ -318,10 +324,10 @@ export default {
cursor: pointer; cursor: pointer;
text-align: center; text-align: center;
font-size: 0.8rem !important; font-size: 0.8rem !important;
} }
.buttons-box-right { .buttons-box-right {
position: absolute; position: absolute;
right: 0; right: 0;
} }
</style> </style>

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long