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

Skip to content

Commit ceefc5c

Browse files
committed
[CHG]升级版本至v2.4.0
1 parent 60833d8 commit ceefc5c

File tree

10 files changed

+10690
-95
lines changed

10 files changed

+10690
-95
lines changed

UIKit JavaScript使用说明.docx

157 KB
Binary file not shown.

demo/demo-live.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030

3131
<body>
3232
<!-- ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b[.hd].live.[rtmp|hls|ws|flv|m3u8] http://hls.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.hd.m3u8-->
33-
<textarea id="url" placeholder="这里输入直播地址">ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.hd.live</textarea>
33+
<textarea id="url" placeholder="这里输入直播地址">http://hls.open.ys7.com/openlive/f01018a141094b7fa138b9d0b856507b.m3u8</textarea>
3434
<div class="btn-container">
35-
<button id="init">开始初始化</button>
36-
<button id="start">播放</button>
37-
<button id="stop">停止</button>
35+
<button id="init">初始化播放</button>
36+
<button id="stop">结束</button>
3837
</div>
3938

4039
<video
4140
id="myPlayer"
41+
autoplay
4242
src=""
4343
controls
4444
playsInline
@@ -50,9 +50,6 @@
5050
$('#init').click(function () {
5151
var url = $('#url').val().trim();
5252
$('#myPlayer').attr("src", url);
53-
console.log("url", url);
54-
console.log("video", $('myPlayer'))
55-
5653
var player = new EZUIKit.EZUIPlayer('myPlayer');
5754
// 日志
5855
player.on('log', log);
@@ -62,13 +59,6 @@
6259
div.innerHTML = (new Date()).Format('yyyy-MM-dd hh:mm:ss.S') + JSON.stringify(str);
6360
document.body.appendChild(div);
6461
}
65-
// decoder.play();
66-
$("#start").click(function () {
67-
player.play();
68-
})
69-
$("#pause").click(function () {
70-
player.pause();
71-
})
7262
$("#stop").click(function () {
7363
player.stop();
7464
})

demo/demo-jsdecoder.html renamed to demo/demo-monitor.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ <h2>预览,回放功能示例:</h2>
3333
<textarea id="url" placeholder="这里输入ezopen地址"></textarea>
3434
<textarea id="accessToken" placeholder="这里输入accessToken"></textarea>
3535
<div class="btn-container">
36-
<button id="init">开始初始化</button>
37-
<button id="start">播放</button>
38-
<button id="stop">停止</button>
36+
<button id="init">初始化播放</button>
37+
<button id="stop">结束</button>
3938
</div>
4039
<div id="playWind" style="width: 600px; height: 400px;">
4140
</div>
@@ -56,6 +55,9 @@ <h2>预览,回放功能示例:</h2>
5655
width: 600,
5756
height: 400,
5857
handleError: handleError,
58+
env: {
59+
domain: 'https://test2.ys7.com:65'
60+
}
5961
});
6062
// 这里是打印日志,本例抛出到播放页面
6163
decoder.on('log', log);

demo/demo-jsdecoder-mulit-split.html renamed to demo/demo-monitorsplit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
<script src="../js/jquery.min.js"></script>
3333
<h2>预览,回放 多窗口模式示例:</h2>
3434
<!-- <p>ezopen地址用逗号分隔</p> -->
35-
<textarea id="url" placeholder="这里输入ezopen地址">ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.live,ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.live,ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.live,ezopen://open.ys7.com/f01018a141094b7fa138b9d0b856507b.live</textarea>
35+
<textarea id="url" placeholder="这里输入ezopen地址"></textarea>
3636
<textarea id="accessToken" placeholder="这里输入accessToken"></textarea>
3737
<div class="btn-container">
3838
<button id="init">开始初始化</button>
39-
<button id="start">播放</button>
39+
<button id="start">初始化播放</button>
4040
<button id="stop">全部结束</button>
4141
</div>
4242
<div id="playWind" style="width: 1200px; height: 800px;">

ezuikit.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* jssdk 2.0
2+
* jssdk 2.4
33
*/
44
(function (global, factory) {
55

@@ -213,7 +213,6 @@
213213
}
214214
})
215215
.catch(function(err){
216-
console.log('获取地址错误,',err);
217216
var initDecoder = _this.initDecoder(playParams);
218217
if (isPromise(initDecoder) && (playParams.autoplay !== false)) {
219218
initDecoder.then(function () {
@@ -344,7 +343,6 @@
344343
if (playParams && playParams.env) {
345344
apiDomain = playParams.env.domain;
346345
}
347-
348346
/** jsDecoder 获取真实地址 -- 开始 */
349347
if (playParams && playParams.decoderPath) {
350348
var getRealUrlPromise = function (resolve, reject, ezopenURL) {
@@ -371,6 +369,12 @@
371369
var apiUrl = apiDomain + "/api/lapp/live/url/ezopen";
372370
var apiSuccess = function (data) {
373371
if (data.code == 200 || data.retcode == 0) {
372+
// 处理验证码
373+
var validateCode = getQueryString('validateCode',data.data);
374+
//var validateCode = 'ZQGWMV';
375+
if(validateCode){
376+
_this.opt.validateCode = validateCode;
377+
}
374378
realUrl += data.data;
375379
/**参数容错处理 start*/
376380
if (data.data.indexOf('playback') !== -1) { //回放
@@ -431,12 +435,10 @@
431435
});
432436
var getRealUrlPromiseObj = Promise.all(promiseTaskList)
433437
.then(function (result) {
434-
console.log("result",result)
435438
_this.opt.sources = result;
436439
_this.opt.currentSource = result[0];
437440
})
438441
.catch(function(err){
439-
console.log("result-erro",err)
440442
})
441443
return getRealUrlPromiseObj;
442444
} else {
@@ -893,8 +895,8 @@
893895
} else if (!!this.jSPlugin) {
894896
var _this = this;
895897
function getPlayParams(url) {
896-
console.log('播放的URL',url)
897-
898+
_this.jSPlugin.JS_OpenSound(0);
899+
// _this.jSPlugin.JS_SetVolume(0,100);
898900
var websocketConnectUrl = url.split('?')[0].replace('/live', '').replace('/playback', '');
899901
var websocketStreamingParam = (url.indexOf('/live')=== -1 ? '/playback?': '/live?') + url.split('?')[1];
900902
return { websocketConnectUrl, websocketStreamingParam }
@@ -905,6 +907,9 @@
905907
console.log("realplay success");
906908
if (params && params.handleSuccess) {
907909
params.handleSuccess();
910+
// 默认开启声音
911+
_this.jSPlugin.JS_OpenSound(0);
912+
// _this.jSPlugin.JS_SetVolume(0,100);
908913
}
909914
}, function (err) {
910915
console.log("realplay failed", err.oError);
@@ -939,7 +944,7 @@
939944
var _this = this;
940945
// DOM id
941946
function initDecoder(resolve, reject) {
942-
var jsPluginPath = playParams.decoderPath + '/js/jsPlugin-1.2.0.min.js';
947+
var jsPluginPath = playParams.decoderPath + '/js/jsPlugin-1.2.0_test.js';
943948

944949
/** 初始化解码器 */
945950
addJs(jsPluginPath, function () {
@@ -955,6 +960,11 @@
955960
szBasePath: playParams.decoderPath + '/js/',
956961
});
957962
_this.log("初始化解码器----完成");
963+
_this.log("开始设置秘钥");
964+
var validateCode = _this.opt.validateCode;
965+
if(validateCode){
966+
_this.jSPlugin.JS_SetSecretKey(0, validateCode);
967+
}
958968
resolve('200 OK')
959969
});
960970
/**
@@ -1016,11 +1026,14 @@
10161026
this.log("停止播放" + this.opt.currentSource);
10171027
this.opt.autoplay = false;
10181028
if (!!window['CKobject']) {
1019-
CKobject.getObjectById(this.flashId).videoClear();
1029+
//CKobject.getObjectById(this.flashId).destroy();
1030+
this.video.src=""
1031+
// this.video.remove();
10201032
} else if (!!this.video) {
10211033
if (!!this.hls) { // hls停止依赖this.hls
10221034
// 通过暂停停止播放
10231035
this.video.pause();
1036+
this.video.src=""
10241037
// 停止取流
10251038
this.hls.stopLoad();
10261039
} else if (!!this.flv) {

index.html

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,11 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7-
<title>Document</title>
8-
</head>
9-
<body>
7+
<title>轻应用-视频开发套件</title>
108
<script>
9+
window.location.href="https://open.ys7.com/jssdk/ezuikit.html"
1110
</script>
12-
<h1>轻应用 - 基础套件</h1>
13-
<h2>特性</h2>
14-
<ul>
15-
<li>基础套件不仅支持适配浏览器自动选择合适的标准流地址 —— 直播功能不再需要记录多个地址,自动适配浏览器</li>
16-
<li>提供无插件在浏览器上实现预览与回放的方法 —— 监控功能带来低延迟、支持H265、可回放的重大突破</li>
17-
</ul>
18-
<h2>支持环境</h2>
19-
<ul>
20-
<li>Windows XP/7/8/10,Mac(监控模式建议Firefox: V55+ Chrome: 55+;)</li>
21-
<li>移动端受手机性能影响较大,监控模式还在适配中。。。</li>
22-
</ul>
23-
<h2>版本</h2>
24-
<ul>
25-
<li>V2.3</li>
26-
</ul>
27-
<h2>功能列表</h2>
28-
<ul>
29-
<li><a href="./demo/demo-live.html">直播</a>(点击进入,自动适配HLS/RTMP/WS地址)</li>
30-
<li><a href="./demo/demo-jsdecoder.html">监控</a>(点击进入,目前支持非加密设备的预览与本地录像的回放)</li>
31-
<li><a href="./demo/demo-jsdecoder-mulit-split.html">多窗口</a>(点击进入,支持1,4,9个窗口播放,多窗口对浏览器性能要求较高建议使用流畅地址)</li>
32-
<li>更多功能需求可前往官网提交</li>
33-
</ul>
34-
<h2>需求调查</h2>
35-
<p>更多功能需求可以在以下问卷中提交</p>
36-
<img src="./demo/imgs/1.jpg" />
11+
</head>
12+
<body>
3713
</body>
38-
<style>
39-
body {
40-
padding:30px;
41-
}
42-
</style>
4314
</html>

js/jsPlugin-1.2.0.min.js

Lines changed: 39 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)