video.js 1.1 KB

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