Commit 10de1c6795ee3d4a7cc2c45486cd079efb56b727

Authored by loveumiko
1 parent a15f9cc8

fix: 测试ws推流能否播放

@@ -103,8 +103,7 @@ @@ -103,8 +103,7 @@
103 name: 'dasd', 103 name: 'dasd',
104 enabled: false, 104 enabled: false,
105 tenantId: '0277ca80-693d-11ed-9e12-e5edad4f7148', 105 tenantId: '0277ca80-693d-11ed-9e12-e5edad4f7148',
106 - videoUrl:  
107 - 'https://vcsplay.scjtonline.cn:8200/live/HD_1569b634-4789-11eb-ab67-3cd2e55e0b20.m3u8?auth_key=1681179278-0-0-5c54a376f2ca32d05c4a152ee96336e9', 106 + videoUrl: 'ws://192.168.10.134:28080/rtp/62020000492000000002_34020000001320000001.live.flv',
108 sn: 's', 107 sn: 's',
109 organizationId: '27ef2a83-6f1f-4e33-824b-80afac684699', 108 organizationId: '27ef2a83-6f1f-4e33-824b-80afac684699',
110 organizationName: '车车组织', 109 organizationName: '车车组织',
@@ -16,6 +16,7 @@ @@ -16,6 +16,7 @@
16 ZoomInOutlined, 16 ZoomInOutlined,
17 ZoomOutOutlined, 17 ZoomOutOutlined,
18 } from '@ant-design/icons-vue'; 18 } from '@ant-design/icons-vue';
  19 + // import { defHttp } from '/@/utils/http/axios';
19 import { Button } from 'ant-design-vue'; 20 import { Button } from 'ant-design-vue';
20 import { nextTick } from 'vue'; 21 import { nextTick } from 'vue';
21 const { prefixCls } = useDesign('basic-video-play'); 22 const { prefixCls } = useDesign('basic-video-play');
@@ -86,8 +87,12 @@ @@ -86,8 +87,12 @@
86 !unref(isPlay) && unref(videoPlayInstance)?.play(); 87 !unref(isPlay) && unref(videoPlayInstance)?.play();
87 }; 88 };
88 89
89 - const handleTopClick = () => { 90 + const handleTopClick = async () => {
90 console.log('上'); 91 console.log('上');
  92 + handleControl('up');
  93 + setTimeout(() => {
  94 + handleControl('stop');
  95 + }, 500);
91 }; 96 };
92 97
93 const handleRightClick = () => { 98 const handleRightClick = () => {
@@ -107,6 +112,25 @@ @@ -107,6 +112,25 @@
107 console.log(type); 112 console.log(type);
108 }; 113 };
109 114
  115 + const handleControl = (direction: string) => {
  116 + const url = '/ptz/control/62020000492000000002/34020000001320000001';
  117 + const value = {
  118 + command: direction,
  119 + horizonSpeed: 30,
  120 + verticalSpeed: 30,
  121 + zoomSpeed: 30,
  122 + };
  123 + return defHttp.post(
  124 + {
  125 + url,
  126 + params: value,
  127 + },
  128 + {
  129 + joinPrefix: false,
  130 + }
  131 + );
  132 + };
  133 +
110 const isPlay = ref<Boolean | null | undefined>(true); 134 const isPlay = ref<Boolean | null | undefined>(true);
111 135
112 onMounted(async () => { 136 onMounted(async () => {
@@ -148,6 +172,12 @@ @@ -148,6 +172,12 @@
148 reloadPlayer: init, 172 reloadPlayer: init,
149 getInstance: () => unref(videoPlayInstance), 173 getInstance: () => unref(videoPlayInstance),
150 }); 174 });
  175 +
  176 + // const {send,close} = useWebSocket('ws://192.168.10.134:28080/rtp/62020000492000000002_34020000001320000001.live.flv',{
  177 + // async onConnected(){
  178 +
  179 + // }
  180 + // })
151 </script> 181 </script>
152 182
153 <template> 183 <template>