@vtx/player 1.9.10 → 1.10.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.
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +7 -1
- package/lib/api/index.js.map +1 -1
- package/lib/api/types.d.ts +5 -0
- package/lib/bd/PlayerManager.d.ts +1 -0
- package/lib/bd/PlayerManager.js +13 -0
- package/lib/bd/PlayerManager.js.map +1 -1
- package/lib/controls/index.d.ts +3 -4
- package/lib/controls/index.js +2 -1
- package/lib/controls/index.js.map +1 -1
- package/lib/history-control-v2/components/grid-item/index.js +29 -1
- package/lib/history-control-v2/components/grid-item/index.js.map +1 -1
- package/lib/history-control-v2/components/panel/index.js +47 -13
- package/lib/history-control-v2/components/panel/index.js.map +1 -1
- package/lib/history-control-v2/interface.d.ts +2 -0
- package/lib/history-control-v2/utils.d.ts +1 -0
- package/lib/history-control-v2/utils.js +18 -4
- package/lib/history-control-v2/utils.js.map +1 -1
- package/lib/history-player/index.d.ts +4 -2
- package/lib/history-player/index.js +147 -45
- package/lib/history-player/index.js.map +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -7
- package/lib/index.js.map +1 -1
- package/lib/live-channel-player/index.js +3 -3
- package/lib/live-channel-player/index.js.map +1 -1
- package/lib/live-player/index.d.ts +1 -2
- package/lib/live-player/index.js +62 -6
- package/lib/live-player/index.js.map +1 -1
- package/lib/player/BdPlayer.d.ts +110 -0
- package/lib/player/BdPlayer.js +242 -0
- package/lib/player/BdPlayer.js.map +1 -0
- package/lib/player/FlvPlayer.d.ts +112 -0
- package/lib/player/FlvPlayer.js +210 -0
- package/lib/player/FlvPlayer.js.map +1 -0
- package/lib/player/H264Player.d.ts +109 -0
- package/lib/player/H264Player.js +218 -0
- package/lib/player/H264Player.js.map +1 -0
- package/lib/player/HkcarwsPlayer.d.ts +124 -0
- package/lib/player/HkcarwsPlayer.js +390 -0
- package/lib/player/HkcarwsPlayer.js.map +1 -0
- package/lib/player/HkwsPlayer.d.ts +124 -0
- package/lib/player/HkwsPlayer.js +376 -0
- package/lib/player/HkwsPlayer.js.map +1 -0
- package/lib/player/HlsPlayer.d.ts +115 -0
- package/lib/player/HlsPlayer.js +212 -0
- package/lib/player/HlsPlayer.js.map +1 -0
- package/lib/player/IccwsPlayer.d.ts +113 -0
- package/lib/player/IccwsPlayer.js +249 -0
- package/lib/player/IccwsPlayer.js.map +1 -0
- package/lib/player/IframePlayer.d.ts +60 -0
- package/lib/player/IframePlayer.js +45 -0
- package/lib/player/IframePlayer.js.map +1 -0
- package/lib/player/Mp4Player.d.ts +110 -0
- package/lib/player/Mp4Player.js +215 -0
- package/lib/player/Mp4Player.js.map +1 -0
- package/lib/player/RslPlayer.d.ts +112 -0
- package/lib/player/RslPlayer.js +230 -0
- package/lib/player/RslPlayer.js.map +1 -0
- package/lib/player/VtxHlsPlayer.d.ts +116 -0
- package/lib/player/VtxHlsPlayer.js +222 -0
- package/lib/player/VtxHlsPlayer.js.map +1 -0
- package/lib/player/VtxwhepPlayer.d.ts +110 -0
- package/lib/player/VtxwhepPlayer.js +223 -0
- package/lib/player/VtxwhepPlayer.js.map +1 -0
- package/lib/player/VtxwsPlayer.d.ts +114 -0
- package/lib/player/VtxwsPlayer.js +264 -0
- package/lib/player/VtxwsPlayer.js.map +1 -0
- package/lib/player/WebrtcPlayer.d.ts +109 -0
- package/lib/player/WebrtcPlayer.js +219 -0
- package/lib/player/WebrtcPlayer.js.map +1 -0
- package/lib/player/WfsPlayer.d.ts +109 -0
- package/lib/player/WfsPlayer.js +220 -0
- package/lib/player/WfsPlayer.js.map +1 -0
- package/lib/player/index.d.ts +16 -125
- package/lib/player/index.js +103 -836
- package/lib/player/index.js.map +1 -1
- package/lib/player/indexOld.d.ts +127 -0
- package/lib/player/indexOld.js +871 -0
- package/lib/player/indexOld.js.map +1 -0
- package/lib/utils/index.d.ts +7 -2
- package/lib/utils/index.js +24 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/wfs/PlayerManager.d.ts +1 -0
- package/lib/wfs/PlayerManager.js +19 -2
- package/lib/wfs/PlayerManager.js.map +1 -1
- package/package.json +1 -1
package/lib/player/index.js
CHANGED
|
@@ -3,843 +3,110 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
29
|
-
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
30
|
-
function adopt(value) {
|
|
31
|
-
return value instanceof P ? value : new P(function (resolve) {
|
|
32
|
-
resolve(value);
|
|
33
|
-
});
|
|
6
|
+
Object.defineProperty(exports, "BdPlayer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _BdPlayer["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "FlvPlayer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _FlvPlayer["default"];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "H264Player", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _H264Player["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "HkcarwsPlayer", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _HkcarwsPlayer["default"];
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
reject(e);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function rejected(value) {
|
|
44
|
-
try {
|
|
45
|
-
step(generator["throw"](value));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
reject(e);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function step(result) {
|
|
51
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
52
|
-
}
|
|
53
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
57
|
-
/**
|
|
58
|
-
* 视频播放核心类
|
|
59
|
-
*/
|
|
60
|
-
var Player = /*#__PURE__*/function () {
|
|
61
|
-
function Player(params) {
|
|
62
|
-
_classCallCheck(this, Player);
|
|
63
|
-
var _a, _b, _c, _d, _e, _f;
|
|
64
|
-
this.player = null;
|
|
65
|
-
/** 之前的视频播放速度,用于处理海康音量控制 */
|
|
66
|
-
this.preSpeed = 1;
|
|
67
|
-
this.containerId = '';
|
|
68
|
-
// 海康窗口下标
|
|
69
|
-
this.windowIndex = 0;
|
|
70
|
-
/** 视频播放流是否走代理 - 是强制走代理,否通过判断 http协议,走代理配置 */
|
|
71
|
-
var url = params.url,
|
|
72
|
-
channelNum = params.channelNum,
|
|
73
|
-
deviceCode = params.deviceCode,
|
|
74
|
-
_params$enableAgent = params.enableAgent,
|
|
75
|
-
enableAgent = _params$enableAgent === void 0 ? false : _params$enableAgent,
|
|
76
|
-
container = params.container,
|
|
77
|
-
_params$live = params.live,
|
|
78
|
-
live = _params$live === void 0 ? true : _params$live,
|
|
79
|
-
type = params.type,
|
|
80
|
-
startTime = params.startTime,
|
|
81
|
-
endTime = params.endTime,
|
|
82
|
-
streamType = params.streamType,
|
|
83
|
-
deviceIp = params.deviceIp,
|
|
84
|
-
devicePort = params.devicePort,
|
|
85
|
-
reload = params.reload,
|
|
86
|
-
onClose = params.onClose;
|
|
87
|
-
this.reload = reload;
|
|
88
|
-
this.onClose = onClose;
|
|
89
|
-
this.containerId = container.id;
|
|
90
|
-
var playerParams = (0, _utils.getPlayerParams)(type, url, enableAgent, live);
|
|
91
|
-
this.type = type || playerParams.type; // 如果不传递type,则通过url解析type值,1.1.2之后默认都传type
|
|
92
|
-
this.url = playerParams.url;
|
|
93
|
-
this.channelNum = channelNum;
|
|
94
|
-
this.deviceCode = deviceCode || '';
|
|
95
|
-
this.streamType = streamType || '0'; // 默认主码流
|
|
96
|
-
this.enableAgent = enableAgent;
|
|
97
|
-
this.startTime = startTime;
|
|
98
|
-
this.endTime = endTime;
|
|
99
|
-
var video = document.createElement('video'); // 生成video元素
|
|
100
|
-
video.className = 'vtx-player-video';
|
|
101
|
-
video.muted = true; //设置静音
|
|
102
|
-
this.video = video;
|
|
103
|
-
if (this.type === 'flv' && video) {
|
|
104
|
-
container.appendChild(video);
|
|
105
|
-
this.player = new _PlayerManager4["default"]({
|
|
106
|
-
el: this.video,
|
|
107
|
-
url: this.url.replace('SZGJ_HTTPS', "".concat(window.location.host)),
|
|
108
|
-
type: 'flv'
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
// 处理hls格式视频
|
|
112
|
-
if (this.type === 'hls' && _hls["default"].isSupported() && video) {
|
|
113
|
-
container.appendChild(video);
|
|
114
|
-
this.player = new _hls["default"]();
|
|
115
|
-
this.player.loadSource(this.url);
|
|
116
|
-
this.player.attachMedia(this.video);
|
|
117
|
-
}
|
|
118
|
-
if (this.type === 'vtxhls' && _hls["default"].isSupported() && video) {
|
|
119
|
-
var dd = document.getElementById(container.id);
|
|
120
|
-
while (dd === null || dd === void 0 ? void 0 : dd.hasChildNodes()) {
|
|
121
|
-
dd.removeChild(dd.firstChild);
|
|
122
|
-
}
|
|
123
|
-
container.appendChild(video);
|
|
124
|
-
this.player = new _PlayerManager6["default"]({
|
|
125
|
-
url: this.url,
|
|
126
|
-
video: video
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (this.type === 'vtxwhep' && video) {
|
|
130
|
-
var _dd = document.getElementById(container.id);
|
|
131
|
-
while (_dd === null || _dd === void 0 ? void 0 : _dd.hasChildNodes()) {
|
|
132
|
-
_dd.removeChild(_dd.firstChild);
|
|
133
|
-
}
|
|
134
|
-
this.video.autoplay = true;
|
|
135
|
-
container.appendChild(this.video);
|
|
136
|
-
this.player = new _WhepManager["default"]({
|
|
137
|
-
url: this.url,
|
|
138
|
-
video: this.video
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
// 处理海康视频
|
|
142
|
-
if (this.type === 'hk_ws') {
|
|
143
|
-
this.player = new window.JSPlugin({
|
|
144
|
-
szId: container.id,
|
|
145
|
-
szBasePath: "".concat(_config["default"].visPlugin, "/"),
|
|
146
|
-
iMaxSplit: 1,
|
|
147
|
-
iCurrentSplit: 1
|
|
148
|
-
});
|
|
149
|
-
var wrapDiv = document.getElementById(container.id);
|
|
150
|
-
this.video = wrapDiv.getElementsByTagName('video')[0];
|
|
151
|
-
this.video.preload = 'auto';
|
|
152
|
-
}
|
|
153
|
-
// 处理海康视频
|
|
154
|
-
if (this.type === 'hkcar_ws' && (url.startsWith('ws://') || url.startsWith('wss://'))) {
|
|
155
|
-
var _wrapDiv = document.getElementById(container.id);
|
|
156
|
-
this.player = new window.JSPluginHkCar({
|
|
157
|
-
szId: container.id,
|
|
158
|
-
iWidth: _wrapDiv.clientWidth,
|
|
159
|
-
iHeight: _wrapDiv.clientHeight,
|
|
160
|
-
iMaxSplit: 1,
|
|
161
|
-
iCurrentSplit: 1,
|
|
162
|
-
szBasePath: "".concat(_config["default"].visPlugin, "/hkcar/"),
|
|
163
|
-
oStyle: {
|
|
164
|
-
border: 'transparent',
|
|
165
|
-
borderSelect: 'transparent',
|
|
166
|
-
background: '#2b3d51'
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
// 处理ws视频
|
|
171
|
-
if (this.type === 'vtx_ws') {
|
|
172
|
-
var $container = document.getElementById(container.id);
|
|
173
|
-
this.player = new window.Jessibuca({
|
|
174
|
-
container: $container,
|
|
175
|
-
videoBuffer: 3,
|
|
176
|
-
timeout: 10,
|
|
177
|
-
isResize: false,
|
|
178
|
-
isFlv: true,
|
|
179
|
-
decoder: "".concat(_config["default"].visPlugin, "/jessibuca/decoder.js"),
|
|
180
|
-
useMSE: true,
|
|
181
|
-
debug: true,
|
|
182
|
-
hasAudio: false,
|
|
183
|
-
useWCS: false,
|
|
184
|
-
autoWasm: true,
|
|
185
|
-
isNotMute: true //是否开启声音
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
if (this.type === 'icc_ws') {
|
|
189
|
-
var _dd2 = document.getElementById(container.id);
|
|
190
|
-
while (_dd2 === null || _dd2 === void 0 ? void 0 : _dd2.hasChildNodes()) {
|
|
191
|
-
_dd2.removeChild(_dd2.firstChild);
|
|
192
|
-
}
|
|
193
|
-
this.player = new _PlayerManager3["default"]({
|
|
194
|
-
ip: window.location.protocol === 'http:' ? deviceIp : "".concat(deviceIp || '', ":").concat(devicePort || ''),
|
|
195
|
-
el: container.id,
|
|
196
|
-
type: live ? 'real' : 'record',
|
|
197
|
-
maxNum: 1,
|
|
198
|
-
num: 1
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
if (this.type === 'webrtc') {
|
|
202
|
-
var _dd3 = document.getElementById(container.id);
|
|
203
|
-
((_a = _dd3 === null || _dd3 === void 0 ? void 0 : _dd3.children) === null || _a === void 0 ? void 0 : _a.length) > 0 && _dd3.removeChild(_dd3.firstChild);
|
|
204
|
-
video.autoplay = true;
|
|
205
|
-
var id = "".concat(container.id, "_").concat(Date.now());
|
|
206
|
-
video.id = id;
|
|
207
|
-
container.appendChild(video);
|
|
208
|
-
this.player = new _PlayerManager7["default"]({
|
|
209
|
-
el: id,
|
|
210
|
-
url: this.url,
|
|
211
|
-
type: live
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
if (this.type === 'wfs') {
|
|
215
|
-
var _dd4 = document.getElementById(container.id);
|
|
216
|
-
((_b = _dd4 === null || _dd4 === void 0 ? void 0 : _dd4.children) === null || _b === void 0 ? void 0 : _b.length) > 0 && _dd4.removeChild(_dd4.firstChild);
|
|
217
|
-
video.autoplay = true;
|
|
218
|
-
var _id = "".concat(container.id, "_").concat(Date.now());
|
|
219
|
-
video.id = _id;
|
|
220
|
-
container.appendChild(video);
|
|
221
|
-
this.player = new _PlayerManager8["default"]({
|
|
222
|
-
el: _id,
|
|
223
|
-
url: this.url,
|
|
224
|
-
type: live ? 'live' : 'record'
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
if (this.type === 'h264') {
|
|
228
|
-
var _dd5 = document.getElementById(container.id);
|
|
229
|
-
((_c = _dd5 === null || _dd5 === void 0 ? void 0 : _dd5.children) === null || _c === void 0 ? void 0 : _c.length) > 0 && _dd5.removeChild(_dd5.firstChild);
|
|
230
|
-
video.autoplay = true;
|
|
231
|
-
var _id2 = 'playerh264';
|
|
232
|
-
video.id = _id2;
|
|
233
|
-
container.appendChild(video);
|
|
234
|
-
this.player = new _PlayerManager2["default"]({
|
|
235
|
-
id: _id2,
|
|
236
|
-
url: this.url
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
if (this.type === 'bd') {
|
|
240
|
-
this.player = new _PlayerManager["default"]({
|
|
241
|
-
el: container.id,
|
|
242
|
-
type: live,
|
|
243
|
-
url: this.url
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
if (this.type === 'mp4') {
|
|
247
|
-
var _dd6 = document.getElementById(container.id);
|
|
248
|
-
((_d = _dd6 === null || _dd6 === void 0 ? void 0 : _dd6.children) === null || _d === void 0 ? void 0 : _d.length) > 0 && _dd6.removeChild(_dd6.firstChild);
|
|
249
|
-
this.video.src = this.url;
|
|
250
|
-
this.video.autoplay = true;
|
|
251
|
-
var _id3 = 'mp4';
|
|
252
|
-
this.video.id = _id3;
|
|
253
|
-
container.appendChild(this.video);
|
|
254
|
-
}
|
|
255
|
-
if (this.type === 'iframe') {
|
|
256
|
-
var _dd7 = document.getElementById(container.id);
|
|
257
|
-
((_e = _dd7 === null || _dd7 === void 0 ? void 0 : _dd7.children) === null || _e === void 0 ? void 0 : _e.length) > 0 && _dd7.removeChild(_dd7.firstChild);
|
|
258
|
-
var iframe = document.createElement('iframe');
|
|
259
|
-
iframe.width = '100%';
|
|
260
|
-
iframe.height = '100%';
|
|
261
|
-
iframe.frameBorder = '0';
|
|
262
|
-
iframe.src = this.url;
|
|
263
|
-
container.appendChild(iframe);
|
|
264
|
-
}
|
|
265
|
-
if (this.type === 'rsl') {
|
|
266
|
-
var _dd8 = document.getElementById(container.id);
|
|
267
|
-
((_f = _dd8 === null || _dd8 === void 0 ? void 0 : _dd8.children) === null || _f === void 0 ? void 0 : _f.length) > 0 && _dd8.removeChild(_dd8.firstChild);
|
|
268
|
-
var canvas = document.createElement('canvas');
|
|
269
|
-
canvas.id = 'myCanvas';
|
|
270
|
-
canvas.style.width = '100%';
|
|
271
|
-
canvas.style.height = '100%';
|
|
272
|
-
container.appendChild(canvas);
|
|
273
|
-
this.player = new _PlayerManager5["default"]({
|
|
274
|
-
url: this.url,
|
|
275
|
-
canvasId: 'myCanvas',
|
|
276
|
-
callback: function callback(code, message) {
|
|
277
|
-
console.log(code, message);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "HkwsPlayer", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _HkwsPlayer["default"];
|
|
281
34
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
if (iErrorCode === '0x12f910011' || iErrorCode === '0x12f910027') {
|
|
306
|
-
reload && reload();
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
// firstFrameDisplay: (index: number, width: number, height: number) => {
|
|
310
|
-
// console.log(index, width, height, 'firstFrameDisplay');
|
|
311
|
-
// },
|
|
312
|
-
});
|
|
313
|
-
return result;
|
|
314
|
-
}
|
|
315
|
-
if (this.type === 'icc_ws') {
|
|
316
|
-
var _player2 = this.player;
|
|
317
|
-
_player2.playRealVideo({
|
|
318
|
-
channelList: [{
|
|
319
|
-
id: this.deviceCode + '$1$0$' + this.channelNum,
|
|
320
|
-
isOnline: true
|
|
321
|
-
}],
|
|
322
|
-
streamType: Number(this.streamType) + 1
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
if (this.type === 'webrtc') {
|
|
326
|
-
var _player3 = this.player;
|
|
327
|
-
_player3.play();
|
|
328
|
-
}
|
|
329
|
-
if (this.type === 'wfs') {
|
|
330
|
-
var _player4 = this.player;
|
|
331
|
-
_player4.play();
|
|
332
|
-
}
|
|
333
|
-
if (this.type === 'bd') {
|
|
334
|
-
var _player5 = this.player;
|
|
335
|
-
_player5.playRealVideo();
|
|
336
|
-
}
|
|
337
|
-
if (this.type === 'mp4') {
|
|
338
|
-
//
|
|
339
|
-
}
|
|
340
|
-
if (this.type === 'vtx_ws') {
|
|
341
|
-
var _player6 = this.player;
|
|
342
|
-
_player6.play(this.url);
|
|
343
|
-
var onClose = this.onClose;
|
|
344
|
-
var _reload = this.reload;
|
|
345
|
-
var index = 0;
|
|
346
|
-
_player6.on('stats', function (s) {
|
|
347
|
-
if ((s === null || s === void 0 ? void 0 : s.buf) < 0 && s.fps < 10 || !s.vbps) {
|
|
348
|
-
index++;
|
|
349
|
-
} else {
|
|
350
|
-
index = 0;
|
|
351
|
-
}
|
|
352
|
-
// 超过5秒无数据,则认为播放失败,则重连
|
|
353
|
-
if (index > 4) {
|
|
354
|
-
index = 0;
|
|
355
|
-
console.log(s, 'stats > 4');
|
|
356
|
-
_reload && _reload();
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
_player6.on('timeout', function (err) {
|
|
360
|
-
console.log(err, 'timeout');
|
|
361
|
-
_reload && _reload();
|
|
362
|
-
});
|
|
363
|
-
// 当play()的时候,如果没有数据返回,则回调
|
|
364
|
-
_player6.on('loadingTimeout', function () {
|
|
365
|
-
console.log('当play');
|
|
366
|
-
_reload && _reload();
|
|
367
|
-
});
|
|
368
|
-
// 当播放过程中,如果超过timeout之后没有数据渲染,则抛出异常。
|
|
369
|
-
_player6.on('delayTimeout', function () {
|
|
370
|
-
console.log('当delayTimeout');
|
|
371
|
-
_reload && _reload();
|
|
372
|
-
});
|
|
373
|
-
_player6.on('error', function (error) {
|
|
374
|
-
console.log('自定义error:', error);
|
|
375
|
-
if (error === 'streamEnd') {
|
|
376
|
-
_reload && _reload();
|
|
377
|
-
}
|
|
378
|
-
if (error === 'websocketError') {
|
|
379
|
-
onClose && onClose();
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
if (this.type === 'rsl') {
|
|
384
|
-
var _player7 = this.player;
|
|
385
|
-
_player7.play();
|
|
386
|
-
}
|
|
387
|
-
return Promise.resolve();
|
|
388
|
-
}
|
|
389
|
-
/** 回放 */
|
|
390
|
-
}, {
|
|
391
|
-
key: "playBack",
|
|
392
|
-
value: function playBack() {
|
|
393
|
-
var _this = this;
|
|
394
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
395
|
-
var player = this.player;
|
|
396
|
-
var result = player.JS_Play(this.url, {
|
|
397
|
-
playURL: this.url,
|
|
398
|
-
mode: 1
|
|
399
|
-
}, 0, (0, _utils.getHKTimeString)(this.startTime), (0, _utils.getHKTimeString)(this.endTime));
|
|
400
|
-
this.seekTime = (0, _moment["default"])(this.startTime);
|
|
401
|
-
this.windowIndex = 0;
|
|
402
|
-
return result;
|
|
403
|
-
} else if (this.type === 'icc_ws') {
|
|
404
|
-
var _player8 = this.player;
|
|
405
|
-
return new Promise(function (resolve) {
|
|
406
|
-
_player8.playRecordVideo({
|
|
407
|
-
channelList: [{
|
|
408
|
-
id: _this.deviceCode + '$1$0$' + _this.channelNum
|
|
409
|
-
}],
|
|
410
|
-
startTime: (0, _moment["default"])(_this.startTime, 'YYYY-MM-DD HH:mm:ss').format('X'),
|
|
411
|
-
endTime: (0, _moment["default"])(_this.endTime, 'YYYY-MM-DD HH:mm:ss').format('X'),
|
|
412
|
-
recordSource: '2',
|
|
413
|
-
streamType: _this.streamType
|
|
414
|
-
});
|
|
415
|
-
resolve(true);
|
|
416
|
-
});
|
|
417
|
-
} else if (this.type === 'bd') {
|
|
418
|
-
var _player9 = this.player;
|
|
419
|
-
return new Promise(function (resolve) {
|
|
420
|
-
var res = _player9.playRecordVideo();
|
|
421
|
-
resolve(res);
|
|
422
|
-
});
|
|
423
|
-
} else {
|
|
424
|
-
return this.play();
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/** 销毁 */
|
|
428
|
-
}, {
|
|
429
|
-
key: "destroy",
|
|
430
|
-
value: function destroy() {
|
|
431
|
-
var _this2 = this;
|
|
432
|
-
var _a, _b, _c;
|
|
433
|
-
if (!this.player) return;
|
|
434
|
-
if (this.type === 'flv') {
|
|
435
|
-
var player = this.player;
|
|
436
|
-
// player.unload();
|
|
437
|
-
// player.detachMediaElement();
|
|
438
|
-
player.destroy();
|
|
439
|
-
this.player = null;
|
|
440
|
-
this.video.remove();
|
|
441
|
-
}
|
|
442
|
-
if (this.type === 'hls') {
|
|
443
|
-
var _player0 = this.player;
|
|
444
|
-
_player0 && _player0.destroy();
|
|
445
|
-
this.player = null;
|
|
446
|
-
this.video.remove();
|
|
447
|
-
}
|
|
448
|
-
if (this.type === 'vtxhls' || this.type === 'vtxwhep') {
|
|
449
|
-
this.video.remove();
|
|
450
|
-
this.player = null;
|
|
451
|
-
var dd = document.getElementById(this.containerId);
|
|
452
|
-
while (dd === null || dd === void 0 ? void 0 : dd.hasChildNodes()) {
|
|
453
|
-
dd.removeChild(dd.firstChild);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
if (this.type === 'hk_ws') {
|
|
457
|
-
var _player1 = this.player;
|
|
458
|
-
_player1 && _player1.JS_Stop(0).then(function () {
|
|
459
|
-
_this2.player = null;
|
|
460
|
-
});
|
|
461
|
-
var _dd9 = document.getElementById(this.containerId);
|
|
462
|
-
_dd9 && _dd9.childNodes && _dd9.childNodes[0] && _dd9.removeChild(_dd9.childNodes[0]);
|
|
463
|
-
}
|
|
464
|
-
if (this.type === 'hkcar_ws') {
|
|
465
|
-
var _player10 = this.player;
|
|
466
|
-
_player10.JS_DestroyWorker();
|
|
467
|
-
var _dd0 = document.getElementById(this.containerId);
|
|
468
|
-
(_dd0 === null || _dd0 === void 0 ? void 0 : _dd0.childNodes) && _dd0.childNodes[0] && _dd0.removeChild(_dd0.childNodes[0]);
|
|
469
|
-
}
|
|
470
|
-
if (this.type === 'icc_ws') {
|
|
471
|
-
var _player11 = this.player;
|
|
472
|
-
_player11.close();
|
|
473
|
-
}
|
|
474
|
-
if (this.type === 'webrtc') {
|
|
475
|
-
var _player12 = this.player;
|
|
476
|
-
_player12.close();
|
|
477
|
-
}
|
|
478
|
-
if (this.type === 'wfs') {
|
|
479
|
-
var _player13 = this.player;
|
|
480
|
-
_player13.close();
|
|
481
|
-
}
|
|
482
|
-
if (this.type === 'h264') {
|
|
483
|
-
var _player14 = this.player;
|
|
484
|
-
_player14.close();
|
|
485
|
-
}
|
|
486
|
-
if (this.type === 'bd') {
|
|
487
|
-
var _player15 = this.player;
|
|
488
|
-
_player15.close(0);
|
|
489
|
-
}
|
|
490
|
-
if (this.type === 'mp4') {
|
|
491
|
-
this.video = null;
|
|
492
|
-
var _dd1 = document.getElementById(this.containerId);
|
|
493
|
-
((_a = _dd1 === null || _dd1 === void 0 ? void 0 : _dd1.children) === null || _a === void 0 ? void 0 : _a.length) > 0 && _dd1.removeChild(_dd1.firstChild);
|
|
494
|
-
}
|
|
495
|
-
if (this.type === 'vtx_ws') {
|
|
496
|
-
var _player16 = this.player;
|
|
497
|
-
_player16.destroy();
|
|
498
|
-
}
|
|
499
|
-
if (this.type === 'iframe') {
|
|
500
|
-
var _dd10 = document.getElementById(this.containerId);
|
|
501
|
-
((_b = _dd10 === null || _dd10 === void 0 ? void 0 : _dd10.children) === null || _b === void 0 ? void 0 : _b.length) > 0 && _dd10.removeChild(_dd10.firstChild);
|
|
502
|
-
}
|
|
503
|
-
if (this.type === 'rsl') {
|
|
504
|
-
var _player17 = this.player;
|
|
505
|
-
_player17.destroy();
|
|
506
|
-
var _dd11 = document.getElementById(this.containerId);
|
|
507
|
-
((_c = _dd11 === null || _dd11 === void 0 ? void 0 : _dd11.children) === null || _c === void 0 ? void 0 : _c.length) > 0 && _dd11.removeChild(_dd11.firstChild);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
/** 截图 */
|
|
511
|
-
}, {
|
|
512
|
-
key: "capture",
|
|
513
|
-
value: function capture() {
|
|
514
|
-
var captureName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '视频截图';
|
|
515
|
-
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
516
|
-
var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
517
|
-
var name = captureName;
|
|
518
|
-
if (time) name += "-".concat((0, _moment["default"])().format('YYYYMMDDHHmmss'));
|
|
519
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
520
|
-
var player = this.player;
|
|
521
|
-
if (player) player.JS_CapturePicture(1, name, 'JPEG', function (res) {
|
|
522
|
-
callback && callback(res);
|
|
523
|
-
});
|
|
524
|
-
} else if (this.type === 'bd') {
|
|
525
|
-
var DPlayer = this.player.dp;
|
|
526
|
-
var canvas = DPlayer.container.querySelector('canvas');
|
|
527
|
-
if (canvas) {
|
|
528
|
-
canvas.toBlob(function (blob) {
|
|
529
|
-
if (blob) {
|
|
530
|
-
callback === null || callback === void 0 ? void 0 : callback(URL.createObjectURL(blob));
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
} else if (this.type === 'vtx_ws') {
|
|
535
|
-
var _player18 = this.player;
|
|
536
|
-
if (_player18) {
|
|
537
|
-
var fileBlob = _player18.screenshot(captureName, 'blob');
|
|
538
|
-
callback && callback(URL.createObjectURL(fileBlob));
|
|
539
|
-
}
|
|
540
|
-
} else {
|
|
541
|
-
Capture(this.video, name, callback);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
/** 尺寸重置 */
|
|
545
|
-
}, {
|
|
546
|
-
key: "resize",
|
|
547
|
-
value: function resize() {
|
|
548
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
549
|
-
var player = this.player;
|
|
550
|
-
setTimeout(function () {
|
|
551
|
-
player.JS_Resize();
|
|
552
|
-
}, 500);
|
|
553
|
-
} else if (this.type === 'icc_ws') {
|
|
554
|
-
var _player19 = this.player;
|
|
555
|
-
_player19.setPlayerAdapter('selfAdaption');
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* 设置音量
|
|
560
|
-
* @param value
|
|
561
|
-
*/
|
|
562
|
-
}, {
|
|
563
|
-
key: "setVolume",
|
|
564
|
-
value: function setVolume(value) {
|
|
565
|
-
if (this.type === 'flv') {
|
|
566
|
-
var player = this.player;
|
|
567
|
-
player.setVolume(value / 100);
|
|
568
|
-
}
|
|
569
|
-
if (this.type === 'hls') {
|
|
570
|
-
this.video.volume = value / 100;
|
|
571
|
-
}
|
|
572
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
573
|
-
var _player20 = this.player;
|
|
574
|
-
if (value < 1) {
|
|
575
|
-
_player20.JS_CloseSound(this.windowIndex);
|
|
576
|
-
} else {
|
|
577
|
-
_player20.JS_OpenSound(this.windowIndex).then(function () {
|
|
578
|
-
console.info('JS_OpenSound success');
|
|
579
|
-
}, function (err) {
|
|
580
|
-
console.log(err);
|
|
581
|
-
});
|
|
582
|
-
_player20.JS_SetVolume(this.windowIndex, value);
|
|
583
|
-
}
|
|
584
|
-
// if (player.iCurrentSoundWnd !== this.windowIndex) {
|
|
585
|
-
// player.JS_OpenSound(this.windowIndex);
|
|
586
|
-
// }
|
|
587
|
-
}
|
|
588
|
-
if (this.type === 'bd') {
|
|
589
|
-
var _player21 = this.player.dp;
|
|
590
|
-
if (!_player21.ttxplayer.enableAudio) _player21.ttxplayer.openAudio();
|
|
591
|
-
_player21.ttxplayer.setVolume(value);
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* 设置播放速度
|
|
596
|
-
* @param speed
|
|
597
|
-
*/
|
|
598
|
-
}, {
|
|
599
|
-
key: "setSpeed",
|
|
600
|
-
value: function setSpeed(speed) {
|
|
601
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
602
|
-
var player = this.player;
|
|
603
|
-
if (this.preSpeed / speed === 2) {
|
|
604
|
-
player.JS_Slow(1);
|
|
605
|
-
}
|
|
606
|
-
if (this.preSpeed / speed === 4) {
|
|
607
|
-
player.JS_Slow(1).then(function () {
|
|
608
|
-
return player.JS_Slow(1);
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
if (this.preSpeed / speed === 8) {
|
|
612
|
-
player.JS_Slow(1).then(function () {
|
|
613
|
-
return player.JS_Slow(1);
|
|
614
|
-
}).then(function () {
|
|
615
|
-
return player.JS_Slow(1);
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
if (this.preSpeed / speed === 16) {
|
|
619
|
-
player.JS_Slow(1).then(function () {
|
|
620
|
-
return player.JS_Slow(1);
|
|
621
|
-
}).then(function () {
|
|
622
|
-
return player.JS_Slow(1);
|
|
623
|
-
}).then(function () {
|
|
624
|
-
return player.JS_Slow(1);
|
|
625
|
-
});
|
|
626
|
-
}
|
|
627
|
-
if (speed / this.preSpeed === 2) {
|
|
628
|
-
player.JS_Fast(1);
|
|
629
|
-
}
|
|
630
|
-
if (speed / this.preSpeed === 4) {
|
|
631
|
-
player.JS_Fast(1).then(function () {
|
|
632
|
-
return player.JS_Fast(1);
|
|
633
|
-
});
|
|
634
|
-
}
|
|
635
|
-
if (speed / this.preSpeed === 8) {
|
|
636
|
-
player.JS_Fast(1).then(function () {
|
|
637
|
-
return player.JS_Fast(1);
|
|
638
|
-
}).then(function () {
|
|
639
|
-
return player.JS_Fast(1);
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
if (speed / this.preSpeed === 16) {
|
|
643
|
-
player.JS_Fast(1).then(function () {
|
|
644
|
-
return player.JS_Fast(1);
|
|
645
|
-
}).then(function () {
|
|
646
|
-
return player.JS_Fast(1);
|
|
647
|
-
}).then(function () {
|
|
648
|
-
return player.JS_Fast(1);
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
this.preSpeed = speed;
|
|
652
|
-
} else if (this.type === 'icc_ws') {
|
|
653
|
-
var _player22 = this.player;
|
|
654
|
-
_player22.playSpeed(speed);
|
|
655
|
-
} else if (this.type === 'bd') {
|
|
656
|
-
// todo
|
|
657
|
-
} else {
|
|
658
|
-
this.video.playbackRate = speed;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* 时间更新事件
|
|
663
|
-
* @param callback 回调函数
|
|
664
|
-
*/
|
|
665
|
-
}, {
|
|
666
|
-
key: "onTimeUpdate",
|
|
667
|
-
value: function onTimeUpdate(callback) {
|
|
668
|
-
var _this3 = this;
|
|
669
|
-
var _a;
|
|
670
|
-
this.video.addEventListener('timeupdate', function () {
|
|
671
|
-
var currentTime = _this3.video.currentTime;
|
|
672
|
-
if ((_this3.type === 'hk_ws' || _this3.type === 'hkcar_ws') && _this3.seekTime) {
|
|
673
|
-
currentTime = currentTime + _this3.seekTime.diff(_this3.startTime, 'seconds');
|
|
674
|
-
}
|
|
675
|
-
callback(currentTime, _this3.type === 'hk_ws' || _this3.type === 'hkcar_ws' ? _this3.preSpeed : _this3.video.playbackRate);
|
|
676
|
-
});
|
|
677
|
-
// 增加hw_ws 流播放结束回调
|
|
678
|
-
var player = this.player;
|
|
679
|
-
(_a = player === null || player === void 0 ? void 0 : player.JS_SetWindowControlCallback) === null || _a === void 0 ? void 0 : _a.call(player, {
|
|
680
|
-
StreamEnd: function StreamEnd() {
|
|
681
|
-
callback((0, _moment["default"])(_this3.endTime).diff(_this3.startTime, 'seconds'), _this3.preSpeed);
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
/** 跳转到 */
|
|
686
|
-
}, {
|
|
687
|
-
key: "seekTo",
|
|
688
|
-
value: function seekTo(time) {
|
|
689
|
-
var _a, _b;
|
|
690
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
|
|
691
|
-
var player, seekTime, _player23, _seekTime, _player24, url;
|
|
692
|
-
return _regenerator().w(function (_context) {
|
|
693
|
-
while (1) switch (_context.n) {
|
|
694
|
-
case 0:
|
|
695
|
-
if (!(this.type === 'hk_ws' || this.type === 'hkcar_ws')) {
|
|
696
|
-
_context.n = 2;
|
|
697
|
-
break;
|
|
698
|
-
}
|
|
699
|
-
player = this.player;
|
|
700
|
-
seekTime = (_a = (0, _moment["default"])(this.startTime)) === null || _a === void 0 ? void 0 : _a.add(time, 'seconds');
|
|
701
|
-
this.seekTime = seekTime;
|
|
702
|
-
_context.n = 1;
|
|
703
|
-
return player.JS_Seek(1, (0, _utils.getHKTimeString)(seekTime), (0, _utils.getHKTimeString)(this.endTime));
|
|
704
|
-
case 1:
|
|
705
|
-
_context.n = 3;
|
|
706
|
-
break;
|
|
707
|
-
case 2:
|
|
708
|
-
if (this.type === 'icc_ws') {
|
|
709
|
-
_player23 = this.player;
|
|
710
|
-
_seekTime = (_b = (0, _moment["default"])(this.startTime)) === null || _b === void 0 ? void 0 : _b.add(time, 'seconds').format('HH:mm:ss');
|
|
711
|
-
_player23.jumpPlayByTime(_seekTime);
|
|
712
|
-
} else if (this.type === 'bd') {
|
|
713
|
-
_player24 = this.player;
|
|
714
|
-
_player24.close(0);
|
|
715
|
-
this.player = null;
|
|
716
|
-
url = this.url.replace('PLAYBEG=0', "PLAYBEG=".concat(time * 1000)); // .replace('PLAYEND=0', `PLAYEND=2700000`);
|
|
717
|
-
this.player = new _PlayerManager["default"]({
|
|
718
|
-
el: this.containerId,
|
|
719
|
-
type: false,
|
|
720
|
-
url: url
|
|
721
|
-
});
|
|
722
|
-
this.player.playRecordVideo();
|
|
723
|
-
} else {
|
|
724
|
-
this.video.currentTime = time;
|
|
725
|
-
}
|
|
726
|
-
case 3:
|
|
727
|
-
return _context.a(2, Promise.resolve());
|
|
728
|
-
}
|
|
729
|
-
}, _callee, this);
|
|
730
|
-
}));
|
|
731
|
-
}
|
|
732
|
-
/**
|
|
733
|
-
* 暂停播放
|
|
734
|
-
* @param callback 回调函数
|
|
735
|
-
*/
|
|
736
|
-
}, {
|
|
737
|
-
key: "pause",
|
|
738
|
-
value: function pause(callback) {
|
|
739
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
740
|
-
var player = this.player;
|
|
741
|
-
player.JS_Pause(0).then(function () {
|
|
742
|
-
return callback && callback();
|
|
743
|
-
});
|
|
744
|
-
} else if (this.type === 'bd') {
|
|
745
|
-
var _player25 = this.player;
|
|
746
|
-
_player25.pause();
|
|
747
|
-
callback && callback();
|
|
748
|
-
} else if (this.type === 'vtx_ws') {
|
|
749
|
-
var _player26 = this.player;
|
|
750
|
-
_player26.pause();
|
|
751
|
-
} else {
|
|
752
|
-
this.video.pause();
|
|
753
|
-
callback && callback();
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
/**
|
|
757
|
-
* 恢复播放
|
|
758
|
-
* @param callback 回调函数
|
|
759
|
-
*/
|
|
760
|
-
}, {
|
|
761
|
-
key: "resume",
|
|
762
|
-
value: function resume(callback) {
|
|
763
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
764
|
-
var player = this.player;
|
|
765
|
-
player.JS_Resume(0).then(function () {
|
|
766
|
-
return callback && callback();
|
|
767
|
-
});
|
|
768
|
-
} else if (this.type === 'bd') {
|
|
769
|
-
var _player27 = this.player;
|
|
770
|
-
_player27.resume();
|
|
771
|
-
callback && callback();
|
|
772
|
-
} else {
|
|
773
|
-
this.video.play();
|
|
774
|
-
callback && callback();
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
/**
|
|
778
|
-
* 开始对讲
|
|
779
|
-
* @param url 对讲地址
|
|
780
|
-
*/
|
|
781
|
-
}, {
|
|
782
|
-
key: "startTalk",
|
|
783
|
-
value: function startTalk(url) {
|
|
784
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
785
|
-
var player = this.player;
|
|
786
|
-
return player.JS_StartTalk(url).then(function () {
|
|
787
|
-
console.log('talkStart success');
|
|
788
|
-
Promise.resolve();
|
|
789
|
-
}, function (e) {
|
|
790
|
-
console.error(e);
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
return Promise.reject();
|
|
794
|
-
}
|
|
795
|
-
/**
|
|
796
|
-
* 开始对讲
|
|
797
|
-
* @param state 状态
|
|
798
|
-
*/
|
|
799
|
-
}, {
|
|
800
|
-
key: "stopTalk",
|
|
801
|
-
value: function stopTalk() {
|
|
802
|
-
if (this.type === 'hk_ws' || this.type === 'hkcar_ws') {
|
|
803
|
-
var player = this.player;
|
|
804
|
-
return player.JS_StopTalk().then(function () {
|
|
805
|
-
console.info('JS_StopTalk success');
|
|
806
|
-
// do you want...
|
|
807
|
-
}, function (err) {
|
|
808
|
-
console.info('JS_StopTalk failed');
|
|
809
|
-
// do you want...
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
return Promise.reject();
|
|
813
|
-
}
|
|
814
|
-
}]);
|
|
815
|
-
}();
|
|
816
|
-
/**
|
|
817
|
-
* 截图
|
|
818
|
-
* @param video
|
|
819
|
-
*/
|
|
820
|
-
var Capture = function Capture(video, name, callback) {
|
|
821
|
-
var canvas = document.createElement('canvas');
|
|
822
|
-
canvas.width = video.videoWidth;
|
|
823
|
-
canvas.height = video.videoHeight;
|
|
824
|
-
var context = canvas.getContext('2d');
|
|
825
|
-
if (context) {
|
|
826
|
-
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
827
|
-
var dataURL;
|
|
828
|
-
canvas.toBlob(function (blob) {
|
|
829
|
-
if (blob) {
|
|
830
|
-
dataURL = URL.createObjectURL(blob);
|
|
831
|
-
// const link = document.createElement('a');
|
|
832
|
-
callback && callback(dataURL);
|
|
833
|
-
// link.href = dataURL;
|
|
834
|
-
// link.download = `${name}.png`;
|
|
835
|
-
// link.style.display = 'none';
|
|
836
|
-
// document.body.appendChild(link);
|
|
837
|
-
// link.click();
|
|
838
|
-
// document.body.removeChild(link);
|
|
839
|
-
// URL.revokeObjectURL(dataURL);
|
|
840
|
-
}
|
|
841
|
-
});
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "HlsPlayer", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _HlsPlayer["default"];
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "IccwsPlayer", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _IccwsPlayer["default"];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "IframePlayer", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _IframePlayer["default"];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "Mp4Player", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _Mp4Player["default"];
|
|
842
58
|
}
|
|
843
|
-
};
|
|
844
|
-
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "RslPlayer", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _RslPlayer["default"];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "VtxHlsPlayer", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _VtxHlsPlayer["default"];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "VtxwhepPlayer", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _VtxwhepPlayer["default"];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "VtxwsPlayer", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _VtxwsPlayer["default"];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "WebrtcPlayer", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _WebrtcPlayer["default"];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "WfsPlayer", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _WfsPlayer["default"];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
var _BdPlayer = _interopRequireDefault(require("./BdPlayer"));
|
|
97
|
+
var _FlvPlayer = _interopRequireDefault(require("./FlvPlayer"));
|
|
98
|
+
var _H264Player = _interopRequireDefault(require("./H264Player"));
|
|
99
|
+
var _HkcarwsPlayer = _interopRequireDefault(require("./HkcarwsPlayer"));
|
|
100
|
+
var _HkwsPlayer = _interopRequireDefault(require("./HkwsPlayer"));
|
|
101
|
+
var _HlsPlayer = _interopRequireDefault(require("./HlsPlayer"));
|
|
102
|
+
var _IccwsPlayer = _interopRequireDefault(require("./IccwsPlayer"));
|
|
103
|
+
var _IframePlayer = _interopRequireDefault(require("./IframePlayer"));
|
|
104
|
+
var _Mp4Player = _interopRequireDefault(require("./Mp4Player"));
|
|
105
|
+
var _RslPlayer = _interopRequireDefault(require("./RslPlayer"));
|
|
106
|
+
var _VtxHlsPlayer = _interopRequireDefault(require("./VtxHlsPlayer"));
|
|
107
|
+
var _VtxwhepPlayer = _interopRequireDefault(require("./VtxwhepPlayer"));
|
|
108
|
+
var _VtxwsPlayer = _interopRequireDefault(require("./VtxwsPlayer"));
|
|
109
|
+
var _WebrtcPlayer = _interopRequireDefault(require("./WebrtcPlayer"));
|
|
110
|
+
var _WfsPlayer = _interopRequireDefault(require("./WfsPlayer"));
|
|
111
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
845
112
|
//# sourceMappingURL=index.js.map
|