首先通过Http协议get命令,获取节目列表
请求命令:GET /hls/cctv3hd.m3u8 HTTP/1.1
Host: ivi.bupt.edu.cn
Accept: */*
Accept-Language: zh_CN
User-Agent: VLC/3.0.2 LibVLC/3.0.2
Range: bytes=0-
应答命令HTTP/1.1 206 Partial Content
Server: nginx/1.14.0
Date: Sun, 07 Oct 2018 06:23:46 GMT
Content-Type: application/vnd.apple.mpegurl
Content-Length: 325
Last-Modified: Sun, 07 Oct 2018 06:23:45 GMT
Connection: keep-alive
ETag: "5bb9a671-145"
Expires: Sun, 07 Oct 2018 06:23:45 GMT
Cache-Control: no-cache
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS
Access-Control-Allow-Headers: Accept, Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
Content-Range: bytes 0-324/325
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:126552
#EXT-X-TARGETDURATION:10
#EXTINF:10.000,
cctv3hd-1538893365000.ts
#EXTINF:10.000,
cctv3hd-1538893375000.ts
#EXTINF:10.000,
cctv3hd-1538893385000.ts
#EXTINF:10.000,
cctv3hd-1538893395000.ts
#EXTINF:10.000,
cctv3hd-1538893405000.ts
#EXTINF:10.000,
cctv3hd-1538893415000.ts
再通过http协议get命令,获取视频流
请求:GET /hls/cctv3hd-1538893365000.ts HTTP/1.1
Host: ivi.bupt.edu.cn
Cache-Control: no-cache
User-Agent: VLC/3.0.2 LibVLC/3.0.2
应答:HTTP/1.1 200 OK
Server: nginx/1.14.0
Date: Sun, 07 Oct 2018 06:23:46 GMT
Content-Type: video/mp2t
Content-Length: 5436020
Last-Modified: Sun, 07 Oct 2018 06:22:55 GMT
Connection: keep-alive
ETag: "5bb9a63f-52f274"
Expires: Sun, 07 Oct 2018 06:23:45 GMT
Cache-Control: no-cache
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS
Access-Control-Allow-Headers: Accept, Authorization,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type
Accept-Ranges: bytes