| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- function setProgress(percent) {
- $('input[type="range"]').val(percent).change();
- }
- function doAction(func) {
- if (func.indexOf("video") != -1) {
- if (func.indexOf("start") != -1) {
- $("#video_btn_start").addClass("hidden");
- $("#video_btn_stop").removeClass("hidden");
- if ($("#full_video_btn_start").length > 0) {
- $("#full_video_btn_start").addClass("hidden");
- $("#full_video_btn_stop").removeClass("hidden");
- }
- }
- if (func.indexOf("stop") != -1) {
- $("#video_btn_start").removeClass("hidden");
- $("#video_btn_stop").addClass("hidden");
- if ($("#full_video_btn_start").length > 0) {
- $("#full_video_btn_stop").addClass("hidden");
- $("#full_video_btn_start").removeClass("hidden");
- }
- }
- callFunc(func, '');
- } else {
- callFunc(func, '');
- }
- }
- function setVideoPos() {
- var pos = $("#video_pos").val();
- if ($("#full_video_pos").length > 0) {
- pos = $("#full_video_pos").val();
- }
- if (/^(\+|-)?\d+($|\.\d+$)/.test(pos)) {
- slider_current_value = pos;
- callFunc("video_pos", pos);
- }
- }
- function queryVideoList(videoIds) {
- if (videoIds != null) {
- s1 = $.checkTask.start_time.replace(/-/g, "/");
- var startTime = new Date(s1).getTime() / 1000;
- s1 = $.checkTask.end_time.replace(/-/g, "/");
- var endTime = new Date(s1).getTime() / 1000;
- VideoGetByIds(videoIds, function(data) {
- if (data != null && typeof(data) != "undefined") {
- var pp = {
- "videoIds": videoIds,
- "cindex": 10,
- starttime: startTime,
- "endtime": endTime,
- "videos": []
- };
- data.forEach(came => {
- pp.videos.push({
- "videoId": came.id,
- "cametype": came.cameratype,
- "filetype": came.playtype
- });
- });
- var pp = {
- "videoIds": videoIds,
- "cindex": 1,
- starttime: startTime,
- "endtime": endTime,
- "videos": [{
- "videoId": curVideo,
- "cametype": data.cameratype,
- "filetype": data.playtype
- }]
- };
- callFunc("findvideolist", JSON.stringify(pp));
- }
- }, function(error) {});
- }
- }
- function queryVideoList() {
- var videos = $.checkTask.video_id.split(',');
- if (curVideo) {
- s1 = $.checkTask.start_time.replace(/-/g, "/");
- var startTime = new Date(s1).getTime() / 1000;
- s1 = $.checkTask.end_time.replace(/-/g, "/");
- var endTime = new Date(s1).getTime() / 1000;
- //获取当前的index
- var index = 0;
- for (var i = 0; i < videos.length; i++) {
- if (parseInt(videos[i]) == parseInt(curVideo)) {
- index = i;
- break;
- }
- }
- //获取摄像头信息
- VideoGetById(curVideo, function(data) {
- if (data != null && typeof(data) != "undefined") {
- var str = curVideo + '|' + startTime + '|' + endTime + '|' + data.cameratype + '|' + data.playtype + '|' + index;
- var pp = {
- "videoIds": curVideo,
- "cindex": 10,
- starttime: startTime,
- "endtime": endTime,
- "videos": [{
- "videoId": curVideo,
- "cametype": data.cameratype,
- "filetype": data.playtype
- }]
- };
- callFunc("findvideolist", JSON.stringify(pp));
- }
- }, function(error) {
- });
- // alert(curVideo);
- } else {
- }
- }
- function playVideo(id) {
- callFunc("playvideo", id);
- }
- var maxVV;
- function setProcessValue(maxValue) {
- //alert(maxValue);
- // console.log(max);
- maxVV = maxValue;
- $("#ex1").slider({ step: 5, min: 0, max: maxValue });
- if ($("#full_ex1").length > 0) {
- $("#full_ex1").slider({ step: 5, min: 0, max: maxValue });
- }
- }
- var slider_current_value = 0;
- function setCurrentProcessValue(value) {
- // alert("ddd"+value);
- // console.log(value);
- var vv = maxVV * (value / 100)
- slider_current_value = parseInt(vv);
- $("#ex1").slider('setValue', parseInt(vv));
- if ($("#full_ex1").length > 0) {
- $("#full_ex1").slider('setValue', parseInt(vv));
- }
- }
- function setVideoProcess(value) {
- // console.log(value);
- var vv = value * 100 / maxVV;
- if (!isNaN(vv) && parseInt(vv).toString() != "NaN") {
- callFunc("setcurrenplayttime", parseInt(vv));
- } else {
- }
- }
- function callFunc(func, param) {
- var event = document.createEvent('MessageEvent');
- var origin = window.location.protocol + '//' + window.location.host;
- event.initMessageEvent(func, true, true, param, origin, 1234, window, null);
- document.dispatchEvent(event);
- }
- function playNext(index) {
- $("#video_list").val(index);
- }
|