video.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. function setProgress(percent){
  2. $('input[type="range"]').val(percent).change();
  3. }
  4. function doAction(func){
  5. callFunc(func, '');
  6. }
  7. function queryVideoList(){
  8. var videos = $.checkTask.video_id.split(',');
  9. if(curVideo) {
  10. s1 = $.checkTask.start_time.replace(/-/g,"/");
  11. var startTime = new Date(s1).getTime()/1000;
  12. s1 = $.checkTask.end_time.replace(/-/g,"/");
  13. var endTime = new Date(s1).getTime()/1000;
  14. //获取摄像头信息
  15. VideoGetById(curVideo,function(data){
  16. if(data!=null && typeof(data)!="undefined"){
  17. var str = curVideo+'|'+startTime+'|'+endTime+'|'+data.cameratype+'|'+data.playtype;
  18. callFunc("findvideolist",str);
  19. }
  20. },function(error){
  21. });
  22. // alert(curVideo);
  23. }else{
  24. }
  25. }
  26. function playVideo(id){
  27. callFunc("playvideo", id);
  28. }
  29. var maxVV;
  30. function setProcessValue(maxValue){
  31. // alert(maxValue);
  32. // console.log(max);
  33. maxVV = maxValue;
  34. $("#ex1").slider({step: 5, min: 0, max: maxValue});
  35. }
  36. function setCurrentProcessValue(value){
  37. // alert("ddd"+value);
  38. // console.log(value);
  39. var vv =maxVV*(value/100)
  40. $("#ex1").slider('setValue',parseInt(vv));
  41. }
  42. function setVideoProcess(value){
  43. // console.log(value);
  44. var vv = value*100/maxVV;
  45. callFunc("setcurrenplayttime", parseInt(vv));
  46. }
  47. function callFunc(func, param){
  48. event = document.createEvent('MessageEvent');
  49. var origin = window.location.protocol + '//' + window.location.host;
  50. event.initMessageEvent (func, true, true, param, origin, 1234, window, null);
  51. document.dispatchEvent (event);
  52. }