|
@@ -13,24 +13,25 @@
|
|
|
@end="isDragging=false"
|
|
|
ref="bigscreen"
|
|
|
:style="{
|
|
|
- width:item.Width*scale + 'px',
|
|
|
- height:item.Height*scale + 'px',
|
|
|
- left:item.Left*scale+'px',
|
|
|
- top:item.Top*scale+'px',
|
|
|
+ width:item.Width*bigScale + 'px',
|
|
|
+ height:item.Height*bigScale + 'px',
|
|
|
+ left:item.Left*bigScale+'px',
|
|
|
+ top:item.Top*bigScale+'px',
|
|
|
zIndex:item.ZIndex,
|
|
|
display:item.IsVisibility ? 'black' : 'none',
|
|
|
}"
|
|
|
>
|
|
|
<VueDragResize
|
|
|
v-for="itemV in signalPreList" :key="itemV.deviceID" class="sitem"
|
|
|
- :w="item.Width*scale/(splitScreenStatus+1)" :h="item.Height*scale/(splitScreenStatus+1)"
|
|
|
+ :w="item.Width*bigScale/(splitScreenStatus+1)" :h="item.Height*bigScale/(splitScreenStatus+1)"
|
|
|
:parentLimitation="false"
|
|
|
@dragstop="dragStop"
|
|
|
- @resizestop="(obj) => reSizeSignal(obj,itemV)"
|
|
|
+ @resizestop="(obj) => reSizeSignal(obj,itemV,item)"
|
|
|
>
|
|
|
<div ref="signal">
|
|
|
<video-player
|
|
|
:options="playerOptions"
|
|
|
+ style="width:100%;height:100%;object-fit: fill"
|
|
|
>
|
|
|
|
|
|
</video-player>
|
|
@@ -63,30 +64,21 @@
|
|
|
divArr:[],// 默认大屏中盒子的数组
|
|
|
streamWindows:[], // 传递出去的信号源位置信息
|
|
|
playerOptions: { // 视频播放配置
|
|
|
- muted: false,
|
|
|
- fluid:true,
|
|
|
- language: 'zh-CN',
|
|
|
+ notSupportMessage: '此视频暂无法播放',
|
|
|
+ fluid: true,
|
|
|
playbackRates: [0.7, 1.0, 1.5, 2.0],
|
|
|
- aspectRatio: '16:9',
|
|
|
- notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
sources: [
|
|
|
- {
|
|
|
+ /*{
|
|
|
src: 'http://img-ys011.didistatic.com/static/didiglobal/do1_pcUZZjSG7vFlMbdr8fA6',
|
|
|
type: 'video/mp4'
|
|
|
- },
|
|
|
- /*{
|
|
|
- src:'rtmp://172.17.20.104:1935/flvplayback/mp4:C201711040/C201711040_15133319919941212.mp4',
|
|
|
- type:'rtmp/mp4'
|
|
|
- }*/
|
|
|
- ],
|
|
|
- controlBar: {
|
|
|
- timeDivider: false,
|
|
|
- durationDisplay: false,
|
|
|
- remainingTimeDisplay: false,
|
|
|
- fullscreenToggle: false // 全屏按钮
|
|
|
- }
|
|
|
+ },*/
|
|
|
+ {
|
|
|
+ src: 'rtmp://58.200.131.2:1935/livetv/hunantv',
|
|
|
+ type: 'rtmp/flv'
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
- bigScreenJson:[]
|
|
|
+ bigScreenJson:[],
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -114,7 +106,7 @@
|
|
|
reqRefreshBigScreen(arr) {
|
|
|
const streamWindows = []
|
|
|
setTimeout(async () => {
|
|
|
- const elementArr = this.$refs.signal
|
|
|
+ const elementArr = this.$refs.signal ? this.$refs.signal.filter(item => item.clientHeight !== 0) : []
|
|
|
if(elementArr){
|
|
|
elementArr.forEach((item,index) => {
|
|
|
// 获取元素绝对位置的横坐标和纵坐标
|
|
@@ -123,8 +115,8 @@
|
|
|
streamWindows.push({
|
|
|
left,
|
|
|
top,
|
|
|
- width:this.bigScreenJson[0].Width/(this.splitScreenStatus+1),
|
|
|
- height:this.bigScreenJson[0].Height/(this.splitScreenStatus+1),
|
|
|
+ width:this.bigScreenJson[0].Width*this.$store.state.bigScale/(this.splitScreenStatus+1),
|
|
|
+ height:this.bigScreenJson[0].Height*this.$store.state.bigScale/(this.splitScreenStatus+1),
|
|
|
id:0,
|
|
|
sourceId:arr[index] ? arr[index].sourceId : '',
|
|
|
widthScale:1/(this.splitScreenStatus+1),
|
|
@@ -136,8 +128,8 @@
|
|
|
bigScreenId:this.bigScreenJson[0].ID,
|
|
|
streamWindows
|
|
|
}
|
|
|
- this.streamWindows = streamWindows
|
|
|
console.log(data)
|
|
|
+ this.streamWindows = streamWindows
|
|
|
// 调用大屏开窗接口
|
|
|
await reqRefreshView(data)
|
|
|
}
|
|
@@ -151,20 +143,30 @@
|
|
|
},
|
|
|
|
|
|
// 放大缩小信号源
|
|
|
- reSizeSignal(obj,itemV) {
|
|
|
+ async reSizeSignal(obj,itemV,item) {
|
|
|
+ console.log(obj,item)
|
|
|
const arr = this.$data.streamWindows
|
|
|
// 找出当前改动的信号源
|
|
|
const currentItem = arr.filter(item => item.sourceId === itemV.sourceId)
|
|
|
- currentItem.width = obj.width
|
|
|
- currentItem.height = obj.height
|
|
|
+ currentItem[0].widthScale = currentItem[0].widthScale*obj.width/currentItem[0].width
|
|
|
+ currentItem[0].heightScale = currentItem[0].heightScale*obj.height/currentItem[0].height
|
|
|
+ currentItem[0].width = obj.width
|
|
|
+ currentItem[0].height = obj.height
|
|
|
const otherItems = arr.filter(item => item.sourceId !== itemV.sourceId)
|
|
|
const newStreamWindows = [...currentItem,...otherItems]
|
|
|
- console.log(newStreamWindows)
|
|
|
+ const data = {
|
|
|
+ bigScreenId:this.bigScreenJson[0].ID,
|
|
|
+ streamWindows:newStreamWindows
|
|
|
+ }
|
|
|
+ console.log(data)
|
|
|
+ this.streamWindows = newStreamWindows
|
|
|
+ // 调用大屏开窗接口
|
|
|
+ await reqRefreshView(data)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
- ...mapState(['splitScreenStatus','scale']),
|
|
|
+ ...mapState(['splitScreenStatus','bigScale']),
|
|
|
|
|
|
signalPreList: {
|
|
|
get() {
|