video.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. UE.parse.register("vedio", function(utils) {
  2. var video = this.root.getElementsByTagName("video"),
  3. audio = this.root.getElementsByTagName("audio");
  4. document.createElement("video");
  5. document.createElement("audio");
  6. if (video.length || audio.length) {
  7. var sourcePath = utils.removeLastbs(this.rootPath),
  8. jsurl = sourcePath + "/third-party/video-js/video.js",
  9. cssurl = sourcePath + "/third-party/video-js/video-js.min.css",
  10. swfUrl = sourcePath + "/third-party/video-js/video-js.swf";
  11. if (window.videojs) {
  12. videojs.autoSetup();
  13. } else {
  14. utils.loadFile(document, {
  15. id: "video_css",
  16. tag: "link",
  17. rel: "stylesheet",
  18. type: "text/css",
  19. href: cssurl
  20. });
  21. utils.loadFile(
  22. document,
  23. {
  24. id: "video_js",
  25. src: jsurl,
  26. tag: "script",
  27. type: "text/javascript"
  28. },
  29. function() {
  30. videojs.options.flash.swf = swfUrl;
  31. videojs.autoSetup();
  32. }
  33. );
  34. }
  35. }
  36. });