video.js 1.7 KB

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