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

Skip to content

Commit 7ab36de

Browse files
committed
[feat]支持切换主题
[fix]修复对讲结束问题问题 [feat]移动端主题支持隐藏回放时间轴
1 parent f5bae2c commit 7ab36de

File tree

4 files changed

+97
-9
lines changed

4 files changed

+97
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
V 0.5.1
2+
Date: 2022年3月31日 19:39:49
3+
[feat]支持切换主题
4+
[fix]修复对讲结束问题问题
5+
[feat]移动端主题支持隐藏回放时间轴

demos/base-demo/ezuikit.js

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26170,6 +26170,44 @@ class Theme {
2617026170
this.renderThemeData();
2617126171
});
2617226172
}
26173+
changeTheme(options) {
26174+
if(typeof options === 'string') {
26175+
switch (this.jSPlugin.themeId) {
26176+
case 'pcLive':
26177+
this.themeData = pcLiveData.data;
26178+
this.initThemeData();
26179+
this.renderThemeData();
26180+
break;
26181+
case 'pcRec':
26182+
this.themeData = pcRecData.data;
26183+
this.initThemeData();
26184+
this.renderThemeData();
26185+
break;
26186+
case 'mobileLive':
26187+
this.themeData = mobileLiveData.data;
26188+
this.initThemeData();
26189+
this.renderThemeData();
26190+
break;
26191+
case 'mobileRec':
26192+
this.themeData = mobileRecData.data;
26193+
this.initThemeData();
26194+
this.renderThemeData();
26195+
break;
26196+
case 'themeData':
26197+
this.themeData = this.jSPlugin.params.themeData;
26198+
this.initThemeData();
26199+
this.renderThemeData();
26200+
break;
26201+
default:
26202+
this.fetchThemeData(options);
26203+
break;
26204+
}
26205+
} else if (typeof options === 'object') {
26206+
this.themeData = options;
26207+
this.initThemeData();
26208+
this.renderThemeData();
26209+
}
26210+
}
2617326211
renderThemeData() {
2617426212
const { header, footer } = this.themeData;
2617526213
if (this.isNeedRenderHeader && header) {
@@ -26890,10 +26928,10 @@ class Theme {
2689026928
this.header = defaultTheme.header;
2689126929
this.footer = defaultTheme.footer;
2689226930
this.isNeedRenderHeader = lodash.findIndex(header.btnList, (v)=>{
26893-
return v.isrender === 1;
26931+
return v.isrender > 0;
2689426932
}) >= 0;
2689526933
this.isNeedRenderFooter = lodash.findIndex(footer.btnList, (v)=>{
26896-
return v.isrender === 1;
26934+
return v.isrender > 0;
2689726935
}) >= 0;
2689826936
if (this.isNeedRenderHeader) {
2689926937
if (!document.getElementById(`${this.jSPlugin.id}-headControl`)) {
@@ -26972,9 +27010,9 @@ class Theme {
2697227010
}
2697327011
});
2697427012
}
26975-
var isNeedRenderTimeLine = lodash.findIndex(this.themeData.header.btnList, (v)=>{
27013+
var isNeedRenderTimeLine = (lodash.findIndex(this.themeData.header.btnList, (v)=>{
2697627014
return (v.iconId === 'cloudRec' && v.isrender === 1) || (v.iconId === 'rec' && v.isrender === 1) ;
26977-
}) >= 0 || (this.isMobile &&matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1);
27015+
}) >= 0 || (this.isMobile && matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1)) && !this.jSPlugin.disabledTimeLine;
2697827016
if (isNeedRenderTimeLine) {
2697927017
if (this.isMobile) {
2698027018
this.Rec = new MobileRec(this.jSPlugin);
@@ -29356,6 +29394,7 @@ class EZUIKitPlayer {
2935629394
this.audio = true;
2935729395
this.poster = params.poster;
2935829396
this.speed = 1;
29397+
this.disabledTimeLine = false;
2935929398
this.env = {
2936029399
domain: "https://open.ys7.com"
2936129400
};
@@ -29366,6 +29405,9 @@ class EZUIKitPlayer {
2936629405
if (typeof params.audio !== 'undefined') {
2936729406
this.audio = params.audio;
2936829407
}
29408+
if (typeof params.disabledTimeLine !== 'undefined') {
29409+
this.disabledTimeLine = params.disabledTimeLine;
29410+
}
2936929411
addJs(`${this.staticPath}/js/jsPlugin-4.0.2.min.js`, () => {
2937029412
if (autoplay) {
2937129413
this.initTime = new Date().getTime();

demos/base-demo/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ <h2>视频模式使用示例:</h2>
4141
url: 'ezopen://open.ys7.com/G39444019/1.live',
4242
template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
4343
plugin: ['talk'], // 加载插件,talk-对讲
44-
footer: ['hd'],
4544
width: 600,
4645
height: 400,
4746
});

ezuikit.js

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26170,6 +26170,44 @@ class Theme {
2617026170
this.renderThemeData();
2617126171
});
2617226172
}
26173+
changeTheme(options) {
26174+
if(typeof options === 'string') {
26175+
switch (this.jSPlugin.themeId) {
26176+
case 'pcLive':
26177+
this.themeData = pcLiveData.data;
26178+
this.initThemeData();
26179+
this.renderThemeData();
26180+
break;
26181+
case 'pcRec':
26182+
this.themeData = pcRecData.data;
26183+
this.initThemeData();
26184+
this.renderThemeData();
26185+
break;
26186+
case 'mobileLive':
26187+
this.themeData = mobileLiveData.data;
26188+
this.initThemeData();
26189+
this.renderThemeData();
26190+
break;
26191+
case 'mobileRec':
26192+
this.themeData = mobileRecData.data;
26193+
this.initThemeData();
26194+
this.renderThemeData();
26195+
break;
26196+
case 'themeData':
26197+
this.themeData = this.jSPlugin.params.themeData;
26198+
this.initThemeData();
26199+
this.renderThemeData();
26200+
break;
26201+
default:
26202+
this.fetchThemeData(options);
26203+
break;
26204+
}
26205+
} else if (typeof options === 'object') {
26206+
this.themeData = options;
26207+
this.initThemeData();
26208+
this.renderThemeData();
26209+
}
26210+
}
2617326211
renderThemeData() {
2617426212
const { header, footer } = this.themeData;
2617526213
if (this.isNeedRenderHeader && header) {
@@ -26890,10 +26928,10 @@ class Theme {
2689026928
this.header = defaultTheme.header;
2689126929
this.footer = defaultTheme.footer;
2689226930
this.isNeedRenderHeader = lodash.findIndex(header.btnList, (v)=>{
26893-
return v.isrender === 1;
26931+
return v.isrender > 0;
2689426932
}) >= 0;
2689526933
this.isNeedRenderFooter = lodash.findIndex(footer.btnList, (v)=>{
26896-
return v.isrender === 1;
26934+
return v.isrender > 0;
2689726935
}) >= 0;
2689826936
if (this.isNeedRenderHeader) {
2689926937
if (!document.getElementById(`${this.jSPlugin.id}-headControl`)) {
@@ -26972,9 +27010,9 @@ class Theme {
2697227010
}
2697327011
});
2697427012
}
26975-
var isNeedRenderTimeLine = lodash.findIndex(this.themeData.header.btnList, (v)=>{
27013+
var isNeedRenderTimeLine = (lodash.findIndex(this.themeData.header.btnList, (v)=>{
2697627014
return (v.iconId === 'cloudRec' && v.isrender === 1) || (v.iconId === 'rec' && v.isrender === 1) ;
26977-
}) >= 0 || (this.isMobile &&matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1);
27015+
}) >= 0 || (this.isMobile && matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1)) && !this.jSPlugin.disabledTimeLine;
2697827016
if (isNeedRenderTimeLine) {
2697927017
if (this.isMobile) {
2698027018
this.Rec = new MobileRec(this.jSPlugin);
@@ -29356,6 +29394,7 @@ class EZUIKitPlayer {
2935629394
this.audio = true;
2935729395
this.poster = params.poster;
2935829396
this.speed = 1;
29397+
this.disabledTimeLine = false;
2935929398
this.env = {
2936029399
domain: "https://open.ys7.com"
2936129400
};
@@ -29366,6 +29405,9 @@ class EZUIKitPlayer {
2936629405
if (typeof params.audio !== 'undefined') {
2936729406
this.audio = params.audio;
2936829407
}
29408+
if (typeof params.disabledTimeLine !== 'undefined') {
29409+
this.disabledTimeLine = params.disabledTimeLine;
29410+
}
2936929411
addJs(`${this.staticPath}/js/jsPlugin-4.0.2.min.js`, () => {
2937029412
if (autoplay) {
2937129413
this.initTime = new Date().getTime();

0 commit comments

Comments
 (0)