h5播放 加密m3u8文件
1. openssl rand 16 > enc.key
2. openssl rand 16 -hex # 获取字符串,key_info.txt 文件用
3. 新建文件:key_info.txt
http://127.0.0.1:8080/enc.key
enc.key
d7e6e8dc49a8eddc07ee028643a7a693
启动web目录
python3 -m http.server 8080
生成文件
ffmpeg -i input.mp4 -hls_time 9 -hls_key_info_file key_info.txt -hls_playlist_type vod output.m3u8 播放文件 index.html<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet"> </head> <body> <div id='player'> <video id="hls-example" class="video-js vjs-default-skin" width="352" height="288" controls type="application/x-mpegURL"> <source src="output.m3u8"> </video> </div> </body> </html> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script> --> <!-- <script src="https://unpkg.com/@videojs/http-streaming@3.15.0/dist/videojs-http-streaming.min.js"></script> --> <script src="https://vjs.zencdn.net/7.2.3/video.js"></script> <script> var player = videojs('hls-example'); player.play(); </script>
标签:info,文件,加密,m3u8,hls,h5,key From: https://www.cnblogs.com/shaoyang0123/p/18642138