load.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <script>
  2. Farm.url = '{{loadUrl}}&ajax=1';
  3. Farm.CreateLoop();
  4. </script>
  5. {% if 'camera' in data and data['camera'] %}
  6. <script type="text/javascript" src="{{static_url('pc/lib/player/video.min.js')}}"></script>
  7. <script type="text/javascript" src="{{static_url('pc/lib/player/videojs-contrib-hls.min.js')}}"></script>
  8. <script>
  9. $(".player").each(function()
  10. {
  11. var self = $(this);
  12. var id = self.attr('id');
  13. var url = self.attr('data-url');
  14. var player = videojs(id, { fluid: true }, function()
  15. {
  16. //this.play();
  17. this.on('loadeddata', function() {
  18. var height = $('.video-js video').height();
  19. $('.box img').height(height).css('display','block');
  20. });
  21. });
  22. });
  23. </script>
  24. <script type="text/javascript" src="http://g.alicdn.com/de/prismplayer/1.9.9/prism-min.js"></script>
  25. <script>
  26. /*
  27. $(".player").each(function()
  28. {
  29. var self = $(this);
  30. var id = self.attr('id');
  31. var url = self.attr('data-url');
  32. // 初始化播放器
  33. var player = new prismplayer({
  34. id: id, // 容器id
  35. source: url, // 视频url
  36. isLive:true,//设置为true时为直播状态
  37. width: "100%", // 播放器宽度
  38. height: "383px" // 播放器高度
  39. });
  40. player.on('ready',function(e) {
  41. self.show();
  42. });
  43. });
  44. */
  45. </script>
  46. {% end %}