Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6dfed44

Browse files
committed
[ADD]新增2.2版本,增加预览,回放功能
1 parent 38ee9d5 commit 6dfed44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+105359
-0
lines changed

dist/demo/demo-dev.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
6+
<meta name="renderer" content="webkit">
7+
<title>测试地址</title>
8+
<style>
9+
body{margin:0;}
10+
#url{width: 100%;height: 40px;margin-top: 20px;}
11+
#myPlayer{width: 600px;height: 400px;}
12+
button{
13+
outline: none;
14+
width: 100px;
15+
height: 30px;
16+
line-height: 30px;
17+
color: #333;
18+
border: none;
19+
cursor: pointer;
20+
}
21+
</style>
22+
</head>
23+
<script>
24+
</script>
25+
<body>
26+
<script src="../ezuikit.js"></script>
27+
28+
<textarea id="url" placeholder="这里输入直播地址"></textarea>
29+
<button id="start">开始</button>
30+
<br /><br /><br />
31+
<video id="myPlayer" poster="" controls playsInline webkit-playsinline autoplay>
32+
33+
</video>
34+
35+
<script>
36+
var start = document.getElementById('start');
37+
var urlInput = document.getElementById('url');
38+
var video = document.getElementById('myPlayer');
39+
function startEvent(){
40+
var url = urlInput.value;
41+
video.src = url;
42+
var player = new EZuikit.EZUIPlayer('myPlayer');
43+
// 日志
44+
player.on('log', log);
45+
46+
function log(str){
47+
var div = document.createElement('DIV');
48+
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
49+
document.body.appendChild(div);
50+
}
51+
}
52+
start.addEventListener('click', startEvent, false);
53+
</script>
54+
</body>
55+
</html>

dist/demo/demo-flv.html

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
6+
<meta name="renderer" content="webkit">
7+
<title>flv播放协议</title>
8+
<style>
9+
body{margin:0;}
10+
#myPlayer{max-width: 1200px;width: 100%;}
11+
</style>
12+
<style>
13+
body {
14+
margin: 0;
15+
}
16+
17+
#url,#accessToken {
18+
width: 100%;
19+
}
20+
21+
.btn-container {
22+
margin: 10px;
23+
}
24+
</style>
25+
</head>
26+
<script>
27+
</script>
28+
<body>
29+
<script src="../ezuikit.js"></script>
30+
<script src="../js/jquery.min.js"></script>
31+
<textarea id="url" placeholder="这里输入直播地址">https://flvopen.ys7.com:9188/openlive/f01018a141094b7fa138b9d0b856507b.hd.flv</textarea>
32+
<div class="btn-container">
33+
<button id="init">开始初始化</button>
34+
<button id="start">播放</button>
35+
<button id="pause">暂停</button>
36+
<!-- <button id="resume">恢复</button> -->
37+
<button id="stop">停止</button>
38+
</div>
39+
<video
40+
id="myPlayer"
41+
src="https://flvopen.ys7.com:9188/openlive/f01018a141094b7fa138b9d0b856507b.hd.flv"
42+
controls
43+
playsInline
44+
webkit-playsinline
45+
autoplay>
46+
</video>
47+
48+
<script>
49+
// var player = new EZuikit.EZUIPlayer('myPlayer');
50+
$("#init").click(function () {
51+
var url = $('#url').val().trim();
52+
// var player = new EZuikit.EZUIPlayer('myPlayer');
53+
var player = new EZuikit.EZUIPlayer({
54+
id: 'myPlayer',
55+
});
56+
$("#start").click(function () {
57+
58+
player.play();
59+
})
60+
$("#pause").click(function () {
61+
player.pause();
62+
})
63+
$("#stop").click(function () {
64+
player.stop();
65+
})
66+
67+
})
68+
// // 日志
69+
// player.on('log', log);
70+
71+
// function log(str){
72+
// var div = document.createElement('DIV');
73+
// div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
74+
// document.body.appendChild(div);
75+
// }
76+
77+
</script>
78+
</body>
79+
</html>

dist/demo/demo-hls.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
6+
<meta name="renderer" content="webkit">
7+
<title>HLS播放协议</title>
8+
<style>
9+
body{margin:0;}
10+
#myPlayer{max-width: 600px;width: 600px;}
11+
</style>
12+
</head>
13+
<script>
14+
</script>
15+
<body>
16+
<script src="../ezuikit.js"></script>
17+
<script src="../js/jquery.min.js"></script>
18+
<button id="start">开始播放</button>
19+
<button id="pause">暂停播放</button>
20+
<button id="stop">停止播放</button>
21+
<video
22+
id="myPlayer"
23+
poster=""
24+
controls
25+
playsInline
26+
webkit-playsinline
27+
>
28+
<source src="http://hls.open.ys7.com/openlive/0209eadc8aa84aec88b441519b021d7f.m3u8" type="application/x-mpegURL" />
29+
</video>
30+
31+
<script>
32+
var player = new EZuikit.EZUIPlayer('myPlayer');
33+
// 日志
34+
player.on('log', log);
35+
36+
function log(str){
37+
var div = document.createElement('DIV');
38+
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
39+
document.body.appendChild(div);
40+
}
41+
$("#start").click(function(){
42+
console.log("开始播放");
43+
player.play();
44+
});
45+
$("#pause").click(function(){
46+
console.log("暂停播放");
47+
player.pause();
48+
});
49+
$("#stop").click(function(){
50+
console.log("结束播放",player);
51+
player.stop();
52+
});
53+
54+
</script>
55+
</body>
56+
</html>

dist/demo/demo-jsdecoder.html

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7+
<meta name="renderer" content="webkit">
8+
<title>EZOPEN播放协议</title>
9+
<style>
10+
body {
11+
margin: 0;
12+
}
13+
14+
#url,
15+
#url2,
16+
#accessToken {
17+
width: 100%;
18+
}
19+
20+
.btn-container {
21+
margin: 10px;
22+
}
23+
</style>
24+
</head>
25+
<script>
26+
</script>
27+
28+
<body>
29+
<script src="../ezuikit.js"></script>
30+
<!-- <script src="../js/jsPlugin-1.2.0.js"></script> -->
31+
<script src="../js/jquery.min.js"></script>
32+
<h2>预览,回放</h2>
33+
<!-- <textarea id="url" placeholder="这里输入直播地址">ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.hd.live</textarea>
34+
<textarea id="accessToken" placeholder="这里输入accessToken">at.bzmibt1w95bmcf4w608ks9tqbq2o66tm-26j3obkb12-0d07fza-p9jqh8gyz</textarea> -->
35+
<textarea id="url" placeholder="这里输入直播地址">ezopen://open.ys7.com/01abc8dd0d94442a8ea5258e9300b712.rec</textarea>
36+
<textarea id="accessToken" placeholder="这里输入accessToken">du.0lcm43gw97hfk0yw7lh31vw89kahvbm2-7zo22ycqlb-0y90wyt-gcwyaany1</textarea>
37+
<div class="btn-container">
38+
<button id="init">开始初始化</button>
39+
<button id="start">播放</button>
40+
<!-- <button id="pause">暂停</button> -->
41+
<!-- <button id="resume">恢复</button> -->
42+
<button id="stop">停止</button>
43+
</div>
44+
<div id="playWind" style="width: 600px; height: 400px;">
45+
</div>
46+
<h2>ezopen直播</h2>
47+
<textarea id="url2" placeholder="这里输入直播地址">ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.live</textarea>
48+
<div class="btn-container">
49+
<button id="init2">开始初始化</button>
50+
<button id="start2">播放</button>
51+
<!-- <button id="pause">暂停</button> -->
52+
<!-- <button id="resume">恢复</button> -->
53+
<button id="stop2">停止</button>
54+
</div>
55+
56+
<video id="myPlayer" src="http://hls.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.m3u8" controls
57+
playsInline width="300"
58+
height="200" webkit-playsinline>
59+
</video>
60+
61+
<script>
62+
// ezopen://y.ys7.com:3100/598370938/1.hd.live.ezviz?ssn=at.447ynwc59uj0uwbq2vx7gmot3j8gch0k-3gm0axemgm-16uuarf-di5itv4sm
63+
$("#init").click(function () {
64+
var url = $('#url').val().trim();
65+
var accessToken = $('#accessToken').val().trim();
66+
var decoder = new EZUIPlayer({
67+
id: 'playWind',
68+
autoplay: true,
69+
url: url,
70+
accessToken: accessToken,
71+
decoderPath: '../',
72+
width: 600,
73+
height: 400,
74+
env: {
75+
domain: 'https://test2open.ys7.com:65',
76+
//domain: 'http://y.ys7.com:3100',
77+
}
78+
});
79+
// 日志
80+
decoder.on('log', log);
81+
82+
function log(str) {
83+
var div = document.createElement('DIV');
84+
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
85+
document.body.appendChild(div);
86+
}
87+
// decoder.play();
88+
$("#start").click(function () {
89+
decoder.play();
90+
})
91+
$("#pause").click(function () {
92+
decoder.pause();
93+
})
94+
$("#stop").click(function () {
95+
decoder.stop();
96+
})
97+
98+
})
99+
$('#init2').click(function () {
100+
var url = $('#url2').val().trim();
101+
$('#myPlayer2').attr("src", url);
102+
var player = new EZUIKit.EZUIPlayer('myPlayer');
103+
// 日志
104+
player.on('log', log);
105+
106+
function log(str) {
107+
var div = document.createElement('DIV');
108+
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
109+
document.body.appendChild(div);
110+
}
111+
// decoder.play();
112+
$("#start2").click(function () {
113+
player.play();
114+
})
115+
$("#stop2").click(function () {
116+
player.stop();
117+
})
118+
});
119+
</script>
120+
</body>
121+
122+
</html>

dist/demo/demo-rtmp.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<html lang="zh-CN">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" >
6+
<meta name="renderer" content="webkit">
7+
<title>RTMP播放协议</title>
8+
<style>
9+
body{margin:0;}
10+
#myPlayer{max-width: 1200px;width: 100%;}
11+
</style>
12+
</head>
13+
<script>
14+
</script>
15+
<body>
16+
<script src="https://open.ys7.com/sdk/js/2.0/ezuikit.js"></script>
17+
18+
<video id="myPlayer" controls playsInline webkit-playsinline autoplay>
19+
<source src="rtmp://rtmp.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.hd" type="rtmp/flv" />
20+
</video>
21+
22+
<script>
23+
var player = new EZuikit.EZUIPlayer('myPlayer');
24+
25+
// 日志
26+
player.on('log', log);
27+
28+
function log(str){
29+
var div = document.createElement('DIV');
30+
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
31+
document.body.appendChild(div);
32+
}
33+
34+
35+
</script>
36+
</body>
37+
</html>

0 commit comments

Comments
 (0)