|
@@ -24,13 +24,15 @@
|
|
|
:x="itemV.left" :y="itemV.top"
|
|
|
@dragstop="(position) => dragStop(position,itemV,bigScreenObj,curOpeBigscreenId)"
|
|
|
@resizestop="(size) => resizeSignal(size,itemV,bigScreenObj,curOpeBigscreenId)"
|
|
|
+ style="overflow:hidden;!important;"
|
|
|
>
|
|
|
- <div ref="signal" :id="itemV.ID">
|
|
|
+ <div ref="signal" :id="itemV.ID" style="width:100%;height:100%;overflow: hidden!important;">
|
|
|
<!--{{itemV.deviceID}}-->
|
|
|
<VideoPlayer
|
|
|
ref="videoPlayer"
|
|
|
- :options="playerOptions"
|
|
|
+ :options="videoPlayObj[itemV.sourceId]"
|
|
|
:playsinline="true"
|
|
|
+ :style="scaleFun(itemV)"
|
|
|
/>
|
|
|
<div class="closeBtn" @click.stop="closeSignal(itemV)">×</div>
|
|
|
</div>
|
|
@@ -50,7 +52,7 @@
|
|
|
|
|
|
import '../assets/less/splitscreen.less'
|
|
|
import {elePosition, getElementLeft, getElementTop, getStaticFile, guId} from "../../utils/tools"
|
|
|
- import {reqRefreshView} from "../api"
|
|
|
+ import {reqPreviewSourceList, reqRefreshView} from "../api"
|
|
|
import VideoPlayer from "./player.vue"
|
|
|
|
|
|
export default {
|
|
@@ -63,7 +65,10 @@
|
|
|
{
|
|
|
"src": "rtmp://58.200.131.2:1935/livetv/hunantv",
|
|
|
"type": "rtmp/flv"
|
|
|
- }
|
|
|
+ },/*{
|
|
|
+ "src": "rtmp://58.200.131.2:1935/livetv/cctv1",
|
|
|
+ "type": "rtmp/flv"
|
|
|
+ }*/,
|
|
|
],
|
|
|
aspectRatio: '482:224',
|
|
|
techOrder: ['flash'],
|
|
@@ -74,6 +79,8 @@
|
|
|
notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
},
|
|
|
screenPosition:{}, // 大屏在视口中的位置
|
|
|
+ videoPlayObj:{}, // 视频播放配置对象
|
|
|
+ savePreWh:{}, // 保存旧的开窗宽高
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -108,6 +115,42 @@
|
|
|
obj[item.ID].splitStatus = Math.floor(Math.sqrt(num)-1)
|
|
|
})
|
|
|
this.$store.dispatch('updateBigscreenObj',obj)
|
|
|
+
|
|
|
+ // 获取视频播放的配置对象
|
|
|
+ // const signalListJson = await reqPreviewSourceList()
|
|
|
+ const videoPlayObj = {
|
|
|
+ 2:{
|
|
|
+ sources: [
|
|
|
+ {
|
|
|
+ "src": "rtmp://58.200.131.2:1935/livetv/hunantv",
|
|
|
+ "type": "rtmp/flv"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ aspectRatio: '482:224',
|
|
|
+ techOrder: ['flash'],
|
|
|
+ autoplay: true,
|
|
|
+ controls: false,
|
|
|
+ fluid:true,
|
|
|
+ preload: 'auto',
|
|
|
+ notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
+ },
|
|
|
+ 3:{
|
|
|
+ sources: [
|
|
|
+ {
|
|
|
+ "src": "rtmp://58.200.131.2:1935/livetv/hunantv",
|
|
|
+ "type": "rtmp/flv"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ aspectRatio: '1:3',
|
|
|
+ techOrder: ['flash'],
|
|
|
+ autoplay: true,
|
|
|
+ controls: false,
|
|
|
+ fluid:true,
|
|
|
+ preload: 'auto',
|
|
|
+ notSupportedMessage: '此视频暂无法播放,请稍后再试',
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.videoPlayObj = videoPlayObj
|
|
|
},
|
|
|
|
|
|
updated() {
|
|
@@ -181,10 +224,39 @@
|
|
|
bigScreenObj[bigscreenId].signalArr = newSignalPreList
|
|
|
this.refreshBigScreen(bigScreenObj,bigscreenId)
|
|
|
},
|
|
|
+
|
|
|
+ // 设置视频变形
|
|
|
+ scaleFun:function (itemV) {
|
|
|
+ const value = (itemV.width/itemV.height)/(16/9)
|
|
|
+ const value2 = itemV.height/(itemV.width/16*9)
|
|
|
+ console.log(value,value2)
|
|
|
+ if(value<1){
|
|
|
+ return `transform:scale(${1/value},${value2+1})`
|
|
|
+ }else {
|
|
|
+ return `transform:scale(${value},1)`
|
|
|
+ }
|
|
|
+
|
|
|
+ /*const preWh = this.savePreWh
|
|
|
+ if(preWh[itemV.Id]){
|
|
|
+ return `transform:scale(${itemV.width/preWh[itemV.Id].width},${itemV.height/preWh[itemV.Id].height})`
|
|
|
+ }*/
|
|
|
+
|
|
|
+ /*const value = (itemV.width/itemV.height)/(16/9)
|
|
|
+ // 1.宽大于高,并且宽高比值大于16/9
|
|
|
+ if(itemV.width>itemV.height && value>1){
|
|
|
+ // 先保存旧的宽高
|
|
|
+ /!*preWh[itemV.Id] = {width:itemV.width,height:itemV.height}
|
|
|
+ this.savePreWh = preWh*!/
|
|
|
+ return `transform:scale(${value},1)`
|
|
|
+ }else if(itemV.width<itemV.height && value<1) {
|
|
|
+ console.log(1/value)
|
|
|
+ return `transform:scale(1,4)`
|
|
|
+ }*/
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
- ...mapState(['splitScreenStatus', 'bigScale','positionNum','curOpeBigscreenId','bigScreenObj']),
|
|
|
+ ...mapState(['splitScreenStatus', 'bigScale','positionNum','curOpeBigscreenId','bigScreenObj','signalListJson']),
|
|
|
|
|
|
// 当前变动的信号源数组监控
|
|
|
signalPreList: {
|