forked from hauk0101/video-hls-encrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加encrypt和noencrypt目录是否存在的判断,如果不存在,则创建之
- Loading branch information
Showing
11 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
//post请求的相关数据 | ||
var postData = { | ||
encrypt_data: {} | ||
} | ||
}; | ||
|
||
//入口 | ||
init(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#EXTM3U | ||
#EXT-X-VERSION:3 | ||
#EXT-X-TARGETDURATION:12 | ||
#EXT-X-MEDIA-SEQUENCE:0 | ||
#EXT-X-KEY:METHOD=AES-128,URI="https://localhost:3000/key/encrypt.key" | ||
#EXTINF:11.387133, | ||
playlist0.ts | ||
#EXTINF:11.011733, | ||
playlist1.ts | ||
#EXTINF:9.051311, | ||
playlist2.ts | ||
#EXTINF:8.592489, | ||
playlist3.ts | ||
#EXTINF:6.506933, | ||
playlist4.ts | ||
#EXT-X-ENDLIST |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<title>PC HLS video</title> | ||
<link href="https://cdn.bootcss.com/video.js/6.0.0-RC.5/alt/video-js-cdn.min.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
|
||
<h1>PC 端播放 HLS(<code>.m3u8</code>) 视频</h1> | ||
<p>借助 video.js 和 videojs-contrib-hls</p> | ||
<p>由于 videojs-contrib-hls 需要通过 XHR 来获取解析 m3u8 文件, 因此会遭遇跨域问题, 请设置浏览器运行跨域</p> | ||
|
||
<video id=example-video width=600 height=300 class="video-js vjs-default-skin" controls> | ||
<source | ||
src="playlist.m3u8" | ||
type="application/x-mpegURL"> | ||
</video> | ||
<!--<script src="app/public/javascripts/video.js"></script>--> | ||
<!--<script src="app/public/javascripts/videojs-contrib-hls.min.js"></script>--> | ||
|
||
|
||
<script src="https://vjs.zencdn.net/5.19/video.min.js"></script> | ||
<!-- PC 端浏览器不支持播放 hls 文件(m3u8), 需要 videojs-contrib-hls 来给我们解码 --> | ||
<script src="https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"></script> | ||
<script> | ||
var player = videojs('example-video'); | ||
player.play(); | ||
</script> | ||
<!--<script>--> | ||
<!--// XMLHttpRequest cannot load https://xxx/video.m3u8. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://192.168.198.98:8000' is therefore not allowed access.--> | ||
<!--// 由于 videojs-contrib-hls 需要通过 XHR 来获取解析 m3u8 文件, 因此会遭遇跨域问题, 请设置浏览器运行跨域--> | ||
<!--var player = videojs('hls-video');--> | ||
<!--player.play();--> | ||
<!--</script>--> | ||
</body> | ||
</html> |