|
@@ -74,7 +74,7 @@ const current = ref(1)
|
|
|
const total = ref(0)
|
|
|
const playerList = ref([])
|
|
|
const webRtcServerList = <any[]>[]
|
|
|
-let addrList = ref<{ name: string, addr: string }[]>([])
|
|
|
+let addrList = ref<{ name: string, addr: string, cameraRate: number }[]>([])
|
|
|
|
|
|
async function getCameraDevKindList() {
|
|
|
let res = await getCameraDevKind()
|
|
@@ -196,7 +196,7 @@ async function getVideoAddrs() {
|
|
|
let res = await list({ devKind: paramKind, strType: searchParam.strType, pageSize: pageSize.value, pageNo: current.value })
|
|
|
total.value = res['total'] || 0
|
|
|
if (res.records.length != 0) {
|
|
|
- const cameraList = <{ name: string, addr: string }[]>[]
|
|
|
+ const cameraList = <{ name: string, addr: string, cameraRate: number }[]>[]
|
|
|
const cameras = res.records
|
|
|
for (let i = 0; i < cameras.length; i++) {
|
|
|
const item = cameras[i];
|
|
@@ -206,7 +206,7 @@ async function getVideoAddrs() {
|
|
|
try {
|
|
|
const data = await cameraAddr({ cameraCode: item['addr'] });
|
|
|
if (data) {
|
|
|
- cameraList.push({ name: item['name'], addr: data['url'] });
|
|
|
+ cameraList.push({ name: item['name'], addr: data['url'], cameraRate: item['cameraRate'] });
|
|
|
}
|
|
|
// cameraList.push({
|
|
|
// name: item['name'],
|
|
@@ -221,7 +221,7 @@ async function getVideoAddrs() {
|
|
|
if (item['addr'].includes('0.0.0.0')) {
|
|
|
item['addr'] = item['addr'].replace('0.0.0.0', window.location.hostname)
|
|
|
}
|
|
|
- cameraList.push({ name: item['name'], addr: item['addr'] });
|
|
|
+ cameraList.push({ name: item['name'], addr: item['addr'], cameraRate: item['cameraRate'] });
|
|
|
}
|
|
|
}
|
|
|
addrList.value = cameraList
|
|
@@ -233,7 +233,7 @@ async function getVideoAddrsSon(Id) {
|
|
|
playerList.value = []
|
|
|
let res = await getVentanalyCamera({ deviceid: Id })
|
|
|
if (res.records.length != 0) {
|
|
|
- const cameraList = <{ name: string, addr: string }[]>[]
|
|
|
+ const cameraList = <{ name: string, addr: string, cameraRate: number }[]>[]
|
|
|
const cameras = res.records
|
|
|
for (let i = 0; i < cameras.length; i++) {
|
|
|
const item = cameras[i];
|
|
@@ -243,7 +243,7 @@ async function getVideoAddrsSon(Id) {
|
|
|
try {
|
|
|
const data = await cameraAddr({ cameraCode: item['addr'] });
|
|
|
if (data && data['url']) {
|
|
|
- cameraList.push({ name: item['name'], addr: data['url'] });
|
|
|
+ cameraList.push({ name: item['name'], addr: data['url'], cameraRate: item['cameraRate'] });
|
|
|
}
|
|
|
// cameraList.push({
|
|
|
// name: item['name'],
|
|
@@ -258,7 +258,7 @@ async function getVideoAddrsSon(Id) {
|
|
|
if (item['addr'].includes('0.0.0.0')) {
|
|
|
item['addr'] = item['addr'].replace('0.0.0.0', window.location.hostname)
|
|
|
}
|
|
|
- cameraList.push({ name: item['name'], addr: item['addr'] });
|
|
|
+ cameraList.push({ name: item['name'], addr: item['addr'], cameraRate: item['cameraRate'] });
|
|
|
}
|
|
|
}
|
|
|
addrList.value = cameraList
|
|
@@ -284,12 +284,12 @@ function getVideo() {
|
|
|
webRtcServerList.push(webRtcServer)
|
|
|
webRtcServer.connect(item.addr)
|
|
|
} else {
|
|
|
- setNoRtspVideo('player' + i, item.addr)
|
|
|
+ setNoRtspVideo('player' + i, item.addr, item.cameraRate,)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function setNoRtspVideo(id, videoAddr) {
|
|
|
+function setNoRtspVideo(id, videoAddr, cameraRate) {
|
|
|
const fileExtension = videoAddr.split('.').pop();
|
|
|
if (fileExtension === 'flv') {
|
|
|
const player = new Player({
|
|
@@ -311,6 +311,8 @@ function setNoRtspVideo(id, videoAddr) {
|
|
|
customConfig: {
|
|
|
isClickPlayBack: false
|
|
|
},
|
|
|
+ defaultPlaybackRate: cameraRate || 1,
|
|
|
+ controls: false,
|
|
|
flv: {
|
|
|
retryCount: 3, // 重试 3 次,默认值
|
|
|
retryDelay: 1000, // 每次重试间隔 1 秒,默认值
|
|
@@ -342,6 +344,8 @@ function setNoRtspVideo(id, videoAddr) {
|
|
|
autoplayMuted: true,
|
|
|
cors: true,
|
|
|
poster: '/src/assets/images/vent/noSinge.png',
|
|
|
+ defaultPlaybackRate: cameraRate || 1,
|
|
|
+ controls: false,
|
|
|
hls: {
|
|
|
retryCount: 3, // 重试 3 次,默认值
|
|
|
retryDelay: 1000, // 每次重试间隔 1 秒,默认值
|
|
@@ -369,6 +373,8 @@ function setNoRtspVideo(id, videoAddr) {
|
|
|
autoplayMuted: true,
|
|
|
plugins: [HlsPlugin], // 第二步
|
|
|
poster: '/src/assets/images/vent/noSinge.png',
|
|
|
+ defaultPlaybackRate: cameraRate || 1,
|
|
|
+ controls: false,
|
|
|
hls: {
|
|
|
retryCount: 3, // 重试 3 次,默认值
|
|
|
retryDelay: 1000, // 每次重试间隔 1 秒,默认值
|