@cloud-app-dev/vidc 3.0.8 → 3.0.11
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/.prettierrc +1 -1
- package/.umirc.ts +3 -2
- package/clear-cache.sh +4 -0
- package/es/CustomRenderSelect/index.css +20 -0
- package/es/CustomRenderSelect/index.d.ts +10 -0
- package/es/CustomRenderSelect/index.js +73 -0
- package/es/List/DynamicGridList/index.js +4 -3
- package/es/List/DynamicList/utils.d.ts +1 -1
- package/es/List/DynamicList/utils.js +1 -1
- package/es/List/GridList/Demo.js +1 -1
- package/es/Player/api/index.d.ts +4 -4
- package/es/Player/contraller_bar/contraller_event.js +1 -1
- package/es/Player/demo.js +36 -12
- package/es/Player/event/errorEvent.d.ts +2 -2
- package/es/Player/event/errorEvent.js +2 -2
- package/es/Player/live_heart.d.ts +4 -2
- package/es/Player/live_heart.js +24 -12
- package/es/Player/message.js +4 -4
- package/es/Player/player.d.ts +4 -4
- package/es/Player/segment_player.js +1 -0
- package/es/Player/segment_timeline.d.ts +2 -1
- package/es/Player/segment_timeline.js +7 -12
- package/es/Player/single_player.js +2 -1
- package/es/Player/style/iconfont.css +150 -33
- package/es/Player/style/iconfont.ttf +0 -0
- package/es/Player/style/iconfont.woff +0 -0
- package/es/Player/style/iconfont.woff2 +0 -0
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +17 -22
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +67 -14
- package/es/ScreenPlayer/LiveTools.d.ts +3 -1
- package/es/ScreenPlayer/LiveTools.js +69 -33
- package/es/ScreenPlayer/PlayerWithExt.d.ts +2 -2
- package/es/ScreenPlayer/PlayerWithExt.js +3 -2
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +65 -31
- package/es/ScreenPlayer/RecordTools.d.ts +2 -1
- package/es/ScreenPlayer/RecordTools.js +46 -36
- package/es/ScreenPlayer/ScreenSelect.js +41 -20
- package/es/ScreenPlayer/TimeMode.js +8 -2
- package/es/ScreenPlayer/TimeSlider.js +3 -2
- package/es/ScreenPlayer/demo.js +4 -4
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/index.css +29 -10
- package/es/ScreenPlayer/interface.d.ts +24 -4
- package/es/ScreenPlayer/utils.d.ts +1 -0
- package/es/ScreenPlayer/utils.js +17 -8
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/package.json +2 -2
- package/release-build.sh +3 -0
|
@@ -1,62 +1,179 @@
|
|
|
1
1
|
@font-face {
|
|
2
|
-
font-family:
|
|
3
|
-
src: url('
|
|
2
|
+
font-family: "lm-player-iconfont"; /* Project id 1153292 */
|
|
3
|
+
src: url('iconfont.woff2?t=1661511384224') format('woff2'),
|
|
4
|
+
url('iconfont.woff?t=1661511384224') format('woff'),
|
|
5
|
+
url('iconfont.ttf?t=1661511384224') format('truetype');
|
|
4
6
|
}
|
|
7
|
+
|
|
5
8
|
.lm-player-iconfont {
|
|
6
|
-
font-family:
|
|
9
|
+
font-family: "lm-player-iconfont" !important;
|
|
7
10
|
font-size: 16px;
|
|
8
11
|
font-style: normal;
|
|
9
12
|
-webkit-font-smoothing: antialiased;
|
|
10
13
|
-moz-osx-font-smoothing: grayscale;
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
|
|
16
|
+
.lm-player-xiazai:before {
|
|
17
|
+
content: "\e6d0";
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
|
|
20
|
+
.lm-player-bofang:before {
|
|
21
|
+
content: "\e6cf";
|
|
17
22
|
}
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
|
|
24
|
+
.lm-player-tingzhi:before {
|
|
25
|
+
content: "\e6ce";
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
|
|
28
|
+
.lm-player-quanbuguanbi:before {
|
|
29
|
+
content: "\e6cc";
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
|
|
32
|
+
.lm-player-huamianshiying:before {
|
|
33
|
+
content: "\e6cb";
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
|
|
36
|
+
.lm-player-quanping:before {
|
|
37
|
+
content: "\e6c6";
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
.lm-player-a-guanbi_close-one11:before {
|
|
41
|
+
content: "\e623";
|
|
32
42
|
}
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
|
|
44
|
+
.lm-player-lunxunkaishi:before {
|
|
45
|
+
content: "\e6c3";
|
|
35
46
|
}
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
|
|
48
|
+
.lm-player-fenping16:before {
|
|
49
|
+
content: "\e6c5";
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
|
|
52
|
+
.lm-player-xiangji1fill:before {
|
|
53
|
+
content: "\e77e";
|
|
41
54
|
}
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
|
|
56
|
+
.lm-player-M_Device_jiazaishibai:before {
|
|
57
|
+
content: "\e6de";
|
|
44
58
|
}
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
|
|
60
|
+
.lm-player-M_Bar_CloudAuto:before {
|
|
61
|
+
content: "\e6c9";
|
|
47
62
|
}
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
|
|
64
|
+
.lm-player-S_Box_VideoCloud:before {
|
|
65
|
+
content: "\e6ca";
|
|
50
66
|
}
|
|
67
|
+
|
|
68
|
+
.lm-player-S_Bar_LatLongYes:before {
|
|
69
|
+
content: "\e792";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.lm-player-S_Device_kuaijin:before {
|
|
73
|
+
content: "\e6c7";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.lm-player-S_Device_shezhi:before {
|
|
77
|
+
content: "\e6c8";
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.lm-player-S_View_Playerpley:before {
|
|
81
|
+
content: "\e827";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.lm-player-S_View_RotateRight:before {
|
|
85
|
+
content: "\e828";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.lm-player-S_View_ScreenSizeFull:before {
|
|
89
|
+
content: "\e82d";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.lm-player-S_View_SoundMiddle:before {
|
|
93
|
+
content: "\e835";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.lm-player-S_Edit_LoadDown:before {
|
|
97
|
+
content: "\e7b6";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.lm-player-S_Edit_Reset:before {
|
|
101
|
+
content: "\e7c3";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.lm-player-S_View_SearchBox:before {
|
|
105
|
+
content: "\e833";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.lm-player-S_View_PlayerPlay1:before {
|
|
109
|
+
content: "\e6b7";
|
|
110
|
+
}
|
|
111
|
+
|
|
51
112
|
.lm-player-YesorNo_No_Dark:before {
|
|
52
|
-
content:
|
|
113
|
+
content: "\e6dd";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.lm-player-Refresh_Main:before {
|
|
117
|
+
content: "\e687";
|
|
53
118
|
}
|
|
119
|
+
|
|
54
120
|
.lm-player-SearchBox:before {
|
|
55
|
-
content:
|
|
121
|
+
content: "\e706";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.lm-player-ZoomIn_Main:before {
|
|
125
|
+
content: "\e663";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.lm-player-ZoomDefault_Main:before {
|
|
129
|
+
content: "\e664";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.lm-player-ZoomOut_Main:before {
|
|
133
|
+
content: "\e665";
|
|
56
134
|
}
|
|
135
|
+
|
|
57
136
|
.lm-player-PrevFast:before {
|
|
58
|
-
content:
|
|
137
|
+
content: "\e71f";
|
|
59
138
|
}
|
|
139
|
+
|
|
60
140
|
.lm-player-NextFast_Light:before {
|
|
61
|
-
content:
|
|
141
|
+
content: "\e720";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.lm-player-volume-close:before {
|
|
145
|
+
content: "\e602";
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.lm-player-volume-normal-fuben:before {
|
|
149
|
+
content: "\e604";
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.lm-player-volume-max:before {
|
|
153
|
+
content: "\e605";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.lm-player-ExitFull_Main:before {
|
|
157
|
+
content: "\e68e";
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.lm-player-Full_Main:before {
|
|
161
|
+
content: "\e690";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.lm-player-Loading:before {
|
|
165
|
+
content: "\e65d";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.lm-player-Pause_Main:before {
|
|
169
|
+
content: "\e652";
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.lm-player-Play_Main:before {
|
|
173
|
+
content: "\e654";
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.lm-player-PlaySource:before {
|
|
177
|
+
content: "\e6cd";
|
|
62
178
|
}
|
|
179
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/es/Player/util.d.ts
CHANGED
package/es/Player/util.js
CHANGED
|
@@ -3,7 +3,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3
3
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
4
|
|
|
5
5
|
import { __awaiter } from "tslib";
|
|
6
|
-
import Flvjs from 'flv.
|
|
6
|
+
import Flvjs from '@cloud-app-dev/flv.js';
|
|
7
7
|
import Hls from 'hls.js';
|
|
8
8
|
import Events from './event/eventName';
|
|
9
9
|
/**
|
|
@@ -39,21 +39,17 @@ export function createFlvPlayer(video, url, isLive, flvConfig) {
|
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
Flvjs.LoggingControl.enableDebug = false;
|
|
43
|
+
Flvjs.LoggingControl.enableVerbose = false;
|
|
44
|
+
Flvjs.LoggingControl.enableWarn = false;
|
|
42
45
|
var mediaDataSource = Object.assign({
|
|
43
46
|
type: 'flv',
|
|
44
47
|
url: url
|
|
45
48
|
}, flvConfig.mediaDataSource);
|
|
46
49
|
var config = Object.assign({
|
|
47
50
|
enableWorker: true,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// lazyLoadMaxDuration: 0,
|
|
51
|
-
// autoCleanupMaxBackwardDuration: 3,
|
|
52
|
-
// autoCleanupMinBackwardDuration: 2,
|
|
53
|
-
// autoCleanupSourceBuffer: true,
|
|
54
|
-
enableStashBuffer: false,
|
|
55
|
-
stashInitialSize: 128,
|
|
56
|
-
isLive: isLive !== null && isLive !== void 0 ? isLive : true
|
|
51
|
+
isLive: isLive !== null && isLive !== void 0 ? isLive : true,
|
|
52
|
+
enableStashBuffer: !isLive
|
|
57
53
|
}, flvConfig.config);
|
|
58
54
|
var player = Flvjs.createPlayer(mediaDataSource, config);
|
|
59
55
|
player.attachMediaElement(video);
|
|
@@ -65,21 +61,21 @@ export var playReload = function playReload(video, event, flv, hls, url) {
|
|
|
65
61
|
video.removeAttribute('src');
|
|
66
62
|
|
|
67
63
|
if (flv) {
|
|
68
|
-
flv.unload();
|
|
69
|
-
flv.load();
|
|
70
64
|
tryCatch(function () {
|
|
71
|
-
|
|
65
|
+
flv.unload();
|
|
66
|
+
flv.load();
|
|
67
|
+
flv.play();
|
|
72
68
|
});
|
|
73
69
|
}
|
|
74
70
|
|
|
75
71
|
if (hls) {
|
|
76
|
-
hls.swapAudioCodec();
|
|
77
|
-
hls.recoverMediaError();
|
|
78
|
-
hls.stopLoad();
|
|
79
|
-
hls.startLoad();
|
|
80
|
-
hls.loadSource(url);
|
|
81
72
|
tryCatch(function () {
|
|
82
|
-
|
|
73
|
+
hls.swapAudioCodec();
|
|
74
|
+
hls.recoverMediaError();
|
|
75
|
+
hls.stopLoad();
|
|
76
|
+
hls.startLoad();
|
|
77
|
+
hls.loadSource(url);
|
|
78
|
+
video.play();
|
|
83
79
|
});
|
|
84
80
|
}
|
|
85
81
|
|
|
@@ -145,15 +141,14 @@ export function tryCatch(fn) {
|
|
|
145
141
|
return fn();
|
|
146
142
|
|
|
147
143
|
case 3:
|
|
148
|
-
_context.next =
|
|
144
|
+
_context.next = 7;
|
|
149
145
|
break;
|
|
150
146
|
|
|
151
147
|
case 5:
|
|
152
148
|
_context.prev = 5;
|
|
153
149
|
_context.t0 = _context["catch"](0);
|
|
154
|
-
console.debug(_context.t0);
|
|
155
150
|
|
|
156
|
-
case
|
|
151
|
+
case 7:
|
|
157
152
|
case "end":
|
|
158
153
|
return _context.stop();
|
|
159
154
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ILivePlayerProps } from './interface';
|
|
3
3
|
import './index.less';
|
|
4
|
-
declare function LivePlayer({ list, children, onIndexChange, onClose, onCloseAll }: ILivePlayerProps): JSX.Element;
|
|
4
|
+
declare function LivePlayer({ list, children, onIndexChange, onClose, onCloseAll, snapshot, defaultScreen, screenChange, defaultSelectIndex, }: ILivePlayerProps): JSX.Element;
|
|
5
5
|
export default LivePlayer;
|
package/es/ScreenPlayer/Live.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
1
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
12
|
|
|
3
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -23,12 +33,16 @@ function LivePlayer(_ref) {
|
|
|
23
33
|
children = _ref.children,
|
|
24
34
|
onIndexChange = _ref.onIndexChange,
|
|
25
35
|
onClose = _ref.onClose,
|
|
26
|
-
onCloseAll = _ref.onCloseAll
|
|
36
|
+
onCloseAll = _ref.onCloseAll,
|
|
37
|
+
snapshot = _ref.snapshot,
|
|
38
|
+
defaultScreen = _ref.defaultScreen,
|
|
39
|
+
screenChange = _ref.screenChange,
|
|
40
|
+
defaultSelectIndex = _ref.defaultSelectIndex;
|
|
27
41
|
|
|
28
42
|
var _useState = useState({
|
|
29
|
-
screenNum: 4,
|
|
30
|
-
selectIndex: 0,
|
|
31
|
-
|
|
43
|
+
screenNum: defaultScreen !== null && defaultScreen !== void 0 ? defaultScreen : 4,
|
|
44
|
+
selectIndex: defaultSelectIndex !== null && defaultSelectIndex !== void 0 ? defaultSelectIndex : 0,
|
|
45
|
+
modes: []
|
|
32
46
|
}),
|
|
33
47
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
48
|
state = _useState2[0],
|
|
@@ -70,27 +84,64 @@ function LivePlayer(_ref) {
|
|
|
70
84
|
}
|
|
71
85
|
|
|
72
86
|
if (newState.hasOwnProperty('mode')) {
|
|
73
|
-
|
|
87
|
+
var newModes = _toConsumableArray(state.modes);
|
|
88
|
+
|
|
89
|
+
newModes[state.selectIndex] = newState.mode;
|
|
90
|
+
obj.modes = newModes;
|
|
74
91
|
}
|
|
75
92
|
|
|
76
93
|
setState(function (old) {
|
|
77
94
|
return Object.assign(Object.assign({}, old), obj);
|
|
78
95
|
});
|
|
79
|
-
}; //
|
|
80
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
96
|
+
}; // 当前窗口信息
|
|
81
97
|
|
|
82
98
|
|
|
99
|
+
var segmentItem = useMemo(function () {
|
|
100
|
+
return list[state.selectIndex] || {};
|
|
101
|
+
}, [state.selectIndex, list]);
|
|
102
|
+
/**
|
|
103
|
+
* 同步外部的selectIndex变化
|
|
104
|
+
*/
|
|
105
|
+
|
|
83
106
|
useEffect(function () {
|
|
84
|
-
|
|
107
|
+
if (typeof defaultSelectIndex !== 'number') {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setState(function (old) {
|
|
112
|
+
if (old.selectIndex !== defaultSelectIndex) {
|
|
113
|
+
return Object.assign(Object.assign({}, old), {
|
|
114
|
+
selectIndex: defaultSelectIndex
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return old;
|
|
119
|
+
});
|
|
120
|
+
}, [defaultSelectIndex]); // index变化同步到父组件
|
|
121
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
122
|
+
|
|
123
|
+
_useUpdateEffect(function () {
|
|
124
|
+
return onIndexChange && onIndexChange(state.selectIndex);
|
|
85
125
|
}, [state.selectIndex]);
|
|
126
|
+
/**
|
|
127
|
+
* 通知screenNum变化
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
_useUpdateEffect(function () {
|
|
132
|
+
return screenChange && onIndexChange(state.screenNum);
|
|
133
|
+
}, [state.screenNum]);
|
|
134
|
+
|
|
86
135
|
return /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
className: "split-screen-player-wrapper"
|
|
88
|
-
ref: domRef
|
|
136
|
+
className: "split-screen-player-wrapper split-screen-player-live-wrapper"
|
|
89
137
|
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: "player-layout"
|
|
138
|
+
className: "player-layout",
|
|
139
|
+
ref: domRef
|
|
91
140
|
}, screenList.map(function (item, index) {
|
|
141
|
+
var _a;
|
|
142
|
+
|
|
92
143
|
return /*#__PURE__*/React.createElement(LivePlayerWithExt, Object.assign({}, item, {
|
|
93
|
-
mode: state.
|
|
144
|
+
mode: (_a = item.mode) !== null && _a !== void 0 ? _a : state.modes[index],
|
|
94
145
|
isLive: true,
|
|
95
146
|
key: "".concat(item.url, "-").concat(index),
|
|
96
147
|
updatePlayer: function updatePlayer(player) {
|
|
@@ -113,12 +164,14 @@ function LivePlayer(_ref) {
|
|
|
113
164
|
onClose: onClose,
|
|
114
165
|
onCloseAll: onCloseAll,
|
|
115
166
|
fit: fit,
|
|
167
|
+
disabled: !segmentItem.url,
|
|
116
168
|
toggleFit: toggleFit,
|
|
117
169
|
getPlayerItem: getPlayerItem,
|
|
118
170
|
screenNum: state.screenNum,
|
|
119
|
-
mode: state.
|
|
171
|
+
mode: state.modes[state.selectIndex],
|
|
120
172
|
containerRef: domRef,
|
|
121
|
-
updateState: updateState
|
|
173
|
+
updateState: updateState,
|
|
174
|
+
snapshot: snapshot
|
|
122
175
|
}), children && /*#__PURE__*/React.cloneElement(children, {
|
|
123
176
|
selectIndex: state.selectIndex
|
|
124
177
|
}));
|
|
@@ -14,6 +14,8 @@ interface IToolsProps {
|
|
|
14
14
|
toggleFit?: () => void;
|
|
15
15
|
onClose?: () => void;
|
|
16
16
|
onCloseAll?: () => void;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
snapshot?: (base64?: string) => void;
|
|
17
19
|
}
|
|
18
|
-
declare function LiveTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, onClose, onCloseAll }: IToolsProps): JSX.Element;
|
|
20
|
+
declare function LiveTools({ containerRef, updateState, screenNum, getPlayerItem, mode, toggleFit, fit, onClose, onCloseAll, disabled, snapshot, }: IToolsProps): JSX.Element;
|
|
19
21
|
export default LiveTools;
|
|
@@ -16,6 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import IconFont from '../Player/iconfont';
|
|
18
18
|
import ScreenSelect from './ScreenSelect';
|
|
19
|
+
import DisableMark from '../DisableMark';
|
|
19
20
|
|
|
20
21
|
function LiveTools(_ref) {
|
|
21
22
|
var containerRef = _ref.containerRef,
|
|
@@ -26,7 +27,9 @@ function LiveTools(_ref) {
|
|
|
26
27
|
toggleFit = _ref.toggleFit,
|
|
27
28
|
fit = _ref.fit,
|
|
28
29
|
onClose = _ref.onClose,
|
|
29
|
-
onCloseAll = _ref.onCloseAll
|
|
30
|
+
onCloseAll = _ref.onCloseAll,
|
|
31
|
+
disabled = _ref.disabled,
|
|
32
|
+
snapshot = _ref.snapshot;
|
|
30
33
|
|
|
31
34
|
var _useFullscreen = _useFullscreen3(containerRef),
|
|
32
35
|
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
@@ -50,14 +53,17 @@ function LiveTools(_ref) {
|
|
|
50
53
|
player ? player.reload ? player.reload() : player.api.reload() : undefined;
|
|
51
54
|
};
|
|
52
55
|
|
|
53
|
-
var
|
|
56
|
+
var snapshotaction = function snapshotaction() {
|
|
54
57
|
var player = getPlayerItem();
|
|
55
|
-
|
|
58
|
+
var base64 = player ? player.api.snapshot() : undefined;
|
|
59
|
+
snapshot && snapshot(base64);
|
|
56
60
|
};
|
|
57
61
|
|
|
58
62
|
var player = getPlayerItem();
|
|
59
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
60
64
|
className: "player-tools"
|
|
65
|
+
}, /*#__PURE__*/React.createElement(DisableMark, {
|
|
66
|
+
disabled: disabled
|
|
61
67
|
}, /*#__PURE__*/React.createElement("div", {
|
|
62
68
|
className: "player-tools-left"
|
|
63
69
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -70,7 +76,7 @@ function LiveTools(_ref) {
|
|
|
70
76
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
71
77
|
type: "lm-player-xiangji1fill",
|
|
72
78
|
title: "\u622A\u56FE",
|
|
73
|
-
onClick:
|
|
79
|
+
onClick: snapshotaction
|
|
74
80
|
})), /*#__PURE__*/React.createElement("span", {
|
|
75
81
|
className: "player-tools-item",
|
|
76
82
|
onClick: reload
|
|
@@ -79,20 +85,57 @@ function LiveTools(_ref) {
|
|
|
79
85
|
title: "\u91CD\u8F7D"
|
|
80
86
|
})), /*#__PURE__*/React.createElement("span", {
|
|
81
87
|
className: "player-tools-item",
|
|
82
|
-
onClick:
|
|
88
|
+
onClick: function onClick() {
|
|
89
|
+
return updateState({
|
|
90
|
+
mode: mode !== 2 ? 2 : 1
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
94
|
+
style: {
|
|
95
|
+
top: 2,
|
|
96
|
+
position: 'relative',
|
|
97
|
+
left: 1
|
|
98
|
+
},
|
|
99
|
+
type: "lm-player-S_Device_shezhi",
|
|
100
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
101
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "player-tools-item",
|
|
103
|
+
onClick: onClose,
|
|
104
|
+
style: {
|
|
105
|
+
marginRight: 6
|
|
106
|
+
}
|
|
83
107
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
84
|
-
type: "lm-player-
|
|
85
|
-
title: "\
|
|
108
|
+
type: "lm-player-tingzhi",
|
|
109
|
+
title: "\u505C\u6B62",
|
|
110
|
+
style: {
|
|
111
|
+
fontSize: 14,
|
|
112
|
+
position: 'relative',
|
|
113
|
+
top: 1
|
|
114
|
+
}
|
|
86
115
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
87
116
|
className: "player-tools-mid"
|
|
88
|
-
}, /*#__PURE__*/React.createElement("
|
|
117
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
89
118
|
className: "player-tools-item",
|
|
90
|
-
onClick: playToggle
|
|
119
|
+
onClick: playToggle,
|
|
120
|
+
style: {
|
|
121
|
+
marginLeft: 6
|
|
122
|
+
}
|
|
91
123
|
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
92
124
|
type: "lm-player-Pause_Main",
|
|
93
|
-
title: "\u6682\u505C"
|
|
125
|
+
title: "\u6682\u505C",
|
|
126
|
+
style: {
|
|
127
|
+
fontSize: 22,
|
|
128
|
+
position: 'relative',
|
|
129
|
+
top: -2
|
|
130
|
+
}
|
|
94
131
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
95
|
-
|
|
132
|
+
style: {
|
|
133
|
+
fontSize: 17,
|
|
134
|
+
position: 'relative',
|
|
135
|
+
left: 2,
|
|
136
|
+
top: 2
|
|
137
|
+
},
|
|
138
|
+
type: "lm-player-bofang",
|
|
96
139
|
title: "\u64AD\u653E"
|
|
97
140
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
98
141
|
className: "player-tools-right"
|
|
@@ -100,40 +143,33 @@ function LiveTools(_ref) {
|
|
|
100
143
|
className: "player-tools-item",
|
|
101
144
|
onClick: onCloseAll
|
|
102
145
|
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
103
|
-
type: "lm-player-
|
|
146
|
+
type: "lm-player-quanbuguanbi",
|
|
104
147
|
title: "\u5173\u95ED\u6240\u6709"
|
|
105
|
-
})), /*#__PURE__*/React.createElement(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
mode: mode === 1 ? 2 : 1
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
113
|
-
type: "lm-player-YesorNo_No_Dark",
|
|
114
|
-
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
115
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
148
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
149
|
+
screenNum: screenNum,
|
|
150
|
+
updateState: updateState
|
|
151
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
116
152
|
className: "player-tools-item",
|
|
117
153
|
onClick: toggleFit
|
|
118
154
|
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
119
|
-
type: "lm-player-
|
|
155
|
+
type: "lm-player-huamianshiying",
|
|
120
156
|
title: "\u81EA\u9002\u5E94"
|
|
121
157
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
122
|
-
type: "lm-player-
|
|
158
|
+
type: "lm-player-huamianshiying",
|
|
123
159
|
title: "\u586B\u5145"
|
|
124
|
-
})), /*#__PURE__*/React.createElement(
|
|
125
|
-
screenNum: screenNum,
|
|
126
|
-
updateState: updateState
|
|
127
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
160
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
128
161
|
className: "player-tools-item",
|
|
129
|
-
onClick: toggleFullscreen
|
|
162
|
+
onClick: toggleFullscreen,
|
|
163
|
+
style: {
|
|
164
|
+
marginRight: 0
|
|
165
|
+
}
|
|
130
166
|
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
131
|
-
type: "lm-player-
|
|
167
|
+
type: "lm-player-quanping",
|
|
132
168
|
title: "\u5168\u5C4F"
|
|
133
169
|
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
134
|
-
type: "lm-player-
|
|
170
|
+
type: "lm-player-quanping",
|
|
135
171
|
title: "\u5168\u5C4F"
|
|
136
|
-
}))));
|
|
172
|
+
})))));
|
|
137
173
|
}
|
|
138
174
|
|
|
139
175
|
export default LiveTools;
|
|
@@ -9,11 +9,11 @@ interface ILivePlayerWithExtProps extends ISinglePlayerProps {
|
|
|
9
9
|
pluginDownloadUrl?: string;
|
|
10
10
|
}
|
|
11
11
|
export declare function LivePlayerWithExt({ mode, isLive, url, type, style, className, updatePlayer, onClick, pluginDownloadUrl, ...props }: ILivePlayerWithExtProps): JSX.Element;
|
|
12
|
-
interface ISegmentPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'
|
|
12
|
+
interface ISegmentPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
13
13
|
segments?: ISegmentType[];
|
|
14
14
|
begin?: number;
|
|
15
15
|
}
|
|
16
|
-
export declare function SegmentPlayerWithExt({ begin, style, className, segments, updatePlayer, onClick, ...props }: ISegmentPlayerWithExtProps): JSX.Element;
|
|
16
|
+
export declare function SegmentPlayerWithExt({ begin, style, className, segments, updatePlayer, onClick, mode, ...props }: ISegmentPlayerWithExtProps): JSX.Element;
|
|
17
17
|
interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
18
18
|
segments?: ISegmentType[];
|
|
19
19
|
begin?: number;
|