ezuikit-js 0.5.8 → 0.5.9
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.
- package/CHANGELOG.md +6 -0
- package/demos/base-demo/ezuikit.js +64 -4
- package/ezuikit.js +64 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -31878,6 +31878,12 @@ var matchTemplate = function matchTemplate(templateName, params) {
|
|
|
31878
31878
|
}
|
|
31879
31879
|
};
|
|
31880
31880
|
|
|
31881
|
+
var isVersion2Available = function isVersion2Available() {
|
|
31882
|
+
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
31883
|
+
var isSharedArrayBuffer = window.SharedArrayBuffer;
|
|
31884
|
+
return isSharedArrayBuffer && !isMobile;
|
|
31885
|
+
};
|
|
31886
|
+
|
|
31881
31887
|
var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
31882
31888
|
function EZUIKitPlayer(params) {
|
|
31883
31889
|
var _this = this;
|
|
@@ -31912,11 +31918,13 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
31912
31918
|
this.poster = params.poster;
|
|
31913
31919
|
this.speed = 1;
|
|
31914
31920
|
this.disabledTimeLine = false;
|
|
31921
|
+
this.disabledPTZ = false;
|
|
31922
|
+
this.enableSharedArrayBufferGuide = false;
|
|
31915
31923
|
this.capacity = {};
|
|
31916
31924
|
this.env = {
|
|
31917
31925
|
domain: "https://open.ys7.com"
|
|
31918
31926
|
};
|
|
31919
|
-
this.staticPath =
|
|
31927
|
+
this.staticPath = isVersion2Available() ? "https://open.ys7.com/assets/ezuikit_v5.0" : "https://open.ys7.com/assets/ezuikit_v4.0";
|
|
31920
31928
|
|
|
31921
31929
|
if (typeof params.staticPath === 'string') {
|
|
31922
31930
|
this.staticPath = params.staticPath;
|
|
@@ -31930,11 +31938,63 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
31930
31938
|
this.disabledTimeLine = params.disabledTimeLine;
|
|
31931
31939
|
}
|
|
31932
31940
|
|
|
31941
|
+
if (typeof params.disabledPTZ !== 'undefined') {
|
|
31942
|
+
this.disabledPTZ = params.disabledPTZ;
|
|
31943
|
+
}
|
|
31944
|
+
|
|
31945
|
+
if (typeof params.enableSharedArrayBufferGuide !== 'undefined') {
|
|
31946
|
+
this.enableSharedArrayBufferGuide = params.enableSharedArrayBufferGuide;
|
|
31947
|
+
}
|
|
31948
|
+
|
|
31933
31949
|
var pluginUrl = "".concat(this.staticPath, "/js/jsPlugin-4.0.2.min.js");
|
|
31934
31950
|
|
|
31935
|
-
if (
|
|
31951
|
+
if (isVersion2Available()) {
|
|
31936
31952
|
console.log("启用多线程解析视频");
|
|
31937
31953
|
pluginUrl = "".concat(this.staticPath, "/jsPlugin-2.0.0.min.js");
|
|
31954
|
+
} else {
|
|
31955
|
+
// 是否引导用户开启谷歌实验室 Google Labs 特性
|
|
31956
|
+
//enableSharedArrayBufferGuide
|
|
31957
|
+
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
31958
|
+
|
|
31959
|
+
var getChromeVersion = function getChromeVersion() {
|
|
31960
|
+
var arr = navigator.userAgent.split(' ');
|
|
31961
|
+
var chromeVersion = '';
|
|
31962
|
+
|
|
31963
|
+
for (var i = 0; i < arr.length; i++) {
|
|
31964
|
+
if (/chrome/i.test(arr[i])) {
|
|
31965
|
+
chromeVersion = arr[i];
|
|
31966
|
+
}
|
|
31967
|
+
}
|
|
31968
|
+
|
|
31969
|
+
if (chromeVersion) {
|
|
31970
|
+
return Number(chromeVersion.split('/')[1].split('.')[0]);
|
|
31971
|
+
}
|
|
31972
|
+
|
|
31973
|
+
return false;
|
|
31974
|
+
}; // pc端 谷歌浏览器 版本92 ~ 105
|
|
31975
|
+
|
|
31976
|
+
|
|
31977
|
+
if (!isMobile && 91 < getChromeVersion < 106 && this.enableSharedArrayBufferGuide) {
|
|
31978
|
+
console.log("提示用户开启谷歌实验室特性");
|
|
31979
|
+
var wapDomId = "".concat(this.id, "-wrap");
|
|
31980
|
+
var guideDom = document.createElement("div");
|
|
31981
|
+
var guideSpan = document.createElement("span");
|
|
31982
|
+
guideSpan.innerHTML = "您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见";
|
|
31983
|
+
guideDom.appendChild(guideSpan);
|
|
31984
|
+
var guideLink = document.createElement("a");
|
|
31985
|
+
guideLink.href = "https://open.ys7.com/help/384";
|
|
31986
|
+
guideLink.setAttribute("target", "_blank");
|
|
31987
|
+
guideDom.appendChild(guideLink);
|
|
31988
|
+
guideLink.innerHTML = "开启说明"; //guideDom.innerHTML = "您的浏览器当前使用单进程播放视频,可能因内存占用过高导致浏览器卡顿,您可参考·谷歌浏览器开启多线程(链接)·开启谷歌实验室多线程特性,获取更好播放体验";
|
|
31989
|
+
|
|
31990
|
+
guideDom.id = "".concat(this.id, "-guide");
|
|
31991
|
+
guideDom.style = "font-size:12px;color:red;";
|
|
31992
|
+
setTimeout(function () {
|
|
31993
|
+
if (document.getElementById(wapDomId)) {
|
|
31994
|
+
document.getElementById(wapDomId).insertBefore(guideDom, document.getElementById(_this.id));
|
|
31995
|
+
}
|
|
31996
|
+
}, 5000);
|
|
31997
|
+
}
|
|
31938
31998
|
}
|
|
31939
31999
|
|
|
31940
32000
|
addJs(pluginUrl, function () {
|
|
@@ -33172,9 +33232,9 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
33172
33232
|
var end = defaultTime.length;
|
|
33173
33233
|
var standardTime = time + defaultTime.substring(start, end);
|
|
33174
33234
|
return standardTime.slice(0, 8) + 'T' + standardTime.slice(8) + 'Z';
|
|
33175
|
-
} else {
|
|
33176
|
-
throw new Error('回放时间格式有误,请确认');
|
|
33177
33235
|
}
|
|
33236
|
+
|
|
33237
|
+
throw new Error('回放时间格式有误,请确认');
|
|
33178
33238
|
}
|
|
33179
33239
|
|
|
33180
33240
|
var seekRT = this.jSPlugin.JS_Seek(0, startTime, endTime);
|
package/ezuikit.js
CHANGED
|
@@ -31878,6 +31878,12 @@ var matchTemplate = function matchTemplate(templateName, params) {
|
|
|
31878
31878
|
}
|
|
31879
31879
|
};
|
|
31880
31880
|
|
|
31881
|
+
var isVersion2Available = function isVersion2Available() {
|
|
31882
|
+
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
31883
|
+
var isSharedArrayBuffer = window.SharedArrayBuffer;
|
|
31884
|
+
return isSharedArrayBuffer && !isMobile;
|
|
31885
|
+
};
|
|
31886
|
+
|
|
31881
31887
|
var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
31882
31888
|
function EZUIKitPlayer(params) {
|
|
31883
31889
|
var _this = this;
|
|
@@ -31912,11 +31918,13 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
31912
31918
|
this.poster = params.poster;
|
|
31913
31919
|
this.speed = 1;
|
|
31914
31920
|
this.disabledTimeLine = false;
|
|
31921
|
+
this.disabledPTZ = false;
|
|
31922
|
+
this.enableSharedArrayBufferGuide = false;
|
|
31915
31923
|
this.capacity = {};
|
|
31916
31924
|
this.env = {
|
|
31917
31925
|
domain: "https://open.ys7.com"
|
|
31918
31926
|
};
|
|
31919
|
-
this.staticPath =
|
|
31927
|
+
this.staticPath = isVersion2Available() ? "https://open.ys7.com/assets/ezuikit_v5.0" : "https://open.ys7.com/assets/ezuikit_v4.0";
|
|
31920
31928
|
|
|
31921
31929
|
if (typeof params.staticPath === 'string') {
|
|
31922
31930
|
this.staticPath = params.staticPath;
|
|
@@ -31930,11 +31938,63 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
31930
31938
|
this.disabledTimeLine = params.disabledTimeLine;
|
|
31931
31939
|
}
|
|
31932
31940
|
|
|
31941
|
+
if (typeof params.disabledPTZ !== 'undefined') {
|
|
31942
|
+
this.disabledPTZ = params.disabledPTZ;
|
|
31943
|
+
}
|
|
31944
|
+
|
|
31945
|
+
if (typeof params.enableSharedArrayBufferGuide !== 'undefined') {
|
|
31946
|
+
this.enableSharedArrayBufferGuide = params.enableSharedArrayBufferGuide;
|
|
31947
|
+
}
|
|
31948
|
+
|
|
31933
31949
|
var pluginUrl = "".concat(this.staticPath, "/js/jsPlugin-4.0.2.min.js");
|
|
31934
31950
|
|
|
31935
|
-
if (
|
|
31951
|
+
if (isVersion2Available()) {
|
|
31936
31952
|
console.log("启用多线程解析视频");
|
|
31937
31953
|
pluginUrl = "".concat(this.staticPath, "/jsPlugin-2.0.0.min.js");
|
|
31954
|
+
} else {
|
|
31955
|
+
// 是否引导用户开启谷歌实验室 Google Labs 特性
|
|
31956
|
+
//enableSharedArrayBufferGuide
|
|
31957
|
+
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
31958
|
+
|
|
31959
|
+
var getChromeVersion = function getChromeVersion() {
|
|
31960
|
+
var arr = navigator.userAgent.split(' ');
|
|
31961
|
+
var chromeVersion = '';
|
|
31962
|
+
|
|
31963
|
+
for (var i = 0; i < arr.length; i++) {
|
|
31964
|
+
if (/chrome/i.test(arr[i])) {
|
|
31965
|
+
chromeVersion = arr[i];
|
|
31966
|
+
}
|
|
31967
|
+
}
|
|
31968
|
+
|
|
31969
|
+
if (chromeVersion) {
|
|
31970
|
+
return Number(chromeVersion.split('/')[1].split('.')[0]);
|
|
31971
|
+
}
|
|
31972
|
+
|
|
31973
|
+
return false;
|
|
31974
|
+
}; // pc端 谷歌浏览器 版本92 ~ 105
|
|
31975
|
+
|
|
31976
|
+
|
|
31977
|
+
if (!isMobile && 91 < getChromeVersion < 106 && this.enableSharedArrayBufferGuide) {
|
|
31978
|
+
console.log("提示用户开启谷歌实验室特性");
|
|
31979
|
+
var wapDomId = "".concat(this.id, "-wrap");
|
|
31980
|
+
var guideDom = document.createElement("div");
|
|
31981
|
+
var guideSpan = document.createElement("span");
|
|
31982
|
+
guideSpan.innerHTML = "您当前浏览器可以开启谷歌实验室多线程特性,获取更好播放体验,避免浏览器卡顿及崩溃,详见";
|
|
31983
|
+
guideDom.appendChild(guideSpan);
|
|
31984
|
+
var guideLink = document.createElement("a");
|
|
31985
|
+
guideLink.href = "https://open.ys7.com/help/384";
|
|
31986
|
+
guideLink.setAttribute("target", "_blank");
|
|
31987
|
+
guideDom.appendChild(guideLink);
|
|
31988
|
+
guideLink.innerHTML = "开启说明"; //guideDom.innerHTML = "您的浏览器当前使用单进程播放视频,可能因内存占用过高导致浏览器卡顿,您可参考·谷歌浏览器开启多线程(链接)·开启谷歌实验室多线程特性,获取更好播放体验";
|
|
31989
|
+
|
|
31990
|
+
guideDom.id = "".concat(this.id, "-guide");
|
|
31991
|
+
guideDom.style = "font-size:12px;color:red;";
|
|
31992
|
+
setTimeout(function () {
|
|
31993
|
+
if (document.getElementById(wapDomId)) {
|
|
31994
|
+
document.getElementById(wapDomId).insertBefore(guideDom, document.getElementById(_this.id));
|
|
31995
|
+
}
|
|
31996
|
+
}, 5000);
|
|
31997
|
+
}
|
|
31938
31998
|
}
|
|
31939
31999
|
|
|
31940
32000
|
addJs(pluginUrl, function () {
|
|
@@ -33172,9 +33232,9 @@ var EZUIKitPlayer = /*#__PURE__*/function () {
|
|
|
33172
33232
|
var end = defaultTime.length;
|
|
33173
33233
|
var standardTime = time + defaultTime.substring(start, end);
|
|
33174
33234
|
return standardTime.slice(0, 8) + 'T' + standardTime.slice(8) + 'Z';
|
|
33175
|
-
} else {
|
|
33176
|
-
throw new Error('回放时间格式有误,请确认');
|
|
33177
33235
|
}
|
|
33236
|
+
|
|
33237
|
+
throw new Error('回放时间格式有误,请确认');
|
|
33178
33238
|
}
|
|
33179
33239
|
|
|
33180
33240
|
var seekRT = this.jSPlugin.JS_Seek(0, startTime, endTime);
|