x改bug
This commit is contained in:
parent
1eb83893d1
commit
7afe7a0f65
|
@ -105,7 +105,7 @@ const videoOption = reactive({
|
|||
muted: true, //静音
|
||||
playsinline: true,
|
||||
webFullScreen: false,
|
||||
speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
|
||||
// speedRate: ["0.75", "1.0", "1.25", "1.5", "2.0"], //播放倍速
|
||||
autoPlay: false, //自动播放
|
||||
loop: false, //循环播放
|
||||
mirror: false, //镜像画面
|
||||
|
@ -174,11 +174,8 @@ function playerVideo(item){
|
|||
//rtsp://admin:admin@10.250.116.235:8554/live
|
||||
console.log('bVideoRefs ->',bVideoRefs,Object.values(bVideoRefs.value));
|
||||
|
||||
(Object.values(bVideoRefs.value)).forEach((x: any) => {
|
||||
|
||||
console.log(`🚀 ----------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: index.vue:148 ~ playerVideo ~ x:`, x);
|
||||
console.log(`🚀 ----------------------------------------------🚀`);
|
||||
(Object.keys(bVideoRefs.value)).forEach((key) => {
|
||||
console.log(`🚀 ~ file: index.vue:180 ~ key:`, key)
|
||||
// x.connectFn('rtsp://admin:admin@10.250.116.235:8554/live','external')
|
||||
// if(Number(Number(Math.random()).toFixed(1))*10 >= 5){
|
||||
// x.connectFn('rtsp://127.0.0.1:8554/video','external');
|
||||
|
@ -186,12 +183,29 @@ function playerVideo(item){
|
|||
// x.connectFn(`rtsp://${x.ip}/live`,'external')
|
||||
// }
|
||||
// return;
|
||||
if(x.changshang == '奥威亚'){
|
||||
x.connectFn(`rtsp://${x.ip}/stream/0?config.login=web`,'external')
|
||||
}else if(x.changshang == '卓智'){
|
||||
x.connectFn(`rtsp://${x.ip}/live`,'external')
|
||||
let videoRef = bVideoRefs.value[key];
|
||||
console.log(`🚀 ~ file: index.vue:187 ~ videoRef:`, videoRef)
|
||||
|
||||
let childItem = currentItem.value.child[key];
|
||||
console.log(`🚀 ~ file: index.vue:189 ~ childItem:`, childItem)
|
||||
if(!childItem){
|
||||
console.log('无法找到视频链接对象,currentItem.value.child[key] ->',currentItem,key);
|
||||
return;
|
||||
}
|
||||
if(childItem.changshang == '奥威亚'){
|
||||
videoRef.connectFn(`rtsp://${childItem.ip}/stream/0?config.login=web`,'external')
|
||||
}else if(childItem.changshang == '卓智'){
|
||||
videoRef.connectFn(`rtsp://${childItem.ip}/live`,'external')
|
||||
}else{
|
||||
videoRef.connectFn(`rtsp://${childItem.ip}/stream/0?config.login=web`,'external')
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// (Object.values(bVideoRefs.value)).forEach((videoRef: any) => {
|
||||
|
||||
// console.log(`🚀 ~ file: index.vue:148 ~ playerVideo ~ videoRef:`, videoRef);
|
||||
// });
|
||||
setTimeout(() => {
|
||||
switchVideoToMain();
|
||||
},1000);
|
||||
|
@ -211,11 +225,7 @@ function calcOtherVideo() :any{
|
|||
}
|
||||
|
||||
function switchVideoToMain(){
|
||||
|
||||
console.log(`🚀 ------------------------------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: index.vue:188 ~ switchVideoToMain ~ switchVideoToMain:`);
|
||||
console.log(`🚀 ------------------------------------------------------------------------------------🚀`);
|
||||
|
||||
console.log(`🚀 ~ file: index.vue:188 ~ switchVideoToMain ~ switchVideoToMain: 自动切换第一个子界面到主界面`);
|
||||
nextTick(() => {
|
||||
let mainVideo = <HTMLVideoElement> document.querySelector('#mainVideo');
|
||||
let firstVideo = <HTMLVideoElement> document.querySelector('.videoMax video');
|
||||
|
@ -225,6 +235,7 @@ function switchVideoToMain(){
|
|||
}
|
||||
|
||||
function bVideoClick(e){
|
||||
console.log(`bVideoClick: 切换至主界面`);
|
||||
let mainVideo = <HTMLVideoElement> document.querySelector('#mainVideo');
|
||||
let currentVideo = <HTMLVideoElement> e.srcElement;
|
||||
mainVideo.srcObject = currentVideo.srcObject
|
||||
|
|
|
@ -47,6 +47,7 @@ nextTick(() => {
|
|||
|
||||
|
||||
onMounted(() => {
|
||||
console.log('连接流!入口');
|
||||
webRtcServer.value = initWebRtcStreamer(props.videoKey);
|
||||
})
|
||||
|
||||
|
@ -54,16 +55,19 @@ function getVideo(){
|
|||
return document.querySelector('#'+props.videoKey)
|
||||
}
|
||||
function initWebRtcStreamerFn(){
|
||||
console.log('连接流!');
|
||||
webRtcServer.value = initWebRtcStreamer(props.videoKey);
|
||||
return webRtcServer.value;
|
||||
}
|
||||
|
||||
function closeWebRtcStreamerFn(){
|
||||
console.log('关闭流!');
|
||||
closeWebRtcStreamer(webRtcServer.value);
|
||||
webRtcServer.value = null
|
||||
}
|
||||
|
||||
function connectFn(url:string,type?){
|
||||
console.log(`🚀 ~ file: video.vue:67 ~ connectFn ~ url:`, url)
|
||||
// let _path = `rtsp://${url}/stream/0?config.login=web`;
|
||||
// if(type == 'external'){
|
||||
// }
|
||||
|
|
Loading…
Reference in New Issue