| | |
| | | let mediaStream2; |
| | | let webrtc3; |
| | | let mediaStream3; |
| | | |
| | | /** |
| | | * 页面最多同时调用三个视频,一个车牌识别,抓拍,三个顺序执行 |
| | | * @param lprParam 车牌识别参数 |
| | |
| | | */ |
| | | function initVideo(snapParam1, snapParam2, snapPram3) { |
| | | |
| | | if (!gatewaySer) { |
| | | layer.msg("未获取到库区网关信息,视频播放失败!"); |
| | | initVideo2(snapParam2, snapPram3); |
| | | return; |
| | | } |
| | | //车牌识别播放 |
| | | if (snapParam1) { |
| | | var url = ""; |
| | | if (PlayType.PLAY_TYPE_WEB_RTC == snapParam1.playType) { |
| | | url = "http://" + gatewaySer.ip + ":" + gatewaySer.apiPort + gatewaySer.playUrl; |
| | | } |
| | | if (PlayType.PLAY_TYPE_YD_QLY == snapParam1.playType) { |
| | | url = "/basic/inout/get-media"; |
| | | } |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../inout/api/inout-video-play", |
| | | url: url, |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(snapParam1), |
| | |
| | | } |
| | | |
| | | function initVideo2(snapParam2, snapParam3) { |
| | | if (!gatewaySer) { |
| | | layer.msg("未获取到库区网关信息,视频播放失败!"); |
| | | initVideo3(snapParam3) |
| | | return; |
| | | } |
| | | if (snapParam2) { |
| | | var url = ""; |
| | | if (PlayType.PLAY_TYPE_WEB_RTC == snapParam2.playType) { |
| | | url = "http://" + gatewaySer.ip + ":" + gatewaySer.apiPort + gatewaySer.playUrl; |
| | | } |
| | | if (PlayType.PLAY_TYPE_YD_QLY == snapParam2.playType) { |
| | | url = "/basic/inout/get-media"; |
| | | } |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../inout/api/inout-video-play", |
| | | url: url, |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(snapParam2), |
| | |
| | | } |
| | | |
| | | function initVideo3(snapParam3) { |
| | | if (!gatewaySer) { |
| | | layer.msg("未获取到库区网关信息,视频播放失败!"); |
| | | return; |
| | | } |
| | | if (!snapParam3) return; |
| | | var url = ""; |
| | | if (PlayType.PLAY_TYPE_WEB_RTC == snapParam3.playType) { |
| | | url = "http://" + gatewaySer.ip + ":" + gatewaySer.apiPort + gatewaySer.playUrl; |
| | | } |
| | | if (PlayType.PLAY_TYPE_YD_QLY == snapParam3.playType) { |
| | | url = "/basic/inout/get-media"; |
| | | } |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../inout/api/inout-video-play", |
| | | url: url, |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(snapParam3), |
| | |
| | | */ |
| | | function initSnapVideo(data, order) { |
| | | var htm = ""; |
| | | //海康web4.0播放 |
| | | if (PlayType.HIK_WEB4 == data.playType) { |
| | | var url = "../../inout/api/iframe-hik?id=" + data.id; |
| | | if (ship && ship == "ship") { //船运称重页面 |
| | | url += "&length=340&width=195"; |
| | | } else { //称重页面 |
| | | url += "&length=310&width=170"; |
| | | } |
| | | htm = '<iframe src=' + url + ' style="width: 100%;height: 100%"></iframe>'; |
| | | } |
| | | //VLC播放 |
| | | if (PlayType.VLC == data.playType) { |
| | | htm = "<object type='application/x-vlc-plugin' " |
| | | + "events='true' width='100%' height='100%'" |
| | | + "pluginspage='http://www.videolan.org'" |
| | | + "th:codebase='@{../../static/plugins/vlc/npapi-vlc-2.2.2.tar.xz}'>\n" |
| | | + "<param name='mrl' value='" + data.playUrl + "'/>\n" |
| | | + "<param name='volume' value='50'/>\n" |
| | | + "<param name='autoplay' value='true'/>\n" |
| | | + "<param name='loop' value='false'/>\n" |
| | | + "<param name='fullscreen' value='true'/>\n" |
| | | + "<param name='toolbar' value='false'/>\n" + "</object>"; |
| | | } |
| | | |
| | | //web-rtc播放方式 |
| | | if (PlayType.PLAY_TYPE_WEB_RTC_DH == data.playType || PlayType.PLAY_TYPE_WEB_RTC_HIK == data.playType) { |
| | | if (PlayType.PLAY_TYPE_WEB_RTC == data.playType) { |
| | | playUrl = data.playUrl; |
| | | playNum = order; |
| | | videoId = data.cameraId; |
| | | htm = '<video class="video" id="video' + playNum + '" autoplay="" muted="" playsinline=""></video>'; |
| | | } |
| | | if (PlayType.PLAY_TYPE_YD_QLY == data.playType) { |
| | | htm = '<iframe src="' + data.playUrl + '" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>'; |
| | | } |
| | | |
| | | if (1 == order) { |
| | |
| | | if (3 == order) { |
| | | $("#kccz-r-video3").append(htm); |
| | | } |
| | | if (PlayType.PLAY_TYPE_WEB_RTC_DH == data.playType || PlayType.PLAY_TYPE_WEB_RTC_HIK == data.playType) { |
| | | if (PlayType.PLAY_TYPE_WEB_RTC == data.playType) { |
| | | if (1 == order) { |
| | | webRtcToPlay1(); |
| | | } |