提交 0df9f424 作者: 温凯

fix:添加调试信息

上级 ef4e6cee
......@@ -5,7 +5,10 @@
</template>
<script>
import { dataURLToBlob, canvasToDataURL } from "../../../../../../utils/image-tool";
import {
dataURLToBlob,
canvasToDataURL,
} from "../../../../../../utils/image-tool";
export default {
name: "QingLiuPlayer",
......@@ -16,23 +19,24 @@ export default {
},
data() {
return {
name: 'QingLiuPlayer' + Date.now(),
name: "QingLiuPlayer" + Date.now(),
};
},
created(){
created() {
window.addEventListener("message", this.onDebugInfo);
},
mounted() {
console.log(this.raw_msg,"raw_msg");
window.onresize = (e) =>{
const clientheight = document.documentElement.clientHeight || document.body.clientHeight
let isFullScreen = screen.height == clientheight
if(isFullScreen == true){
return
}else{
this.$emit("close")
console.log(this.raw_msg, "raw_msg");
window.onresize = (e) => {
const clientheight =
document.documentElement.clientHeight || document.body.clientHeight;
let isFullScreen = screen.height == clientheight;
if (isFullScreen == true) {
return;
} else {
this.$emit("close");
}
}
};
window.qingliu = this.init;
this.init();
},
......@@ -45,7 +49,7 @@ export default {
* 初始化
*/
init() {
window.kbt_sdk_load().then( () => {
window.kbt_sdk_load().then(() => {
let parentObj = this.$refs.player_area;
window.kbt_player_create(
this.name,
......@@ -56,36 +60,37 @@ export default {
);
});
},
screenShot(){
screenShot() {
var canvas = document.querySelector("#sdk_canvas_" + this.name);
const image = canvasToDataURL(canvas);
let blob = dataURLToBlob(image);
return blob
return blob;
},
fullScreen(){
fullScreen() {
// var canvas = document.querySelector("#sdk_canvas_" + this.name);
var canvas = this.$refs.player_area.querySelector('canvas');
var canvas = this.$refs.player_area.querySelector("canvas");
canvas && canvas.requestFullscreen();
},
onDebugInfo(e){
switch(e.type){
case 'qoeinfo':
case 'raw_msg':
this.$emit('debugInfo', e);
onDebugInfo(e) {
switch (e.type) {
case "qoeinfo":
case "raw_msg":
console.log(e, "uavApplications");
this.$emit("debugInfo", e);
break;
}
}
},
},
};
</script>
<style scoped lang='scss'>
.qingliu {
.player_area{
.player_area {
width: 100%;
height: 100%;
}
.cf{
.cf {
position: fixed;
top: 0;
left: 0;
......
......@@ -84,6 +84,7 @@ export default {
switch (e.type) {
case "qoeinfo":
case "raw_msg":
console.log(e, "MMCPlayer");
this.$emit("debugInfo", e);
break;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论