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

Skip to content

Commit 6b1b596

Browse files
committed
[CHG]优化全屏体验,减少全屏延时
1 parent 3b98675 commit 6b1b596

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

demos/base-demo/ezuikit.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,6 @@
14031403
}
14041404
}
14051405
requestFullScreen(document.getElementById(id));
1406-
setTimeout(function () {
1407-
player.postMessage("autoResize", domain + "/ezopen/h5/iframe")
1408-
}, 500)
14091406
}
14101407
if (this.params.fullScreenCallBack) {
14111408
this.params.fullScreenCallBack(this.opt.id);

demos/base-demo/index.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div className="demo">
1111
<h2>视频模式使用示例:</h2>
1212
<div id="video-container"
13-
style="width:375px;"
13+
style="width:800px;"
1414
>
1515
</div>
1616
<div>
@@ -25,14 +25,15 @@ <h2>视频模式使用示例:</h2>
2525
<button onClick="stopSave()">stopSave</button>
2626
<button onClick="startTalk()">开始对讲</button>
2727
<button onClick="stopTalk()">结束对讲</button>
28+
<button onClick="fullScreen()">全屏</button>
2829
</div>
2930
<p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
3031
</div>
3132
<script>
3233
var playr = new EZUIKit.EZUIKitPlayer({
3334
id: 'video-container', // 视频容器ID
34-
accessToken: 'at.8x4s0qfo28pq5i8w75o85fb224s9gl56-5bzotmogxc-0coxgke-e9jw98glk',
35-
url: 'ezopen://open.ys7.com/C69594192/1.live',
35+
accessToken: 'at.1yjuprkk36992fts8qw4f0ladd9lju2y-1744sk6eh7-00cbr9r-ypsznozt8',
36+
url: 'ezopen://open.ys7.com/203751922/1.live',
3637
template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版;
3738
autoplay: true,
3839
// 视频上方头部控件
@@ -51,13 +52,19 @@ <h2>视频模式使用示例:</h2>
5152
fullScreenChangeCallBack: (data) => console.log("全屏变化回调",data),
5253
getOSDTimeCallBack: (data) => console.log("获取OSDTime回调",data),
5354
handleSuccess: (data) = function(){console.log("播放成功回调",data)},
54-
handleError: (data) => console.log("播放失败回调",data),
55+
handleError: (data) => console.log("播放失败回调1",data),
5556
handleTalkSuccess: () => console.log("对讲成功回掉"),
5657
handleTalkError: (data) = function(){console.log("对讲失败",data)},
5758
decoderVersion: "v3.4",
58-
width:375,
59-
height:400,
59+
width:800,
60+
height:600,
6061
});
62+
function fullScreen(){
63+
var playPromise = playr.fullScreen();
64+
playPromise.then((data)=>{
65+
console.log("promise 获取 数据",data)
66+
})
67+
}
6168
function play() {
6269
var playPromise = playr.play();
6370
playPromise.then((data)=>{

ezuikit.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,6 @@
14031403
}
14041404
}
14051405
requestFullScreen(document.getElementById(id));
1406-
setTimeout(function () {
1407-
player.postMessage("autoResize", domain + "/ezopen/h5/iframe")
1408-
}, 500)
14091406
}
14101407
if (this.params.fullScreenCallBack) {
14111408
this.params.fullScreenCallBack(this.opt.id);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ezuikit-js",
3-
"version": "0.2.7",
3+
"version": "0.2.8",
44
"description": "ezuikit javascript for npm",
55
"main": "ezuikit.js",
66
"scripts": {

0 commit comments

Comments
 (0)