ezuikit-js 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@
7
7
  "@testing-library/react": "^9.5.0",
8
8
  "@testing-library/user-event": "^7.2.1",
9
9
  "axios": "^0.19.2",
10
+ "ezuikit-js": "^0.5.2",
10
11
  "react": "^16.13.1",
11
12
  "react-dom": "^16.13.1",
12
13
  "react-scripts": "3.4.1"
@@ -10,26 +10,20 @@ class App extends React.Component{
10
10
  this.playr = null; //定义播放器
11
11
  }
12
12
  componentDidMount(){
13
- this.playr = new EZUIKit.EZUIKitPlayer({
14
- id: 'video-container', // 视频容器ID
15
- accessToken: 'at.9ymd5rys4lk1zv6o2rtr51a624s9gl56-5fitodjuss-0tkvm8j-hras1ewfu',
16
- url: 'ezopen://open.ys7.com/203751922/1.live',
17
- template: 'security', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版;
18
- // 视频上方头部控件
19
- // header: ['capturePicture','save','zoom'], // 如果templete参数不为simple,该字段将被覆盖
20
- // // 视频下方底部控件
21
- // footer: ['talk','broadcast','hd','fullScreen'], // 如果template参数不为simple,该字段将被覆盖
22
- audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启
23
- openSoundCallBack: (data) => console.log("开启声音回调",data),
24
- closeSoundCallBack: (data) => console.log("关闭声音回调",data),
25
- startSaveCallBack: (data) => console.log("开始录像回调",data),
26
- stopSaveCallBack: (data) => console.log("录像回调",data),
27
- capturePictureCallBack: (data) => console.log("截图成功回调",data),
28
- fullScreenCallBack: (data) => console.log("全屏回调",data),
29
- getOSDTimeCallBack: (data) => console.log("获取OSDTime回调",data),
30
- width:600,
31
- height:400,
32
- })
13
+ fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
14
+ .then(response => response.json())
15
+ .then(res => {
16
+ var accessToken = res.data.accessToken;
17
+ this.player = new EZUIKit.EZUIKitPlayer({
18
+ id: 'video-container', // 视频容器ID
19
+ accessToken: accessToken,
20
+ url: 'ezopen://open.ys7.com/G39444019/1.live',
21
+ template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
22
+ plugin: ['talk'], // 加载插件,talk-对讲
23
+ width: 600,
24
+ height: 400,
25
+ });
26
+ });
33
27
  }
34
28
  render(){
35
29
  return(
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "core-js": "^3.6.4",
12
- "ezuikit-js": "0.1.7",
12
+ "ezuikit-js": "^0.5.2",
13
13
  "vue": "^2.6.11"
14
14
  },
15
15
  "devDependencies": {
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div class="hello-ezuikit-js">
3
- <div id="video-container" style="width:600px;height:600px"></div>
4
- <button @click="change">按钮</button>
3
+ <div id="video-container" style="width:600px;height:400px"></div>
5
4
  </div>
6
5
  </template>
7
6
 
@@ -21,32 +20,20 @@ export default {
21
20
  },
22
21
  mounted: () => {
23
22
  console.group("mounted 组件挂载完毕状态===============》");
24
- player = new EZUIKit.EZUIKitPlayer({
25
- autoplay: true,
26
- id: "video-container",
27
- accessToken:"at.ciwomi1k3lklzen416tqflyu4fm7cqvc-32g97d9qk2-15iad60-l2vw2olyd",
28
- url: "ezopen://open.ys7.com/244640009/1.rec",
29
- template: "simple", // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版;
30
- // 视频上方头部控件
31
- //header: ["capturePicture", "save", "zoom"], // 如果templete参数不为simple,该字段将被覆盖
32
- //plugin: ['talk'], // 加载插件,talk-对讲
33
- // 视频下方底部控件
34
- // footer: ["talk", "broadcast", "hd", "fullScreen"], // 如果template参数不为simple,该字段将被覆盖
35
- // audio: 1, // 是否默认开启声音 0 - 关闭 1 - 开启
36
- // openSoundCallBack: data => console.log("开启声音回调", data),
37
- // closeSoundCallBack: data => console.log("关闭声音回调", data),
38
- // startSaveCallBack: data => console.log("开始录像回调", data),
39
- // stopSaveCallBack: data => console.log("录像回调", data),
40
- // capturePictureCallBack: data => console.log("截图成功回调", data),
41
- // fullScreenCallBack: data => console.log("全屏回调", data),
42
- // getOSDTimeCallBack: data => console.log("获取OSDTime回调", data),
43
- width: 600,
44
- height: 400
45
- });
46
- // console.log("player",player);
47
- // setTimeout(()=>{
48
- // player.stop(); // 方法调用示例,10秒后关闭视频
49
- // },10000)
23
+ fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
24
+ .then(response => response.json())
25
+ .then(res => {
26
+ var accessToken = res.data.accessToken;
27
+ player = new EZUIKit.EZUIKitPlayer({
28
+ id: 'video-container', // 视频容器ID
29
+ accessToken: accessToken,
30
+ url: 'ezopen://open.ys7.com/G39444019/1.live',
31
+ template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
32
+ plugin: ['talk'], // 加载插件,talk-对讲
33
+ width: 600,
34
+ height: 400,
35
+ });
36
+ });
50
37
  },
51
38
  methods: {
52
39
  change() {
package/ezuikit.js CHANGED
@@ -25448,6 +25448,7 @@ class MobilePtz {
25448
25448
  mobileContainer.style = `display:inline-block;width: ${this.jSPlugin.width}px;text-align:center;`;
25449
25449
  var mobileContainerTitle = document.createElement('div');
25450
25450
  mobileContainerTitle.className = "live-ptz-title";
25451
+ mobileContainerTitle.id = "live-ptz-title";
25451
25452
  mobileContainerTitle.innerHTML = "云台控制";
25452
25453
  const ptzWrap = document.createElement('div');
25453
25454
  ptzWrap.id = "mobile-ez-ptz-item";
@@ -26134,14 +26135,6 @@ class Theme {
26134
26135
  if (!this.jSPlugin.Talk) {
26135
26136
  this.jSPlugin.Talk = new Talk(this.jSPlugin);
26136
26137
  }
26137
- if (matchEzopenUrl(jSPlugin.url).type === 'live') {
26138
- if (this.isMobile) {
26139
- this.MobilePtz = new MobilePtz(jSPlugin);
26140
- this.Ptz = new Ptz(jSPlugin);
26141
- } else {
26142
- this.Ptz = new Ptz(jSPlugin);
26143
- }
26144
- }
26145
26138
  }
26146
26139
  fetchThemeData(themeId) {
26147
26140
  const url = `${this.jSPlugin.env.domain}/jssdk/ezopen/template/getDetail?accessToken=${this.jSPlugin.accessToken}&id=${themeId}`;
@@ -26172,6 +26165,7 @@ class Theme {
26172
26165
  }
26173
26166
  changeTheme(options) {
26174
26167
  if(typeof options === 'string') {
26168
+ this.jSPlugin.themeId = options;
26175
26169
  switch (this.jSPlugin.themeId) {
26176
26170
  case 'pcLive':
26177
26171
  this.themeData = pcLiveData.data;
@@ -26933,6 +26927,11 @@ class Theme {
26933
26927
  this.isNeedRenderFooter = lodash.findIndex(footer.btnList, (v)=>{
26934
26928
  return v.isrender > 0;
26935
26929
  }) >= 0;
26930
+ ["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((item,index)=> {
26931
+ if(document.getElementById(item)) {
26932
+ document.getElementById(item).parentElement.removeChild(document.getElementById(item));
26933
+ }
26934
+ });
26936
26935
  if (this.isNeedRenderHeader) {
26937
26936
  if (!document.getElementById(`${this.jSPlugin.id}-headControl`)) {
26938
26937
  const headerContainer = document.createElement('div');
@@ -27020,6 +27019,15 @@ class Theme {
27020
27019
  this.Rec = new Rec(this.jSPlugin);
27021
27020
  }
27022
27021
  }
27022
+ var isNeedRenderPTZ = (lodash.findIndex(this.themeData.header.btnList, (v)=>{
27023
+ return (v.iconId === 'pantile' && v.isrender === 1);
27024
+ }) >= 0 || (this.isMobile && matchEzopenUrl(this.jSPlugin.url).type.indexOf('live') !== -1)) && !this.jSPlugin.disabledPTZ;
27025
+ if (isNeedRenderPTZ) {
27026
+ this.MobilePtz = new MobilePtz(this.jSPlugin);
27027
+ this.Ptz = new Ptz(this.jSPlugin);
27028
+ } else {
27029
+ this.Ptz = new Ptz(this.jSPlugin);
27030
+ }
27023
27031
  // 监听全屏事件触发
27024
27032
  const fullscreenchange = () => {
27025
27033
  const { expend, webExpend } = this.decoderState.state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezuikit-js",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "ezuikit javascript for npm",
5
5
  "main": "ezuikit.js",
6
6
  "scripts": {