video.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. //获取当前的index
  15. var index = 0;
  16. for(var i = 0;i<videos.length;i++){
  17. if(parseInt(videos[i])==parseInt(curVideo)){
  18. index = i;
  19. break;
  20. }
  21. }
  22. //获取摄像头信息
  23. VideoGetById(curVideo,function(data){
  24. if(data!=null && typeof(data)!="undefined"){
  25. var str = curVideo+'|'+startTime+'|'+endTime+'|'+data.cameratype+'|'+data.playtype+'|'+index;
  26. callFunc("findvideolist",str);
  27. }
  28. },function(error){
  29. });
  30. // alert(curVideo);
  31. }else{
  32. }
  33. }
  34. function playVideo(id){
  35. callFunc("playvideo", id);
  36. }
  37. var maxVV;
  38. function setProcessValue(maxValue){
  39. //alert(maxValue);
  40. // console.log(max);
  41. maxVV = maxValue;
  42. $("#ex1").slider({step: 5, min: 0, max: maxValue});
  43. if($("#full_ex1")){
  44. $("#full_ex1").slider({step: 5, min: 0, max: maxValue});
  45. }
  46. }
  47. function setCurrentProcessValue(value){
  48. // alert("ddd"+value);
  49. // console.log(value);
  50. var vv =maxVV*(value/100)
  51. $("#ex1").slider('setValue',parseInt(vv));
  52. if($("#full_ex1")){
  53. $("#full_ex1").slider('setValue',parseInt(vv));
  54. }
  55. }
  56. function setVideoProcess(value){
  57. // console.log(value);
  58. var vv = value*100/maxVV;
  59. callFunc("setcurrenplayttime", parseInt(vv));
  60. }
  61. function callFunc(func, param){
  62. var event = document.createEvent('MessageEvent');
  63. var origin = window.location.protocol + '//' + window.location.host;
  64. event.initMessageEvent (func, true, true, param, origin, 1234, window, null);
  65. document.dispatchEvent (event);
  66. }
  67. function playNext(index){
  68. $("#video_list").val(index);
  69. }