Commit 23510ae9 by Tianqing Liu

feat: 增加旋转方法

1 parent 3a19263d
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
// eslint-disable-next-line // eslint-disable-next-line
_jessibuca: null, _jessibuca: null,
playOriginUrl: '', playOriginUrl: '',
rotateNum: 0,
player: { player: {
height: 0, height: 0,
...@@ -197,6 +198,16 @@ export default { ...@@ -197,6 +198,16 @@ export default {
return Promise.resolve(true); return Promise.resolve(true);
} }
}, },
rotate(num) {
let targetRotate = 0;
if (Number.isInteger(num)) {
targetRotate = num;
} else {
this.rotateNum++;
targetRotate = (this.rotateNum % 4) * 90;
}
this._jessibuca.setRotate(targetRotate);
},
screenshot(filename = '', format = 'jpeg', quality = 0.2, type = 'base64') { screenshot(filename = '', format = 'jpeg', quality = 0.2, type = 'base64') {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 如果是播放状态 // 如果是播放状态
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<button @click="handlePause">暂停</button> <button @click="handlePause">暂停</button>
<button @click="handleStop">停止</button> <button @click="handleStop">停止</button>
<button @click="handleDestroy">销毁</button> <button @click="handleDestroy">销毁</button>
<button @click="handleRotate">旋转</button>
<button @click="handleScreenshot">抓拍</button> <button @click="handleScreenshot">抓拍</button>
<button @click="handleScreenshot2">抓拍(原)</button> <button @click="handleScreenshot2">抓拍(原)</button>
<div class="record"> <div class="record">
...@@ -50,8 +51,8 @@ export default { ...@@ -50,8 +51,8 @@ export default {
base64Url: '', base64Url: '',
// 播放器相关 // 播放器相关
// playUrl: 'https://rtmp01open.ys7.com:9188/v3/openlive/F16423875_4_1.flv?expire=1695696850&id=626370860302729216&t=8c5be77f3d74149d2cdb93f913baf0c171bc33f8d6b6507510e8869b3392a4da&ev=100&supportH265=1', playUrl: 'https://rtmp01open.ys7.com:9188/v3/openlive/F16423875_4_1.flv?expire=1695696850&id=626370860302729216&t=8c5be77f3d74149d2cdb93f913baf0c171bc33f8d6b6507510e8869b3392a4da&ev=100&supportH265=1',
playUrl: '', // playUrl: '',
recordUrl: '', recordUrl: '',
} }
}, },
...@@ -92,6 +93,10 @@ export default { ...@@ -92,6 +93,10 @@ export default {
handleDestroy() { handleDestroy() {
this.$refs.vionPlayer.destroy(); this.$refs.vionPlayer.destroy();
}, },
handleRotate() {
console.log('handleRotate');
this.$refs.vionPlayer.rotate();
},
handlePtz(arrow) { handlePtz(arrow) {
console.log('handlePtz', arrow); console.log('handlePtz', arrow);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!