3.2 download Video.js
Video.js: https://github.com/videojs/video.js
videojs-contrib-HLS: https://github.com/videojs/videojs-contrib-hls#installation
(videojs-contrib- hls hls is a widget displays a)
the use of the document: http://docs.videojs.com/tutorial-videojs_.html
this tutorial uses video.js 6.7.3 version, videojs-contrib-hls 5.14.1 version.
Download the top two documents, in order to test demand will put plugins directory portal.
The introduction of video link on this page, the video address points video.xuecheng.com
2, video.xuecheng.com load balancing process transferring the video request to the media server
based on the process of the top, we installed Nginx on the media server, and configure as follows:
[AppleScript] plain text view Copy the code
1 2 3 4 5 6 7 8 9 |
|
3.3.2 Media server proxy
media server is more than one, to achieve load balancing by proxy, using Nginx as a proxy media server, the proxy server as a domain name server video.xuecheng.com.
Configuring video.xuecheng.com Web Hosting: Note: developing a proxy server and a media server on the same server, use the same Nginx.
[AppleScript] plain text view Copy the code
01 02 03 04 05 06 07 08 09 10 11 12 13 14 |
|
cors跨域参数: Access-Control-Allow-Origin:允许跨域访问的外域地址
通常允许跨域访问的站点不是一个,所以这里用map定义了多个站点。
如果允许任何站点跨域访问则设置为*,通常这是不建议的。
Access-Control-Allow-Credentials: 允许客户端携带证书访问 Access-Control-Allow-Methods:允许客户端跨域访问的方法
video_server_pool的配置如下:
[AppleScript] 纯文本查看 复制代码
1 2 3 4 |
|