3.4 测试video.js 参考https://github.com/videojs/videojs-contrib-hls#installation http://jsbin.com/vokipos/8/edit?html,output 1、编写测试页面video.html。

[mw_shl_code=applescript,true]<!DOCTYPE html> <html lang="en"> <head>   
  <meta http‐equiv="content‐type" content="text/html; charset=utf‐8" />   
  <title>视频播放</title> 
    <link href="/plugins/videojs/video‐js.css" rel="stylesheet"> </head> <body> <video id=example‐video width=800 height=600 class="video‐js vjs‐default‐skin vjs‐big‐playcentered" controls poster="http://127.0.0.1:90/video/add.jpg">  
   <source          
   src="http://video.xuecheng.com/video/hls/lucene.m3u8"     
        type="application/x‐mpegURL"> </video>
<input type="button" onClick="switchvideo()" value="switch"/> 
  <script src="/plugins/videojs/video.js"></script>
<script src="/plugins/videojs/videojs‐contrib‐hls.js"></script> <script>  
   var player = videojs('example‐video');   
//player.play(); //切换视频      
    function switchvideo(){     
    player.src({         
    src: 'http://video.xuecheng.com/video/hls/lucene.m3u8',      
       type: 'application/x‐mpegURL',
            withCredentials: true[/mw_shl_code]
[mw_shl_code=applescript,true]  });     
    player.play(); 
    } </script>
   </body>
</html>
[/mw_shl_code]

2、测试 配置hosts文件,本教程开发环境使用Window10,修改C:\Windows\System32\drivers\etc\hosts文件

[mw_shl_code=applescript,true]127.0.0.1 video.xuecheng.com[/mw_shl_code]