@ganwei-web/gw-base-components-plus 1.0.0
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/echartList/barEchart/dist/index.es.js +152 -0
- package/echartList/barEchart/dist/index.umd.js +1 -0
- package/echartList/barEchart/dist/style.css +1 -0
- package/echartList/curve/dist/index.es.js +217 -0
- package/echartList/curve/dist/index.umd.js +1 -0
- package/echartList/curve/dist/style.css +1 -0
- package/echartList/historyEchart/dist/index.es.js +292 -0
- package/echartList/historyEchart/dist/index.umd.js +10 -0
- package/echartList/historyEchart/dist/style.css +1 -0
- package/echartList/solid-bar/dist/index.es.js +290 -0
- package/echartList/solid-bar/dist/index.umd.js +1 -0
- package/echartList/solid-bar/dist/style.css +1 -0
- package/echartList/solid-circle/dist/index.es.js +332 -0
- package/echartList/solid-circle/dist/index.umd.js +6 -0
- package/echartList/solid-circle/dist/style.css +1 -0
- package/echartList/solid-pie/dist/index.es.js +336 -0
- package/echartList/solid-pie/dist/index.umd.js +6 -0
- package/echartList/solid-pie/dist/style.css +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs +902 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.css +789 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +903 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.js +902 -0
- package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -0
- package/equip-list-vue2/dist/index.es.js +1275 -0
- package/equip-list-vue2/dist/index.umd.js +1 -0
- package/equip-list-vue2/dist/style.css +1 -0
- package/equip-list-vue3/dist/index.es.js +1510 -0
- package/equip-list-vue3/dist/index.umd.js +1 -0
- package/equip-list-vue3/dist/style.css +1 -0
- package/equip-select-vue2/dist/index.es.js +231 -0
- package/equip-select-vue2/dist/index.umd.js +1 -0
- package/equip-select-vue2/dist/style.css +1 -0
- package/equip-select-vue3/dist/index.es.js +231 -0
- package/equip-select-vue3/dist/index.umd.js +1 -0
- package/equip-select-vue3/dist/style.css +1 -0
- package/equipProcessing/dist/index.es.js +203 -0
- package/equipProcessing/dist/index.umd.js +1 -0
- package/loadMore/dist/index.es.js +12 -0
- package/loadMore/dist/index.umd.js +1 -0
- package/loading/dist/index.es.js +25 -0
- package/loading/dist/index.umd.js +1 -0
- package/loading/dist/style.css +1 -0
- package/package.json +11 -0
- package/player/dist/index.es.js +1080 -0
- package/player/dist/index.umd.js +14 -0
- package/player/dist/style.css +1 -0
- package/selectV2/dist/index.es.js +190 -0
- package/selectV2/dist/index.umd.js +1 -0
- package/selectV2/dist/style.css +1 -0
- package/showPassword/dist/index.es.js +72 -0
- package/showPassword/dist/index.umd.js +1 -0
- package/table/dist/index.es.js +182 -0
- package/table/dist/index.umd.js +1 -0
- package/table/dist/style.css +1 -0
- package/widthSetting/dist/index.es.js +113 -0
- package/widthSetting/dist/index.umd.js +1 -0
- package/widthSetting/dist/style.css +1 -0
|
@@ -0,0 +1,1080 @@
|
|
|
1
|
+
import "./style.css";
|
|
2
|
+
let Se = Object.defineProperty;
|
|
3
|
+
let Ce = (o, e, t) => e in o ? Se(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
4
|
+
let p = (o, e, t) => (Ce(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
5
|
+
import { computed as Pe, createBlock as O, createCommentVNode as w, createElementBlock as f, createElementVNode as l, createVNode as k, defineComponent as A, Fragment as le, getCurrentInstance as fe, inject as se, mergeModels as ke, normalizeClass as oe, onBeforeUnmount as be, onMounted as Te, onUnmounted as Re, openBlock as u, provide as He, reactive as me, ref as C, renderList as ie, resolveComponent as z, resolveDirective as $e, toDisplayString as Y, unref as b, useModel as Ie, watch as pe, withCtx as j, withDirectives as ze } from "vue";
|
|
6
|
+
import { useDraggable as Le } from "element-plus";
|
|
7
|
+
import { HubConnectionBuilder as xe } from "@aspnet/signalr";
|
|
8
|
+
var te = /* @__PURE__ */ ((o) => (o[o.GB28181 = 10] = "GB28181", o))(te || {}), a = /* @__PURE__ */ ((o) => (o[o.StopPTZ = 0] = "StopPTZ", o[o.Up = 1] = "Up", o[o.UpRight = 2] = "UpRight", o[o.Right = 3] = "Right", o[o.RightDown = 4] = "RightDown", o[o.Down = 5] = "Down", o[o.DownLeft = 6] = "DownLeft", o[o.Left = 7] = "Left", o[o.LeftUp = 8] = "LeftUp", o[o.ZoomIn = 9] = "ZoomIn", o[o.ZoomOut = 10] = "ZoomOut", o[o.StopFI = 20] = "StopFI", o[o.FocusPlus = 21] = "FocusPlus", o[o.FocusMinus = 22] = "FocusMinus", o[o.IrisOn = 23] = "IrisOn", o[o.IrisOff = 24] = "IrisOff", o[o.SetPreset = 30] = "SetPreset", o[o.GetPreset = 31] = "GetPreset", o[o.RemovePreset = 32] = "RemovePreset", o[o.UnKnow = 100] = "UnKnow", o))(a || {});
|
|
9
|
+
class he {
|
|
10
|
+
constructor(e, t = !0) {
|
|
11
|
+
p(this, "signalR");
|
|
12
|
+
p(this, "url", "");
|
|
13
|
+
p(this, "connectionId", "");
|
|
14
|
+
p(this, "autoCloseTimeout", -1);
|
|
15
|
+
p(this, "autoTimeout", !0);
|
|
16
|
+
p(this, "isStop", !1);
|
|
17
|
+
p(this, "connectionResult", {
|
|
18
|
+
connection: null,
|
|
19
|
+
success: !1
|
|
20
|
+
});
|
|
21
|
+
this.autoTimeout = t, e && (this.url = e), this.signalR = new xe().withUrl(this.url).build(), this.signalR.serverTimeoutInMilliseconds = 5e8, this.signalR.keepAliveIntervalInMilliseconds = 5e8, this.onConnectionId();
|
|
22
|
+
}
|
|
23
|
+
start() {
|
|
24
|
+
this.connectionResult.connection = this.signalR.start(), this.connectionResult.connection.then(() => {
|
|
25
|
+
this.connectionResult.success = !0;
|
|
26
|
+
}).catch((e) => {
|
|
27
|
+
this.connectionResult.success = !1, console.log(e);
|
|
28
|
+
}).finally(() => {
|
|
29
|
+
this.autoTimeout && (this.autoCloseTimeout = window.setTimeout(() => {
|
|
30
|
+
this.stop();
|
|
31
|
+
}, 3e4));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
onConnectionId() {
|
|
35
|
+
this.signalR.on("ConnectionSucceeded", (e) => {
|
|
36
|
+
this.connectionId = e.data;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
stop() {
|
|
40
|
+
this.isStop || (this.isStop = !0, console.log("stop", this.connectionId), this.connectionResult = {
|
|
41
|
+
connection: null,
|
|
42
|
+
success: !1
|
|
43
|
+
}, this.signalR.state === 1 && this.signalR.stop());
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class ve {
|
|
47
|
+
constructor(e, t = 2, i = 6e4, d) {
|
|
48
|
+
p(this, "size", 2);
|
|
49
|
+
p(this, "result", []);
|
|
50
|
+
p(this, "failed", null);
|
|
51
|
+
p(this, "canceled", !1);
|
|
52
|
+
p(this, "promise");
|
|
53
|
+
p(this, "resolve");
|
|
54
|
+
p(this, "reject");
|
|
55
|
+
p(this, "onMessage", () => {
|
|
56
|
+
console.log("task message");
|
|
57
|
+
});
|
|
58
|
+
this.id = e, this.size = t, d && (this.onMessage = d), this.promise = new Promise((g, r) => {
|
|
59
|
+
const R = setTimeout(() => {
|
|
60
|
+
this.reject("命令超时");
|
|
61
|
+
}, i);
|
|
62
|
+
this.resolve = (m) => {
|
|
63
|
+
g(m), clearTimeout(R);
|
|
64
|
+
}, this.reject = (m) => {
|
|
65
|
+
r(m), clearTimeout(R);
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
process(e) {
|
|
70
|
+
return this.onMessage(e), !1;
|
|
71
|
+
}
|
|
72
|
+
cancel() {
|
|
73
|
+
this.canceled = !0, this.reject("--canceled--");
|
|
74
|
+
}
|
|
75
|
+
static isCanceled(e) {
|
|
76
|
+
return typeof e == "string" && e === "--canceled--";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
class Ve {
|
|
80
|
+
constructor() {
|
|
81
|
+
p(this, "suspenseTasks", []);
|
|
82
|
+
}
|
|
83
|
+
addSuspenseTask(e) {
|
|
84
|
+
return this.suspenseTasks.push(e), e;
|
|
85
|
+
}
|
|
86
|
+
processSuspenseTask(e) {
|
|
87
|
+
e.id && (this.suspenseTasks = this.suspenseTasks.filter((t) => !t.process(e)));
|
|
88
|
+
}
|
|
89
|
+
dispose() {
|
|
90
|
+
for (const e of this.suspenseTasks) { e.cancel(); }
|
|
91
|
+
this.suspenseTasks = [];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
class Me extends ve {
|
|
95
|
+
process(e) {
|
|
96
|
+
return !e.id || e.id != this.id ? !1 : (super.process(e), this.result.push(e), e.response ? this.result.length >= this.size ? (this.resolve({
|
|
97
|
+
id: e.id,
|
|
98
|
+
response: !0,
|
|
99
|
+
responseData: null,
|
|
100
|
+
responseMessage: ""
|
|
101
|
+
}), !0) : !1 : (this.failed = e, this.reject(this.failed.responseMessage), !0));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
class je extends ve {
|
|
105
|
+
process(e) {
|
|
106
|
+
return !e.id || e.id != this.id ? !1 : (super.process(e), this.result.push(e), e.response ? e.isCompleted ? (this.resolve(e.responseData), !0) : !1 : (this.failed = e, this.reject(this.failed.responseMessage), !0));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
class Fe {
|
|
110
|
+
constructor(e, t, i = 1e4) {
|
|
111
|
+
p(this, "timeout", 1e4);
|
|
112
|
+
// 10s
|
|
113
|
+
p(this, "_id", 1);
|
|
114
|
+
p(this, "asyncPTZSignalRController");
|
|
115
|
+
p(this, "strategies", {
|
|
116
|
+
[a.StopPTZ]: void 0,
|
|
117
|
+
[a.Up]: void 0,
|
|
118
|
+
[a.UpRight]: void 0,
|
|
119
|
+
[a.Right]: void 0,
|
|
120
|
+
[a.RightDown]: void 0,
|
|
121
|
+
[a.Down]: void 0,
|
|
122
|
+
[a.DownLeft]: void 0,
|
|
123
|
+
[a.Left]: void 0,
|
|
124
|
+
[a.LeftUp]: void 0,
|
|
125
|
+
[a.ZoomIn]: void 0,
|
|
126
|
+
[a.ZoomOut]: void 0,
|
|
127
|
+
[a.FocusPlus]: void 0,
|
|
128
|
+
[a.FocusMinus]: void 0,
|
|
129
|
+
[a.IrisOn]: void 0,
|
|
130
|
+
[a.IrisOff]: void 0,
|
|
131
|
+
[a.SetPreset]: void 0,
|
|
132
|
+
[a.GetPreset]: void 0,
|
|
133
|
+
[a.RemovePreset]: void 0,
|
|
134
|
+
[a.UnKnow]: void 0,
|
|
135
|
+
[a.StopFI]: void 0
|
|
136
|
+
});
|
|
137
|
+
p(this, "suspenseTaskQueue");
|
|
138
|
+
this.deviceId = e, this.nvrChannelId = t, this.timeout = i, this.suspenseTaskQueue = new Ve(), this.asyncPTZSignalRController = new Ne(this.suspenseTaskQueue.processSuspenseTask.bind(this.suspenseTaskQueue)), this.initStrategies();
|
|
139
|
+
}
|
|
140
|
+
generateId() {
|
|
141
|
+
return this._id++;
|
|
142
|
+
}
|
|
143
|
+
initStrategies() {
|
|
144
|
+
const e = new De();
|
|
145
|
+
for (const t in a) {
|
|
146
|
+
const i = parseInt(t);
|
|
147
|
+
isNaN(i) || i >= a.StopPTZ && i <= a.ZoomOut && (this.strategies[t] = e);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
addStrategies(e, t) {
|
|
151
|
+
this.strategies[e] && console.warn(`PTZCommandEnum ${e} already has a strategy`), this.strategies[e] = t;
|
|
152
|
+
}
|
|
153
|
+
doPTZControl(e, t, i) {
|
|
154
|
+
let m;
|
|
155
|
+
const d = this.generateId(), g = {
|
|
156
|
+
command: e,
|
|
157
|
+
speed: 0,
|
|
158
|
+
...t,
|
|
159
|
+
id: d,
|
|
160
|
+
deviceId: this.deviceId,
|
|
161
|
+
nvrChannelId: this.nvrChannelId
|
|
162
|
+
}, r = ((m = this.strategies[e]) == null ? void 0 : m.doPTZControl(e, g)) || g, R = new Me(d, 2, this.timeout, i);
|
|
163
|
+
return this.suspenseTaskQueue.addSuspenseTask(R), this.asyncPTZSignalRController.invokePTZControl(r), R.promise;
|
|
164
|
+
}
|
|
165
|
+
doPresetQuery() {
|
|
166
|
+
const e = this.generateId(), t = {
|
|
167
|
+
id: e,
|
|
168
|
+
deviceId: this.deviceId,
|
|
169
|
+
nvrChannelId: this.nvrChannelId
|
|
170
|
+
}, i = new je(e, 2, this.timeout);
|
|
171
|
+
return this.suspenseTaskQueue.addSuspenseTask(i), this.asyncPTZSignalRController.invokeGetPresets(t), i.promise;
|
|
172
|
+
}
|
|
173
|
+
dispose() {
|
|
174
|
+
this.asyncPTZSignalRController.stop(), this.suspenseTaskQueue.dispose(), this.strategies = {};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
class De {
|
|
178
|
+
doPTZControl(e, t) {
|
|
179
|
+
return {
|
|
180
|
+
...t,
|
|
181
|
+
command: e
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
class Ne extends he {
|
|
186
|
+
constructor(t) {
|
|
187
|
+
super("/mediaPlatformPTZ", !1);
|
|
188
|
+
p(this, "eventName", "ShowLog");
|
|
189
|
+
p(this, "onShowLog", () => {
|
|
190
|
+
console.log("showLog");
|
|
191
|
+
});
|
|
192
|
+
t && (this.onShowLog = t), this.onShowLogMethod(), this.start();
|
|
193
|
+
}
|
|
194
|
+
invokePTZControl(t) {
|
|
195
|
+
this.signalR.invoke("PTZControl", t);
|
|
196
|
+
}
|
|
197
|
+
invokeGetPresets(t) {
|
|
198
|
+
let i;
|
|
199
|
+
if (!this.connectionResult.connection) { throw new Error("connection is not ready"); }
|
|
200
|
+
(i = this.connectionResult.connection) == null || i.then(() => {
|
|
201
|
+
this.signalR.invoke("PresetQuery", t);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
onShowLogMethod() {
|
|
205
|
+
this.signalR.on(this.eventName, (t) => {
|
|
206
|
+
this.onShowLog(t, this.connectionId);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
stop() {
|
|
210
|
+
this.signalR.off(this.eventName), this.onShowLog = () => {
|
|
211
|
+
console.log("showLog");
|
|
212
|
+
}, super.stop();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const Ue = {
|
|
216
|
+
player: "glplayer0",
|
|
217
|
+
width: 640,
|
|
218
|
+
height: 360,
|
|
219
|
+
token: "base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1",
|
|
220
|
+
extInfo: {
|
|
221
|
+
probeSize: 8192,
|
|
222
|
+
ignoreAudio: 0,
|
|
223
|
+
coreProbePart: 0.1,
|
|
224
|
+
autoPlay: !0,
|
|
225
|
+
cacheLength: 50,
|
|
226
|
+
rawFps: 24
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
class Ze {
|
|
230
|
+
constructor(e) {
|
|
231
|
+
p(this, "config", {});
|
|
232
|
+
p(this, "instance");
|
|
233
|
+
p(this, "PTZControlService");
|
|
234
|
+
p(this, "performance", -1);
|
|
235
|
+
e && Object.assign(this.config, Ue, e);
|
|
236
|
+
}
|
|
237
|
+
eventsOn(e) {
|
|
238
|
+
for (const t in e) { this.instance[t] = e[t]; }
|
|
239
|
+
return this.instance.onReadyShowDone = this.onPerformance.bind(this), !0;
|
|
240
|
+
}
|
|
241
|
+
onPerformance() {
|
|
242
|
+
let e, t;
|
|
243
|
+
this.performance = performance.now() - this.performance, (t = (e = this.instance) == null ? void 0 : e.onPerformance) == null || t.call(e, this.performance);
|
|
244
|
+
}
|
|
245
|
+
init(e) {
|
|
246
|
+
this.performance = performance.now();
|
|
247
|
+
const t = window.new265webjs ? window.new265webjs : window.top.new265webjs;
|
|
248
|
+
this.instance = t(e, this.config);
|
|
249
|
+
}
|
|
250
|
+
start() {
|
|
251
|
+
this.instance.do();
|
|
252
|
+
}
|
|
253
|
+
play() {
|
|
254
|
+
this.instance.play();
|
|
255
|
+
}
|
|
256
|
+
destroy() {
|
|
257
|
+
let e;
|
|
258
|
+
(e = this.PTZControlService) == null || e.dispose(), this.instance.release();
|
|
259
|
+
}
|
|
260
|
+
setVoice(e) {
|
|
261
|
+
this.instance.setVoice(e);
|
|
262
|
+
}
|
|
263
|
+
pause() {
|
|
264
|
+
this.instance.pause();
|
|
265
|
+
}
|
|
266
|
+
fullScreen() {
|
|
267
|
+
this.instance.fullScreen();
|
|
268
|
+
}
|
|
269
|
+
snapshot() {
|
|
270
|
+
this.instance.snapshot();
|
|
271
|
+
}
|
|
272
|
+
enablePTZ(e, t, i) {
|
|
273
|
+
if (i === te.GB28181) { this.PTZControlService = new Fe(e, t); } else { throw new Error("暂不支持该PTZ协议"); }
|
|
274
|
+
}
|
|
275
|
+
ptzControl(e, t) {
|
|
276
|
+
let i;
|
|
277
|
+
if (this.PTZControlService) { return (i = this.PTZControlService) == null ? void 0 : i.doPTZControl(e, t); }
|
|
278
|
+
throw new Error("PTZControlService is not initialized");
|
|
279
|
+
}
|
|
280
|
+
doPresetQuery() {
|
|
281
|
+
let e;
|
|
282
|
+
if (this.PTZControlService) { return (e = this.PTZControlService) == null ? void 0 : e.doPresetQuery(); }
|
|
283
|
+
throw new Error("PTZControlService is not initialized");
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
var ye = /* @__PURE__ */ ((o) => (o[o.H265WebPlayer = 0] = "H265WebPlayer", o))(ye || {});
|
|
287
|
+
const Oe = {
|
|
288
|
+
0: Ze
|
|
289
|
+
};
|
|
290
|
+
function Be(o, e) {
|
|
291
|
+
return new Oe[o](e);
|
|
292
|
+
}
|
|
293
|
+
const Ge = Symbol("$message");
|
|
294
|
+
function _e() {
|
|
295
|
+
return se(Ge);
|
|
296
|
+
}
|
|
297
|
+
const ge = Symbol("PlayerContext");
|
|
298
|
+
function Qe() {
|
|
299
|
+
return se(ge);
|
|
300
|
+
}
|
|
301
|
+
const We = { class: "close-btn" }, Ye = { class: "PTZ-operator-content" }, Ae = {
|
|
302
|
+
class: "direction ptz-left-up",
|
|
303
|
+
title: "左上"
|
|
304
|
+
}, Ke = {
|
|
305
|
+
class: "direction ptz-up",
|
|
306
|
+
title: "上"
|
|
307
|
+
}, Je = {
|
|
308
|
+
class: "direction ptz-right-up",
|
|
309
|
+
title: "右上"
|
|
310
|
+
}, Xe = {
|
|
311
|
+
class: "direction ptz-left",
|
|
312
|
+
title: "左"
|
|
313
|
+
}, qe = {
|
|
314
|
+
class: "direction ptz-right",
|
|
315
|
+
title: "右"
|
|
316
|
+
}, Ee = {
|
|
317
|
+
class: "direction ptz-left-down",
|
|
318
|
+
title: "左下"
|
|
319
|
+
}, et = {
|
|
320
|
+
class: "direction ptz-down",
|
|
321
|
+
title: "下"
|
|
322
|
+
}, tt = {
|
|
323
|
+
class: "direction ptz-right-down",
|
|
324
|
+
title: "右下"
|
|
325
|
+
}, nt = { class: "ptz-slider" }, ot = { class: "zoom" }, st = {
|
|
326
|
+
class: "zoomIn zoomButton",
|
|
327
|
+
title: "变焦放大"
|
|
328
|
+
}, lt = {
|
|
329
|
+
class: "zoomOut zoomButton",
|
|
330
|
+
title: "变焦缩小"
|
|
331
|
+
}, it = { class: "preset-list" }, at = { class: "index" }, rt = { class: "name" }, ct = { class: "operation" }, ut = /* @__PURE__ */ A({
|
|
332
|
+
__name: "index",
|
|
333
|
+
props: /* @__PURE__ */ ke({
|
|
334
|
+
round: { type: Boolean, default: !1 },
|
|
335
|
+
maxPresetCount: { default: 255 }
|
|
336
|
+
}, {
|
|
337
|
+
modelValue: { type: Boolean, default: !0 },
|
|
338
|
+
modelModifiers: {}
|
|
339
|
+
}),
|
|
340
|
+
emits: ["update:modelValue"],
|
|
341
|
+
setup(o) {
|
|
342
|
+
let x, N;
|
|
343
|
+
const e = o, t = Ie(o, "modelValue"), i = C(60), d = C([]), g = _e(), r = Qe();
|
|
344
|
+
r && r.deviceId && r.ptzControl && ((x = r.player) == null || x.enablePTZ(r.deviceId, r.nvrChannelId, te.GB28181), (N = r == null ? void 0 : r.player) == null || N.doPresetQuery().then((I) => {
|
|
345
|
+
let s = I.rows || [];
|
|
346
|
+
d.value = Array.from({ length: e.maxPresetCount }, (H, T) => {
|
|
347
|
+
const P = T + 1;
|
|
348
|
+
let h = s.find((_) => _.presetId === P);
|
|
349
|
+
return h ? {
|
|
350
|
+
...h,
|
|
351
|
+
enable: !0
|
|
352
|
+
} : {
|
|
353
|
+
presetId: P,
|
|
354
|
+
presetName: "预置点" + P,
|
|
355
|
+
enable: !1
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
}));
|
|
359
|
+
const R = C(), m = C();
|
|
360
|
+
Le(R, m, Pe(() => !0));
|
|
361
|
+
let S = !1;
|
|
362
|
+
function c(I, s = {}) {
|
|
363
|
+
let H;
|
|
364
|
+
I >= a.StopPTZ && I <= a.ZoomOut && (S = !0), (H = r == null ? void 0 : r.player) == null || H.ptzControl(I, { speed: i.value, ...s }).then((T) => {
|
|
365
|
+
g.success("命令下发成功,请稍等"), I === a.SetPreset && (d.value.find((P) => P.presetId === s.speed).enable = !0), I === a.RemovePreset && (d.value.find((P) => P.presetId === s.speed).enable = !1);
|
|
366
|
+
}).catch((T) => {
|
|
367
|
+
g.error(T);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
function D() {
|
|
371
|
+
let I;
|
|
372
|
+
S && ((I = r == null ? void 0 : r.player) == null || I.ptzControl(a.StopPTZ, { speed: 0 }), S = !1);
|
|
373
|
+
}
|
|
374
|
+
return window.addEventListener("mouseup", D), be(() => {
|
|
375
|
+
window.removeEventListener("mouseup", D);
|
|
376
|
+
}), (I, s) => {
|
|
377
|
+
const H = z("el-col"), T = z("el-slider"), P = z("el-row"), h = z("Location"), _ = z("el-icon"), V = z("Setting"), G = z("Delete");
|
|
378
|
+
return t.value ? (u(), f("div", {
|
|
379
|
+
key: 0,
|
|
380
|
+
class: "PTZ-operator",
|
|
381
|
+
ref_key: "container",
|
|
382
|
+
ref: R
|
|
383
|
+
}, [
|
|
384
|
+
l("div", {
|
|
385
|
+
class: "PTZ-operator-header",
|
|
386
|
+
ref_key: "drag",
|
|
387
|
+
ref: m
|
|
388
|
+
}, [
|
|
389
|
+
l("span", We, [
|
|
390
|
+
l("i", {
|
|
391
|
+
class: "iconfont icon-tubiao24_guanbi",
|
|
392
|
+
onClick: s[0] || (s[0] = (v) => t.value = !1)
|
|
393
|
+
})
|
|
394
|
+
])
|
|
395
|
+
], 512),
|
|
396
|
+
l("div", Ye, [
|
|
397
|
+
l("div", {
|
|
398
|
+
class: oe(["PTZ-panel", { round: I.round }])
|
|
399
|
+
}, [
|
|
400
|
+
l("div", Ae, [
|
|
401
|
+
l("i", {
|
|
402
|
+
class: "iconfont icon-_fangxiangjian",
|
|
403
|
+
onMousedown: s[1] || (s[1] = (v) => c(b(a).LeftUp))
|
|
404
|
+
}, null, 32)
|
|
405
|
+
]),
|
|
406
|
+
l("div", Ke, [
|
|
407
|
+
l("i", {
|
|
408
|
+
class: "iconfont icon-_fangxiangjian",
|
|
409
|
+
onMousedown: s[2] || (s[2] = (v) => c(b(a).Up))
|
|
410
|
+
}, null, 32)
|
|
411
|
+
]),
|
|
412
|
+
l("div", Je, [
|
|
413
|
+
l("i", {
|
|
414
|
+
class: "iconfont icon-_fangxiangjian",
|
|
415
|
+
onMousedown: s[3] || (s[3] = (v) => c(b(a).UpRight))
|
|
416
|
+
}, null, 32)
|
|
417
|
+
]),
|
|
418
|
+
l("div", Xe, [
|
|
419
|
+
l("i", {
|
|
420
|
+
class: "iconfont icon-_fangxiangjian",
|
|
421
|
+
onMousedown: s[4] || (s[4] = (v) => c(b(a).Left))
|
|
422
|
+
}, null, 32)
|
|
423
|
+
]),
|
|
424
|
+
s[12] || (s[12] = l("div", { class: "direction ptz-auto" }, null, -1)),
|
|
425
|
+
l("div", qe, [
|
|
426
|
+
l("i", {
|
|
427
|
+
class: "iconfont icon-_fangxiangjian",
|
|
428
|
+
onMousedown: s[5] || (s[5] = (v) => c(b(a).Right))
|
|
429
|
+
}, null, 32)
|
|
430
|
+
]),
|
|
431
|
+
l("div", Ee, [
|
|
432
|
+
l("i", {
|
|
433
|
+
class: "iconfont icon-_fangxiangjian",
|
|
434
|
+
onMousedown: s[6] || (s[6] = (v) => c(b(a).DownLeft))
|
|
435
|
+
}, null, 32)
|
|
436
|
+
]),
|
|
437
|
+
l("div", et, [
|
|
438
|
+
l("i", {
|
|
439
|
+
class: "iconfont icon-_fangxiangjian",
|
|
440
|
+
onMousedown: s[7] || (s[7] = (v) => c(b(a).Down))
|
|
441
|
+
}, null, 32)
|
|
442
|
+
]),
|
|
443
|
+
l("div", tt, [
|
|
444
|
+
l("i", {
|
|
445
|
+
class: "iconfont icon-_fangxiangjian",
|
|
446
|
+
onMousedown: s[8] || (s[8] = (v) => c(b(a).RightDown))
|
|
447
|
+
}, null, 32)
|
|
448
|
+
])
|
|
449
|
+
], 2),
|
|
450
|
+
l("div", nt, [
|
|
451
|
+
k(P, null, {
|
|
452
|
+
default: j(() => [
|
|
453
|
+
k(H, { span: 6 }, {
|
|
454
|
+
default: j(() => s[13] || (s[13] = [
|
|
455
|
+
l("span", { class: "label" }, "速度:", -1)
|
|
456
|
+
])),
|
|
457
|
+
_: 1,
|
|
458
|
+
__: [13]
|
|
459
|
+
}),
|
|
460
|
+
k(H, { span: 18 }, {
|
|
461
|
+
default: j(() => [
|
|
462
|
+
k(T, {
|
|
463
|
+
modelValue: i.value,
|
|
464
|
+
"onUpdate:modelValue": s[9] || (s[9] = (v) => i.value = v),
|
|
465
|
+
min: 1,
|
|
466
|
+
max: 254,
|
|
467
|
+
"show-input": "",
|
|
468
|
+
size: "small"
|
|
469
|
+
}, null, 8, ["modelValue"])
|
|
470
|
+
]),
|
|
471
|
+
_: 1
|
|
472
|
+
})
|
|
473
|
+
]),
|
|
474
|
+
_: 1
|
|
475
|
+
})
|
|
476
|
+
]),
|
|
477
|
+
l("div", ot, [
|
|
478
|
+
l("div", st, [
|
|
479
|
+
l("i", {
|
|
480
|
+
class: "iconfont icon-_gongnengjian_fangda",
|
|
481
|
+
onMousedown: s[10] || (s[10] = (v) => c(b(a).ZoomIn))
|
|
482
|
+
}, null, 32)
|
|
483
|
+
]),
|
|
484
|
+
l("div", lt, [
|
|
485
|
+
l("i", {
|
|
486
|
+
class: "iconfont icon-_gongnengjian_suoxiao",
|
|
487
|
+
onMousedown: s[11] || (s[11] = (v) => c(b(a).ZoomOut))
|
|
488
|
+
}, null, 32)
|
|
489
|
+
])
|
|
490
|
+
]),
|
|
491
|
+
l("div", it, [
|
|
492
|
+
(u(!0), f(le, null, ie(d.value, (v) => (u(), f("div", {
|
|
493
|
+
class: oe(["preset-item", { "is-disabled": !v.enable }]),
|
|
494
|
+
key: v.presetId
|
|
495
|
+
}, [
|
|
496
|
+
l("span", at, Y(v.presetId), 1),
|
|
497
|
+
l("span", rt, Y(v.presetName), 1),
|
|
498
|
+
l("span", ct, [
|
|
499
|
+
v.enable ? (u(), O(_, {
|
|
500
|
+
key: 0,
|
|
501
|
+
title: "调用",
|
|
502
|
+
onClick: (U) => c(b(a).GetPreset, { speed: v.presetId })
|
|
503
|
+
}, {
|
|
504
|
+
default: j(() => [
|
|
505
|
+
k(h)
|
|
506
|
+
]),
|
|
507
|
+
_: 2
|
|
508
|
+
}, 1032, ["onClick"])) : w("", !0),
|
|
509
|
+
k(_, {
|
|
510
|
+
title: "设置",
|
|
511
|
+
onClick: (U) => c(b(a).SetPreset, { speed: v.presetId })
|
|
512
|
+
}, {
|
|
513
|
+
default: j(() => [
|
|
514
|
+
k(V)
|
|
515
|
+
]),
|
|
516
|
+
_: 2
|
|
517
|
+
}, 1032, ["onClick"]),
|
|
518
|
+
v.enable ? (u(), O(_, {
|
|
519
|
+
key: 1,
|
|
520
|
+
title: "删除",
|
|
521
|
+
class: "danger",
|
|
522
|
+
onClick: (U) => c(b(a).RemovePreset, { speed: v.presetId })
|
|
523
|
+
}, {
|
|
524
|
+
default: j(() => [
|
|
525
|
+
k(G)
|
|
526
|
+
]),
|
|
527
|
+
_: 2
|
|
528
|
+
}, 1032, ["onClick"])) : w("", !0)
|
|
529
|
+
])
|
|
530
|
+
], 2))), 128))
|
|
531
|
+
])
|
|
532
|
+
])
|
|
533
|
+
], 512)) : w("", !0);
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
const K = (o, e) => {
|
|
538
|
+
const t = o.__vccOpts || o;
|
|
539
|
+
for (const [i, d] of e) { t[i] = d; }
|
|
540
|
+
return t;
|
|
541
|
+
}, dt = /* @__PURE__ */ K(ut, [["__scopeId", "data-v-be749143"]]), pt = { class: "bottom-container" }, ft = {
|
|
542
|
+
key: 0,
|
|
543
|
+
class: "video-bottom"
|
|
544
|
+
}, ht = { class: "center" }, vt = { key: 0 }, yt = {
|
|
545
|
+
key: 1,
|
|
546
|
+
class: "play-btn"
|
|
547
|
+
}, _t = { key: 2 }, gt = { class: "right" }, wt = {
|
|
548
|
+
key: 1,
|
|
549
|
+
class: "play-PTZ"
|
|
550
|
+
}, St = {
|
|
551
|
+
key: 2,
|
|
552
|
+
class: "play-screenrecording"
|
|
553
|
+
}, Ct = {
|
|
554
|
+
key: 3,
|
|
555
|
+
class: "play-screenshot"
|
|
556
|
+
}, kt = {
|
|
557
|
+
key: 4,
|
|
558
|
+
class: "volume-btn"
|
|
559
|
+
}, It = {
|
|
560
|
+
key: 5,
|
|
561
|
+
class: "close-btn"
|
|
562
|
+
}, Pt = {
|
|
563
|
+
key: 6,
|
|
564
|
+
class: "screen-btn"
|
|
565
|
+
}, bt = { class: "flow-control" }, mt = /* @__PURE__ */ A({
|
|
566
|
+
__name: "videoControl",
|
|
567
|
+
props: {
|
|
568
|
+
isPlay: { type: Boolean, default: !1 },
|
|
569
|
+
panelControl: { default: () => ({}) }
|
|
570
|
+
},
|
|
571
|
+
emits: ["ptzControlHandler", "pauseHandler", "resumeHandler", "forwardHandler", "backwardHandler", "rewindHandler", "fullScreenHandler", "snapshotHandler", "closeHandler", "volumeHandler"],
|
|
572
|
+
setup(o, { expose: e, emit: t }) {
|
|
573
|
+
const i = C(1), d = C(!1), g = C(!1), r = t;
|
|
574
|
+
function R() {
|
|
575
|
+
d.value = !0, r("pauseHandler");
|
|
576
|
+
}
|
|
577
|
+
function m() {
|
|
578
|
+
d.value = !1, r("resumeHandler");
|
|
579
|
+
}
|
|
580
|
+
function S() {
|
|
581
|
+
i.value = Math.min(4, i.value * 2), r("forwardHandler", i.value);
|
|
582
|
+
}
|
|
583
|
+
function c() {
|
|
584
|
+
i.value = Math.max(0.25, i.value / 2), r("rewindHandler", i.value);
|
|
585
|
+
}
|
|
586
|
+
function D(h) {
|
|
587
|
+
r("rewindHandler", h);
|
|
588
|
+
}
|
|
589
|
+
const x = C(0);
|
|
590
|
+
function N() {
|
|
591
|
+
x.value = 1 - x.value, r("volumeHandler", x.value);
|
|
592
|
+
}
|
|
593
|
+
function I(h, _) {
|
|
594
|
+
r("ptzControlHandler", h, _);
|
|
595
|
+
}
|
|
596
|
+
function s() {
|
|
597
|
+
r("fullScreenHandler");
|
|
598
|
+
}
|
|
599
|
+
function H() {
|
|
600
|
+
r("closeHandler");
|
|
601
|
+
}
|
|
602
|
+
function T() {
|
|
603
|
+
r("snapshotHandler");
|
|
604
|
+
}
|
|
605
|
+
function P() {
|
|
606
|
+
d.value = !1, g.value = !1, x.value = 0, i.value = 1;
|
|
607
|
+
}
|
|
608
|
+
return e({
|
|
609
|
+
reset: P
|
|
610
|
+
}), (h, _) => {
|
|
611
|
+
let Q, W, J, X, q, E, F;
|
|
612
|
+
const V = z("el-option"), G = z("el-select"), v = z("SwitchButton"), U = z("el-icon");
|
|
613
|
+
return u(), f("div", pt, [
|
|
614
|
+
h.isPlay || d.value && ((Q = h.panelControl) != null && Q.panelControl) ? (u(), f("div", ft, [
|
|
615
|
+
_[3] || (_[3] = l("div", { class: "left" }, null, -1)),
|
|
616
|
+
l("div", ht, [
|
|
617
|
+
h.panelControl.playControl ? (u(), f("span", vt, [
|
|
618
|
+
l("i", {
|
|
619
|
+
title: "慢放",
|
|
620
|
+
class: "iconfont icon-kuaitui",
|
|
621
|
+
onClick: c
|
|
622
|
+
})
|
|
623
|
+
])) : w("", !0),
|
|
624
|
+
h.panelControl.playControl ? (u(), f("span", yt, [
|
|
625
|
+
d.value ? (u(), f("i", {
|
|
626
|
+
key: 1,
|
|
627
|
+
title: "播放",
|
|
628
|
+
class: "iconfont icon-bofangsanjiaoxing",
|
|
629
|
+
onClick: m
|
|
630
|
+
})) : (u(), f("i", {
|
|
631
|
+
key: 0,
|
|
632
|
+
title: "暂停",
|
|
633
|
+
class: "iconfont icon-zantingtingzhi",
|
|
634
|
+
onClick: R
|
|
635
|
+
}))
|
|
636
|
+
])) : w("", !0),
|
|
637
|
+
h.panelControl.playControl ? (u(), f("span", _t, [
|
|
638
|
+
l("i", {
|
|
639
|
+
title: "快进",
|
|
640
|
+
class: "iconfont icon-kuaijin",
|
|
641
|
+
onClick: S
|
|
642
|
+
})
|
|
643
|
+
])) : w("", !0)
|
|
644
|
+
]),
|
|
645
|
+
l("div", gt, [
|
|
646
|
+
h.panelControl.playControl ? (u(), O(G, {
|
|
647
|
+
key: 0,
|
|
648
|
+
style: { width: "100px" },
|
|
649
|
+
title: "播放倍率",
|
|
650
|
+
modelValue: i.value,
|
|
651
|
+
"onUpdate:modelValue": _[0] || (_[0] = (B) => i.value = B),
|
|
652
|
+
onChange: D
|
|
653
|
+
}, {
|
|
654
|
+
default: j(() => [
|
|
655
|
+
k(V, {
|
|
656
|
+
label: "0.25x",
|
|
657
|
+
value: 0.25
|
|
658
|
+
}),
|
|
659
|
+
k(V, {
|
|
660
|
+
label: "0.5x",
|
|
661
|
+
value: 0.5
|
|
662
|
+
}),
|
|
663
|
+
k(V, {
|
|
664
|
+
label: "1x",
|
|
665
|
+
value: 1
|
|
666
|
+
}),
|
|
667
|
+
k(V, {
|
|
668
|
+
label: "2x",
|
|
669
|
+
value: 2
|
|
670
|
+
}),
|
|
671
|
+
k(V, {
|
|
672
|
+
label: "4x",
|
|
673
|
+
value: 4
|
|
674
|
+
})
|
|
675
|
+
]),
|
|
676
|
+
_: 1
|
|
677
|
+
}, 8, ["modelValue"])) : w("", !0),
|
|
678
|
+
(W = h.panelControl) != null && W.ptzControl ? (u(), f("span", wt, [
|
|
679
|
+
l("i", {
|
|
680
|
+
class: "iconfont icon-_jiankongqiuji",
|
|
681
|
+
onClick: _[1] || (_[1] = (B) => g.value = !g.value),
|
|
682
|
+
title: "云台控制"
|
|
683
|
+
})
|
|
684
|
+
])) : w("", !0),
|
|
685
|
+
(J = h.panelControl) != null && J.record ? (u(), f("span", St, [
|
|
686
|
+
l("i", {
|
|
687
|
+
class: "iconfont icon-_shishikuaizhao_daixuan",
|
|
688
|
+
onClick: s,
|
|
689
|
+
title: "录像"
|
|
690
|
+
})
|
|
691
|
+
])) : w("", !0),
|
|
692
|
+
(X = h.panelControl) != null && X.capture ? (u(), f("span", Ct, [
|
|
693
|
+
l("i", {
|
|
694
|
+
class: "iconfont icon-gw-icon-tab-tupian",
|
|
695
|
+
onClick: T,
|
|
696
|
+
title: "截图"
|
|
697
|
+
})
|
|
698
|
+
])) : w("", !0),
|
|
699
|
+
(q = h.panelControl) != null && q.volume ? (u(), f("span", kt, [
|
|
700
|
+
x.value === 0 ? (u(), f("i", {
|
|
701
|
+
key: 0,
|
|
702
|
+
class: "iconfont icon-jingyin",
|
|
703
|
+
onClick: N,
|
|
704
|
+
title: "音量"
|
|
705
|
+
})) : (u(), f("i", {
|
|
706
|
+
key: 1,
|
|
707
|
+
class: "iconfont icon-shengyin1",
|
|
708
|
+
onClick: N,
|
|
709
|
+
title: "音量"
|
|
710
|
+
}))
|
|
711
|
+
])) : w("", !0),
|
|
712
|
+
(E = h.panelControl) != null && E.close ? (u(), f("span", It, [
|
|
713
|
+
k(U, {
|
|
714
|
+
onClick: H,
|
|
715
|
+
title: "关闭"
|
|
716
|
+
}, {
|
|
717
|
+
default: j(() => [
|
|
718
|
+
k(v)
|
|
719
|
+
]),
|
|
720
|
+
_: 1
|
|
721
|
+
})
|
|
722
|
+
])) : w("", !0),
|
|
723
|
+
(F = h.panelControl) != null && F.fullScreen ? (u(), f("span", Pt, [
|
|
724
|
+
l("i", {
|
|
725
|
+
class: "iconfont icon-quanping",
|
|
726
|
+
onClick: s,
|
|
727
|
+
title: "全屏"
|
|
728
|
+
})
|
|
729
|
+
])) : w("", !0)
|
|
730
|
+
])
|
|
731
|
+
])) : w("", !0),
|
|
732
|
+
l("div", bt, [
|
|
733
|
+
k(dt, {
|
|
734
|
+
modelValue: g.value,
|
|
735
|
+
"onUpdate:modelValue": _[2] || (_[2] = (B) => g.value = B),
|
|
736
|
+
round: "",
|
|
737
|
+
onPtzControl: I
|
|
738
|
+
}, null, 8, ["modelValue"])
|
|
739
|
+
])
|
|
740
|
+
]);
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
});
|
|
744
|
+
const Ht = /* @__PURE__ */ K(mt, [["__scopeId", "data-v-fca36cac"]]), Rt = {
|
|
745
|
+
key: 0,
|
|
746
|
+
class: "video-info"
|
|
747
|
+
}, $t = { class: "susscessed" }, zt = /* @__PURE__ */ A({
|
|
748
|
+
__name: "videoPlayInfo",
|
|
749
|
+
props: {
|
|
750
|
+
playInfo: Array,
|
|
751
|
+
isPlayInfo: Boolean
|
|
752
|
+
},
|
|
753
|
+
setup(o) {
|
|
754
|
+
const e = o;
|
|
755
|
+
return (t, i) => o.isPlayInfo ? (u(), f("div", Rt, [
|
|
756
|
+
(u(!0), f(le, null, ie(e.playInfo, (d, g) => (u(), f("p", $t, Y(d), 1))), 256))
|
|
757
|
+
])) : w("", !0);
|
|
758
|
+
}
|
|
759
|
+
});
|
|
760
|
+
const Tt = /* @__PURE__ */ K(zt, [["__scopeId", "data-v-59ca949f"]]);
|
|
761
|
+
class xt extends he {
|
|
762
|
+
constructor(t, i) {
|
|
763
|
+
super("/mediaPlatformPlay");
|
|
764
|
+
p(this, "eventName", "ShowLog");
|
|
765
|
+
p(this, "invokePlayMethod", "Play");
|
|
766
|
+
p(this, "onShowLog", () => {
|
|
767
|
+
console.log("showlog");
|
|
768
|
+
});
|
|
769
|
+
this.streamId = t, this.onConnectedSuccess(), this.onShowLogMethod(), this.onShowLog = i;
|
|
770
|
+
}
|
|
771
|
+
inVokePlay() {
|
|
772
|
+
this.signalR.invoke(this.invokePlayMethod, this.streamId);
|
|
773
|
+
}
|
|
774
|
+
onShowLogMethod() {
|
|
775
|
+
this.signalR.on(this.eventName, (t) => {
|
|
776
|
+
this.onShowLog(t, this.connectionId);
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
onConnectedSuccess() {
|
|
780
|
+
this.signalR.on("ConnectionSucceeded", (t) => {
|
|
781
|
+
this.streamId && this.inVokePlay();
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
stop() {
|
|
785
|
+
this.signalR.off(this.eventName), this.onShowLog = () => {
|
|
786
|
+
console.log("showLog");
|
|
787
|
+
}, super.stop();
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
const Lt = Symbol("MultiScreenPlayerControllerKey");
|
|
791
|
+
function Vt() {
|
|
792
|
+
let o = se(Lt);
|
|
793
|
+
return o === void 0 && (o = {
|
|
794
|
+
addScreen(e, t) {
|
|
795
|
+
return new xt(...t);
|
|
796
|
+
}
|
|
797
|
+
}), o;
|
|
798
|
+
}
|
|
799
|
+
function Mt() {
|
|
800
|
+
const o = C([]);
|
|
801
|
+
function e(t) {
|
|
802
|
+
if (!t.length) {
|
|
803
|
+
console.error("没有流信息");
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
o.value = t;
|
|
807
|
+
}
|
|
808
|
+
return {
|
|
809
|
+
playStreamIdList: o,
|
|
810
|
+
setPlayStreamIdList: e
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
const jt = { class: "context" }, Ft = {
|
|
814
|
+
key: 0,
|
|
815
|
+
class: "title"
|
|
816
|
+
}, Dt = { class: "title-text" }, Nt = ["id"], Ut = { class: "player-container" }, Zt = ["id"], Ot = ["id"], Bt = 3e4, Gt = /* @__PURE__ */ A({
|
|
817
|
+
__name: "index",
|
|
818
|
+
props: {
|
|
819
|
+
id: { default: 0 },
|
|
820
|
+
selected: { default: 0 },
|
|
821
|
+
panelControl: { default: () => ({}) }
|
|
822
|
+
},
|
|
823
|
+
setup(o) {
|
|
824
|
+
const e = C(), t = o, i = _e(), { proxy: d } = fe(), g = C(!1), r = C(!1), R = C(!1), m = C("播放时间较长,请重试!"), S = me({
|
|
825
|
+
id: "",
|
|
826
|
+
// 当前播放流id
|
|
827
|
+
protocol: "",
|
|
828
|
+
// 当前播放流协议,
|
|
829
|
+
playName: ""
|
|
830
|
+
// 播放设备名称
|
|
831
|
+
}), c = {
|
|
832
|
+
deviceId: 0,
|
|
833
|
+
nvrChannelId: 0,
|
|
834
|
+
ptzControl: !1,
|
|
835
|
+
player: null
|
|
836
|
+
}, D = C(!1);
|
|
837
|
+
He(ge, c);
|
|
838
|
+
const { playStreamIdList: x, setPlayStreamIdList: N } = Mt(), I = Vt();
|
|
839
|
+
let s = null;
|
|
840
|
+
const H = C([]), T = C(!1);
|
|
841
|
+
let P = 0, h = -1, _ = -1;
|
|
842
|
+
d.$bus.off("H265web" + (t == null ? void 0 : t.id)), d.$bus.on("H265web" + (t == null ? void 0 : t.id), (n) => {
|
|
843
|
+
let y, $, M, Z;
|
|
844
|
+
if (ee(), B(), (y = e.value) == null || y.reset(), !n.length) {
|
|
845
|
+
console.error("没有流信息");
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
if (N(n), ($ = n[0]) != null && $.tips) {
|
|
849
|
+
F((M = n[0]) == null ? void 0 : M.tips);
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
if ((Z = n[0]) != null && Z.id) { S.playName = n[0].title, S.id = n[0].id, S.protocol = n[0].protocol, c.deviceId = n[0].deviceId, c.nvrChannelId = n[0].nvrChannelId, c.ptzControl = n[0].ptzControl === te.GB28181, ne(), Q(n[0].id); } else {
|
|
853
|
+
let L = n[0].url;
|
|
854
|
+
L && V(L);
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
function V(n) {
|
|
858
|
+
console.log("播放流地址:" + n), E(), g.value = !0, performance.now(), console.log(t.id), c.player = Be(ye.H265WebPlayer, {
|
|
859
|
+
player: "glplayer" + t.id
|
|
860
|
+
}), D.value = !0;
|
|
861
|
+
try {
|
|
862
|
+
c.player.init(n), c.player.eventsOn(q()), c.player.start(), c.player.play();
|
|
863
|
+
} catch (y) {
|
|
864
|
+
console.log(y);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function G() {
|
|
868
|
+
let n = S.id;
|
|
869
|
+
n && U(n);
|
|
870
|
+
}
|
|
871
|
+
function v(n, y) {
|
|
872
|
+
if (s) {
|
|
873
|
+
if (s.connectionId === "") {
|
|
874
|
+
console.error("当前窗口未连接成功");
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
if (s.connectionId !== y) {
|
|
878
|
+
console.error("现在的ID: ", s.connectionId), console.error("接收到的ID: ", y);
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
n && ((!n.result || n.playStatus == 80 || n.playStatus == 90) && s.stop(), (!n.result || n.playStatus == 90) && F("播放失败!"), P < n.duration && (P = n.duration), (n.playStatus == 60 && n.protocol == S.protocol || n.playStatus == 100) && (n.url ? V(n.url) : F("目标地址为空,播放失败!")), n.message && n.duration && (n.playStatus == 60 && n.protocol != S.protocol || H.value.push(n.message + "(" + n.duration + "ms)")));
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
function U(n) {
|
|
885
|
+
n ? (ee(), ne(), Q(n)) : F("播放失败,流地址不存在!");
|
|
886
|
+
}
|
|
887
|
+
function Q(n) {
|
|
888
|
+
s = I.addScreen(t.id, [n, v]), s.start();
|
|
889
|
+
}
|
|
890
|
+
function W(n) {
|
|
891
|
+
R.value = n;
|
|
892
|
+
}
|
|
893
|
+
function J() {
|
|
894
|
+
F("");
|
|
895
|
+
}
|
|
896
|
+
function X() {
|
|
897
|
+
_ && clearTimeout(_), c.player && (console.log("关闭播放器"), c.player.destroy(), c.player = null, r.value = !1, D.value = !1);
|
|
898
|
+
}
|
|
899
|
+
function q() {
|
|
900
|
+
return {
|
|
901
|
+
onPlayState: (n) => {
|
|
902
|
+
r.value = n;
|
|
903
|
+
},
|
|
904
|
+
onPerformance: (n) => {
|
|
905
|
+
g.value = !1, r.value = !0;
|
|
906
|
+
const y = n;
|
|
907
|
+
H.value.push("播放器加载完成时间: " + y.toFixed(4) + "ms"), H.value.push("播放总耗时: " + (P + y).toFixed(4) + "ms"), _ && clearTimeout(_), h && clearTimeout(h), h = window.setTimeout(() => {
|
|
908
|
+
T.value = !1, h = -1;
|
|
909
|
+
}, 5e3);
|
|
910
|
+
},
|
|
911
|
+
onLoadFinish: () => {
|
|
912
|
+
let $, M, Z, L, re, ce, ue, de;
|
|
913
|
+
($ = c.player) == null || $.setVoice(0);
|
|
914
|
+
let n = (M = c.player) == null ? void 0 : M.instance.mediaInfo(), y = "h265";
|
|
915
|
+
((Z = n == null ? void 0 : n.meta) == null ? void 0 : Z.isHEVC) === !1 ? (console.log(`\r
|
|
916
|
+
onLoadFinish is Not HEVC/H.265`), y = "h264") : console.log(`\r
|
|
917
|
+
onLoadFinish is HEVC/H.265`), console.log(`\r
|
|
918
|
+
onLoadFinish media Codec:` + y), console.log(`\r
|
|
919
|
+
onLoadFinish media FPS:` + ((L = n == null ? void 0 : n.meta) == null ? void 0 : L.fps)), console.log(`\r
|
|
920
|
+
onLoadFinish media size:` + ((ce = (re = n == null ? void 0 : n.meta) == null ? void 0 : re.size) == null ? void 0 : ce.width) + "x" + ((de = (ue = n == null ? void 0 : n.meta) == null ? void 0 : ue.size) == null ? void 0 : de.height));
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
function E() {
|
|
925
|
+
_ && clearTimeout(_), _ = window.setTimeout(() => {
|
|
926
|
+
r.value || F("播放超时!"), _ = -1;
|
|
927
|
+
}, Bt);
|
|
928
|
+
}
|
|
929
|
+
function F(n) {
|
|
930
|
+
W(!0), g.value = !1, m.value = n, ee();
|
|
931
|
+
}
|
|
932
|
+
function B() {
|
|
933
|
+
S.playName = "", S.id = "";
|
|
934
|
+
}
|
|
935
|
+
const ae = {
|
|
936
|
+
// 暂停
|
|
937
|
+
pauseHandler: function() {
|
|
938
|
+
let n, y, $;
|
|
939
|
+
(y = (n = c.player) == null ? void 0 : n.instance) != null && y.isPlaying() && (($ = c.player) == null || $.pause());
|
|
940
|
+
},
|
|
941
|
+
// 播放
|
|
942
|
+
resumeHandler: function() {
|
|
943
|
+
let n;
|
|
944
|
+
(n = c.player) == null || n.play();
|
|
945
|
+
},
|
|
946
|
+
// 音量
|
|
947
|
+
volumeHandler: function(n) {
|
|
948
|
+
let y;
|
|
949
|
+
(y = c.player) == null || y.setVoice(n);
|
|
950
|
+
},
|
|
951
|
+
// 全屏
|
|
952
|
+
fullScreenHandler: function() {
|
|
953
|
+
let n;
|
|
954
|
+
(n = c.player) == null || n.fullScreen();
|
|
955
|
+
},
|
|
956
|
+
// 截图
|
|
957
|
+
snapshotHandler: function() {
|
|
958
|
+
let n;
|
|
959
|
+
(n = c.player) == null || n.snapshot();
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
function we(n, y) {
|
|
963
|
+
let $;
|
|
964
|
+
($ = c.player) == null || $.ptzControl(n, y).then((M) => {
|
|
965
|
+
i.success("命令下发成功,请稍等");
|
|
966
|
+
}).catch((M) => {
|
|
967
|
+
i.error(M);
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
function ee() {
|
|
971
|
+
X(), s == null || s.stop(), s = null;
|
|
972
|
+
}
|
|
973
|
+
function ne() {
|
|
974
|
+
g.value = !0, P = 0, W(!1), H.value.length = 0, T.value = !0, r.value = !1;
|
|
975
|
+
}
|
|
976
|
+
return Re(() => {
|
|
977
|
+
ne(), ee();
|
|
978
|
+
}), (n, y) => {
|
|
979
|
+
const $ = z("el-option"), M = z("el-select"), Z = $e("loading");
|
|
980
|
+
return u(), f("div", jt, [
|
|
981
|
+
t.panelControl.title ? (u(), f("div", Ft, [
|
|
982
|
+
l("span", Dt, Y(S.playName), 1)
|
|
983
|
+
])) : w("", !0),
|
|
984
|
+
R.value && !r.value ? (u(), f("div", {
|
|
985
|
+
key: 1,
|
|
986
|
+
id: "replay" + n.id,
|
|
987
|
+
class: "replayVideo"
|
|
988
|
+
}, [
|
|
989
|
+
l("i", {
|
|
990
|
+
class: "iconfont icon-_bofang",
|
|
991
|
+
onClick: G
|
|
992
|
+
}),
|
|
993
|
+
l("p", null, Y(m.value), 1)
|
|
994
|
+
], 8, Nt)) : w("", !0),
|
|
995
|
+
ze((u(), f("div", Ut, [
|
|
996
|
+
l("div", {
|
|
997
|
+
id: "glplayer" + n.id,
|
|
998
|
+
class: oe(["glplayer", { transparent: r.value }])
|
|
999
|
+
}, null, 10, Zt)
|
|
1000
|
+
])), [
|
|
1001
|
+
[Z, g.value]
|
|
1002
|
+
]),
|
|
1003
|
+
n.panelControl.streamList ? (u(), f("div", {
|
|
1004
|
+
key: 2,
|
|
1005
|
+
class: "stream-list",
|
|
1006
|
+
id: "stream-list" + n.id
|
|
1007
|
+
}, [
|
|
1008
|
+
b(x).length > 0 ? (u(), O(M, {
|
|
1009
|
+
key: 0,
|
|
1010
|
+
modelValue: S.id,
|
|
1011
|
+
"onUpdate:modelValue": y[0] || (y[0] = (L) => S.id = L),
|
|
1012
|
+
onChange: U,
|
|
1013
|
+
"append-to": "#stream-list" + n.id
|
|
1014
|
+
}, {
|
|
1015
|
+
prefix: j(() => y[1] || (y[1] = [
|
|
1016
|
+
l("i", { class: "iconfont icon-gw-icon-diqiu" }, null, -1)
|
|
1017
|
+
])),
|
|
1018
|
+
default: j(() => [
|
|
1019
|
+
(u(!0), f(le, null, ie(b(x), (L) => (u(), O($, {
|
|
1020
|
+
label: L.name,
|
|
1021
|
+
value: L.id,
|
|
1022
|
+
key: L.protocol
|
|
1023
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
1024
|
+
]),
|
|
1025
|
+
_: 1
|
|
1026
|
+
}, 8, ["modelValue", "append-to"])) : w("", !0)
|
|
1027
|
+
], 8, Ot)) : w("", !0),
|
|
1028
|
+
n.panelControl.panelControl && D.value ? (u(), O(Ht, {
|
|
1029
|
+
key: 3,
|
|
1030
|
+
ref_key: "control",
|
|
1031
|
+
ref: e,
|
|
1032
|
+
isPlay: r.value,
|
|
1033
|
+
panelControl: n.panelControl,
|
|
1034
|
+
onFullScreenHandler: ae.fullScreenHandler,
|
|
1035
|
+
onVolumeHandler: ae.volumeHandler,
|
|
1036
|
+
onCloseHandler: J,
|
|
1037
|
+
onPtzControlHandler: we
|
|
1038
|
+
}, null, 8, ["isPlay", "panelControl", "onFullScreenHandler", "onVolumeHandler"])) : w("", !0),
|
|
1039
|
+
n.panelControl.beforePlayInfo ? (u(), O(Tt, {
|
|
1040
|
+
key: 4,
|
|
1041
|
+
playInfo: H.value,
|
|
1042
|
+
isPlayInfo: T.value
|
|
1043
|
+
}, null, 8, ["playInfo", "isPlayInfo"])) : w("", !0)
|
|
1044
|
+
]);
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
});
|
|
1048
|
+
const Qt = /* @__PURE__ */ K(Gt, [["__scopeId", "data-v-c9e3aa55"]]), Wt = { class: "container" }, Yt = /* @__PURE__ */ A({
|
|
1049
|
+
__name: "h265webContainer",
|
|
1050
|
+
props: {
|
|
1051
|
+
streamId: {},
|
|
1052
|
+
url: {},
|
|
1053
|
+
panelControl: {}
|
|
1054
|
+
},
|
|
1055
|
+
setup(o) {
|
|
1056
|
+
const { proxy: e } = fe(), t = o;
|
|
1057
|
+
Te(() => {
|
|
1058
|
+
i();
|
|
1059
|
+
});
|
|
1060
|
+
function i() {
|
|
1061
|
+
let d = [{ id: -1, url: "", name: "mp4", value: "", title: "" }];
|
|
1062
|
+
t != null && t.streamId ? d[0].id = t.streamId : d[0].url = t == null ? void 0 : t.url, e.$bus.emit("H265web100", d);
|
|
1063
|
+
}
|
|
1064
|
+
return pe(() => t == null ? void 0 : t.streamId, (d) => {
|
|
1065
|
+
d && i();
|
|
1066
|
+
}), pe(() => t == null ? void 0 : t.url, (d) => {
|
|
1067
|
+
d && i();
|
|
1068
|
+
}), (d, g) => (u(), f("div", Wt, [
|
|
1069
|
+
k(Qt, {
|
|
1070
|
+
panelControl: t == null ? void 0 : t.panelControl,
|
|
1071
|
+
id: 100,
|
|
1072
|
+
selected: 100
|
|
1073
|
+
}, null, 8, ["panelControl"])
|
|
1074
|
+
]));
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
const qt = /* @__PURE__ */ K(Yt, [["__scopeId", "data-v-44205cca"]]);
|
|
1078
|
+
export {
|
|
1079
|
+
qt as default
|
|
1080
|
+
};
|