ezuikit-js 0.4.1 → 0.4.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.
Files changed (2) hide show
  1. package/ezuikit.js +52 -11
  2. package/package.json +1 -1
package/ezuikit.js CHANGED
@@ -23789,6 +23789,9 @@ var TimeLine$1 = function (jsPlugin) {
23789
23789
  class Rec {
23790
23790
  constructor(jSPlugin) {
23791
23791
  this.jSPlugin = jSPlugin;
23792
+ if(!document.getElementById(`${this.jSPlugin.id}-audioControls`)) {
23793
+ return false;
23794
+ }
23792
23795
  this.currentTimeWidth = 1; //回放时间轴尺度 1~4
23793
23796
  this.timer = null;
23794
23797
  this.date = new Date();
@@ -23909,10 +23912,10 @@ C11.4,16.3,11,16.6,10.6,16.6z" />
23909
23912
  });
23910
23913
  this.syncTimeLine();
23911
23914
  // 加载日期选择器
23912
- addCss("https://open.ys7.com/assets/ezuikit_theme/css/datepicker.min.css");
23913
- addJs("https://open.ys7.com/assets/ezuikit_v2.6.4/js/jquery.min.js", () => {
23914
- addJs("https://open.ys7.com/assets/ezuikit_theme/js/datepicker.js", () => {
23915
- addJs("https://open.ys7.com/assets/ezuikit_theme/js/datepicker.zh-CN.js", () => {
23915
+ addCss(`${this.jSPlugin.staticPath}/rec/datepicker.min.css`);
23916
+ addJs(`${this.jSPlugin.staticPath}/rec/jquery.min.js`, () => {
23917
+ addJs(`${this.jSPlugin.staticPath}/rec/datepicker.js`, () => {
23918
+ addJs(`${this.jSPlugin.staticPath}/rec/datepicker.zh-CN.js`, () => {
23916
23919
  // 日期选择:
23917
23920
  $(`#${this.jSPlugin.id}-datepicker`).datepicker({
23918
23921
  autoShow: false,
@@ -25216,9 +25219,9 @@ class Talk {
25216
25219
  audioRightDOM.setAttribute("controls", true);
25217
25220
  audioRight.appendChild(audioRightDOM);
25218
25221
 
25219
- addJs("https://open.ys7.com/assets/ezuikit_v2.6.4/npm/js/adapeter.js", () => {
25220
- addJs("https://open.ys7.com/assets/ezuikit_v2.6.4/npm/js/janus.js", () => {
25221
- addJs("https://open.ys7.com/assets/ezuikit_v4.0/js/tts-v4.js", () => {
25222
+ addJs(`${this.jSPlugin.staticPath}/talk/adapeter.js`, () => {
25223
+ addJs(`${this.jSPlugin.staticPath}/talk/janus.js`, () => {
25224
+ addJs(`${this.jSPlugin.staticPath}/talk/tts-v4.js`, () => {
25222
25225
  // 临时处理
25223
25226
  window.EZUIKit["handleTalkError"] = {
25224
25227
  handleTalkError: (err)=>{
@@ -28639,9 +28642,13 @@ class EZUIKitPlayer {
28639
28642
  this.themeId = matchTemplate(params.template, params).templateId;
28640
28643
  this.id = params.id;
28641
28644
  this.audio = params.audio;
28642
- addJs("https://open.ys7.com/assets/ezuikit_v4.0/js/AudioRenderer.js", () => {
28643
- addJs("https://open.ys7.com/assets/ezuikit_v4.0/js/SuperRender_10.js", () => {
28644
- addJs("https://open.ys7.com/assets/ezuikit_v4.0/js/jsPlugin-4.0.1.min.js", () => {
28645
+ this.staticPath = "https://open.ys7.com/assets/ezuikit_v4.0";
28646
+ if(typeof params.staticPath === 'string') {
28647
+ this.staticPath = params.staticPath;
28648
+ }
28649
+ addJs(`${this.staticPath}/js/AudioRenderer.js`, () => {
28650
+ addJs(`${this.staticPath}/js/SuperRender_10.js`, () => {
28651
+ addJs(`${this.staticPath}/js/jsPlugin-4.0.2.min.js`, () => {
28645
28652
  var initEZUIKitPlayerPromise = this.initEZUIKitPlayer(params);
28646
28653
  initEZUIKitPlayerPromise.then((data) => {
28647
28654
  console.log("初始化成功", data);
@@ -28685,6 +28692,7 @@ class EZUIKitPlayer {
28685
28692
  iMaxSplit: 1,
28686
28693
  iCurrentSplit: 1,
28687
28694
  szBasePath: "",
28695
+ staticPath: params.staticPath,
28688
28696
  oStyle: {
28689
28697
  border: "none",
28690
28698
  background: "#000000"
@@ -29075,6 +29083,9 @@ class EZUIKitPlayer {
29075
29083
  };
29076
29084
  }
29077
29085
  var wsUrl = getPlayParams(data).websocketConnectUrl;
29086
+ if(this.env && this.env.wsUrl) {
29087
+ wsUrl = this.env.wsUrl;
29088
+ }
29078
29089
  var wsParams = {
29079
29090
  playURL: getPlayParams(data).websocketStreamingParam
29080
29091
  };
@@ -29250,7 +29261,7 @@ class EZUIKitPlayer {
29250
29261
  return promise;
29251
29262
  }
29252
29263
  capturePicture(name, callback = false) {
29253
- var capturePictureRT = this.jSPlugin.JS_CapturePicture(0, name, "JPEG", callback);
29264
+ var capturePictureRT = this.jSPlugin.JS_CapturePicture(0, name, "JPEG", callback, !!callback);
29254
29265
  if (isPromise(capturePictureRT)) {
29255
29266
  return capturePictureRT;
29256
29267
  }
@@ -29331,6 +29342,36 @@ class EZUIKitPlayer {
29331
29342
  document.getElementById(`${this.id}-wrap`).style = `width:${width}px;position:relative;`;
29332
29343
  this.jSPlugin.JS_Resize(width, height);
29333
29344
  }
29345
+ fast() {
29346
+ var fastRT = this.jSPlugin.JS_Fast(0);
29347
+ console.log("JS_Fast", fastRT);
29348
+ if (isPromise(fastRT)) {
29349
+ return fastRT;
29350
+ }
29351
+ return new Promise(function (resolve) {
29352
+ resolve(fastRT);
29353
+ });
29354
+ }
29355
+ slow() {
29356
+ var slowRT = this.jSPlugin.JS_Slow(0);
29357
+ console.log("slowRT", slowRT);
29358
+ if (isPromise(slowRT)) {
29359
+ return slowRT;
29360
+ }
29361
+ return new Promise(function (resolve) {
29362
+ resolve(slowRT);
29363
+ });
29364
+ }
29365
+ seek(startTime, endTime) {
29366
+ var seekRT = this.jSPlugin.JS_Seek(0,startTime, endTime);
29367
+ console.log("seekRT", seekRT);
29368
+ if (isPromise(seekRT)) {
29369
+ return seekRT;
29370
+ }
29371
+ return new Promise(function (resolve) {
29372
+ resolve(seekRT);
29373
+ });
29374
+ }
29334
29375
  fullScreen() {
29335
29376
  var promise = requestFullScreenPromise(document.getElementById(`${this.id}`));
29336
29377
  promise.then((data) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezuikit-js",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "ezuikit javascript for npm",
5
5
  "main": "ezuikit.js",
6
6
  "scripts": {