提交 0df9f424 作者: 温凯

fix:添加调试信息

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