@vtx/player 1.9.5 → 1.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +2 -2
  2. package/lib/api/fetch.js +68 -71
  3. package/lib/api/fetch.js.map +1 -1
  4. package/lib/api/index.js +31 -47
  5. package/lib/api/index.js.map +1 -1
  6. package/lib/api/types.d.ts +5 -5
  7. package/lib/api/types.js +0 -1
  8. package/lib/api/types.js.map +1 -1
  9. package/lib/bd/PlayerManager.js +8 -7
  10. package/lib/bd/PlayerManager.js.map +1 -1
  11. package/lib/bill-player/index.d.ts +1 -1
  12. package/lib/bill-player/index.js +10 -12
  13. package/lib/bill-player/index.js.map +1 -1
  14. package/lib/bill-player/style/index.less +320 -320
  15. package/lib/components/set-tag-video/index.js +7 -8
  16. package/lib/components/set-tag-video/index.js.map +1 -1
  17. package/lib/components/set-tag-video/style/index.less +125 -125
  18. package/lib/components/split-screen/index.d.ts +1 -1
  19. package/lib/components/split-screen/index.js +3 -5
  20. package/lib/components/split-screen/index.js.map +1 -1
  21. package/lib/components/tag-video/index.js +10 -11
  22. package/lib/components/tag-video/index.js.map +1 -1
  23. package/lib/components/tag-video/style/index.less +69 -69
  24. package/lib/components/video-scale/index.d.ts +1 -1
  25. package/lib/components/video-scale/index.js +2 -3
  26. package/lib/components/video-scale/index.js.map +1 -1
  27. package/lib/config.js +1 -2
  28. package/lib/config.js.map +1 -1
  29. package/lib/context/index.js +3 -5
  30. package/lib/context/index.js.map +1 -1
  31. package/lib/controls/index.d.ts +11 -11
  32. package/lib/controls/index.js +14 -22
  33. package/lib/controls/index.js.map +1 -1
  34. package/lib/controls/style/index.less +192 -192
  35. package/lib/h264/PlayerManager.js +8 -7
  36. package/lib/h264/PlayerManager.js.map +1 -1
  37. package/lib/history-control/index.d.ts +2 -2
  38. package/lib/history-control/index.js +8 -10
  39. package/lib/history-control/index.js.map +1 -1
  40. package/lib/history-control/style/index.less +252 -252
  41. package/lib/history-control-v2/components/grid-item/index.js +10 -11
  42. package/lib/history-control-v2/components/grid-item/index.js.map +1 -1
  43. package/lib/history-control-v2/components/panel/VideoTable.d.ts +1 -1
  44. package/lib/history-control-v2/components/panel/VideoTable.js +50 -54
  45. package/lib/history-control-v2/components/panel/VideoTable.js.map +1 -1
  46. package/lib/history-control-v2/components/panel/index.js +8 -10
  47. package/lib/history-control-v2/components/panel/index.js.map +1 -1
  48. package/lib/history-control-v2/context.js +1 -2
  49. package/lib/history-control-v2/context.js.map +1 -1
  50. package/lib/history-control-v2/index.d.ts +4 -4
  51. package/lib/history-control-v2/index.js +73 -78
  52. package/lib/history-control-v2/index.js.map +1 -1
  53. package/lib/history-control-v2/style/index.less +437 -437
  54. package/lib/history-control-v2/utils.js +12 -18
  55. package/lib/history-control-v2/utils.js.map +1 -1
  56. package/lib/history-player/index.d.ts +1 -1
  57. package/lib/history-player/index.js +113 -117
  58. package/lib/history-player/index.js.map +1 -1
  59. package/lib/history-player/style/index.less +102 -102
  60. package/lib/hooks/useSettings.js +1 -2
  61. package/lib/hooks/useSettings.js.map +1 -1
  62. package/lib/icc/PlayerManager.js +9 -8
  63. package/lib/icc/PlayerManager.js.map +1 -1
  64. package/lib/icc/api.d.ts +0 -68
  65. package/lib/icc/api.js +2 -3
  66. package/lib/icc/api.js.map +1 -1
  67. package/lib/icons/index.d.ts +36 -36
  68. package/lib/icons/index.js +63 -99
  69. package/lib/icons/index.js.map +1 -1
  70. package/lib/icons/index.less +32 -32
  71. package/lib/index.js +1 -1
  72. package/lib/index.js.map +1 -1
  73. package/lib/live-channel-player/index.d.ts +1 -1
  74. package/lib/live-channel-player/index.js +28 -32
  75. package/lib/live-channel-player/index.js.map +1 -1
  76. package/lib/live-control/index.d.ts +2 -2
  77. package/lib/live-control/index.js +12 -13
  78. package/lib/live-control/index.js.map +1 -1
  79. package/lib/live-control/style/index.less +99 -99
  80. package/lib/live-control-v2/index.d.ts +3 -3
  81. package/lib/live-control-v2/index.js +18 -20
  82. package/lib/live-control-v2/index.js.map +1 -1
  83. package/lib/live-control-v2/style/index.less +192 -192
  84. package/lib/live-player/index.js +69 -72
  85. package/lib/live-player/index.js.map +1 -1
  86. package/lib/live-player/style/index.less +75 -75
  87. package/lib/mpegts/PlayerManager.js +8 -7
  88. package/lib/mpegts/PlayerManager.js.map +1 -1
  89. package/lib/player/index.d.ts +1 -1
  90. package/lib/player/index.js +132 -101
  91. package/lib/player/index.js.map +1 -1
  92. package/lib/rsl/PlayerManager.d.ts +1 -1
  93. package/lib/rsl/PlayerManager.js +8 -7
  94. package/lib/rsl/PlayerManager.js.map +1 -1
  95. package/lib/typings/@vtx/utils/index.d.ts +28 -28
  96. package/lib/typings/h5player.d.ts +152 -152
  97. package/lib/typings/mpegts.d.ts +7 -7
  98. package/lib/typings/webrtcplayer.d.ts +56 -56
  99. package/lib/typings/wfsplayer.d.ts +56 -56
  100. package/lib/typings/wsplayer.d.ts +99 -99
  101. package/lib/utils/index.d.ts +1 -1
  102. package/lib/utils/index.js +14 -23
  103. package/lib/utils/index.js.map +1 -1
  104. package/lib/vite-env.d.ts +1 -1
  105. package/lib/vtxHls/PlayerManager.js +8 -7
  106. package/lib/vtxHls/PlayerManager.js.map +1 -1
  107. package/lib/vtxHls/WhepManager.js +11 -10
  108. package/lib/vtxHls/WhepManager.js.map +1 -1
  109. package/lib/webrtc/PlayerManager.js +8 -7
  110. package/lib/webrtc/PlayerManager.js.map +1 -1
  111. package/lib/wfs/PlayerManager.js +8 -7
  112. package/lib/wfs/PlayerManager.js.map +1 -1
  113. package/package.json +125 -125
@@ -1,192 +1,192 @@
1
- .vtx-live-control-v2 {
2
- display: flex;
3
- flex-direction: column;
4
-
5
- .player-grid-container {
6
- display: grid;
7
- flex-grow: 1;
8
- grid-gap: 1px;
9
- height: 0;
10
- background-color: rgba(0, 0, 0, 0.8);
11
-
12
- &._1 {
13
- grid-template-rows: 1fr;
14
- grid-template-columns: 1fr;
15
- }
16
-
17
- &._4 {
18
- grid-template-rows: 1fr 1fr;
19
- grid-template-columns: 1fr 1fr;
20
- }
21
- &._9 {
22
- grid-template-rows: 1fr 1fr 1fr;
23
- grid-template-columns: 1fr 1fr 1fr;
24
- }
25
- &._16 {
26
- grid-template-rows: 1fr 1fr 1fr 1fr;
27
- grid-template-columns: 1fr 1fr 1fr 1fr;
28
- }
29
- &._25 {
30
- grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
31
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
32
- }
33
- &._6 {
34
- grid-template-rows: 1fr 1fr 1fr;
35
- grid-template-columns: 1fr 1fr 1fr;
36
- :nth-child(1) {
37
- grid-column-start: 1;
38
- grid-column-end: 3;
39
- grid-row-start: 1;
40
- grid-row-end: 3;
41
- }
42
- }
43
- &._8 {
44
- grid-template-rows: 1fr 1fr 1fr 1fr;
45
- grid-template-columns: 1fr 1fr 1fr 1fr;
46
- :nth-child(1) {
47
- grid-column-start: 1;
48
- grid-column-end: 4;
49
- grid-row-start: 1;
50
- grid-row-end: 4;
51
- }
52
- }
53
- &._10 {
54
- grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
55
- grid-template-columns: 1fr 1fr 1fr;
56
- :nth-child(1) {
57
- grid-column-start: 1;
58
- grid-column-end: 3;
59
- grid-row-start: 1;
60
- grid-row-end: 4;
61
- }
62
- }
63
- &._13 {
64
- grid-template-rows: 1fr 1fr 1fr 1fr;
65
- grid-template-columns: 1fr 1fr 1fr 1fr;
66
- :nth-child(1) {
67
- grid-column-start: 1;
68
- grid-column-end: 3;
69
- grid-row-start: 1;
70
- grid-row-end: 3;
71
- }
72
- }
73
- &._14 {
74
- grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
75
- grid-template-columns: 1fr 1fr 1fr 1fr;
76
- :nth-child(1) {
77
- grid-column-start: 1;
78
- grid-column-end: 3;
79
- grid-row-start: 1;
80
- grid-row-end: 4;
81
- }
82
- :nth-child(2) {
83
- grid-column-start: 3;
84
- grid-column-end: 5;
85
- }
86
- }
87
- &._17 {
88
- grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
89
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
90
- :nth-child(1) {
91
- grid-column-start: 1;
92
- grid-column-end: 4;
93
- grid-row-start: 1;
94
- grid-row-end: 4;
95
- }
96
- }
97
- &._22 {
98
- grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
99
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
100
- :nth-child(1) {
101
- grid-column-start: 1;
102
- grid-column-end: 3;
103
- grid-row-start: 1;
104
- grid-row-end: 3;
105
- }
106
- }
107
- .grid-item-container {
108
- display: flex;
109
- flex-direction: column;
110
- min-width: 0;
111
- min-height: 0;
112
- background-color: #2b3d51;
113
- align-items: center;
114
- &.emptyImg {
115
- background-image: url('../images/empty.png');
116
- background-repeat: no-repeat;
117
- background-position: center;
118
- }
119
- &.active {
120
- box-shadow: 0 0 0 1px #52c41a;
121
- }
122
- > .content {
123
- width: 100%;
124
- height: calc(100% - 26px);
125
- display: flex;
126
- align-items: center;
127
- justify-content: center;
128
- }
129
- }
130
- }
131
-
132
- .bottom-controls {
133
- display: flex;
134
- align-items: center;
135
- width: 100%;
136
- height: 33px;
137
- padding: 0 12px;
138
- background-color: #243241;
139
-
140
- .right {
141
- margin-left: auto;
142
-
143
- > div {
144
- height: 24px;
145
- }
146
- }
147
- .split-line {
148
- margin-top: 6px;
149
- width: 1px;
150
- background-color: rgba(255, 255, 255, 0.1);
151
- height: 14px;
152
- }
153
- .controls-icon-hover {
154
- color: rgba(255, 255, 255, 0.65);
155
- display: flex;
156
- align-items: center;
157
- padding-top: 2px;
158
- .hover-hide {
159
- display: inline-block;
160
- vertical-align: 0.1em;
161
- font-size: 12px;
162
- }
163
- .hover-show {
164
- display: none;
165
- vertical-align: 0.1em;
166
- font-size: 12px;
167
- }
168
- &:hover {
169
- .hover-hide {
170
- display: none;
171
- }
172
- .hover-show {
173
- display: inline-block;
174
- color: #1890ff;
175
- vertical-align: 0.2em;
176
- }
177
- }
178
- }
179
- .grid-change-disable {
180
- color: rgba(255, 255, 255, 0.65);
181
- display: flex;
182
- align-items: center;
183
- padding-top: 2px;
184
- cursor: not-allowed;
185
- .arrow {
186
- display: inline-block;
187
- vertical-align: 0.1em;
188
- font-size: 12px;
189
- }
190
- }
191
- }
192
- }
1
+ .vtx-live-control-v2 {
2
+ display: flex;
3
+ flex-direction: column;
4
+
5
+ .player-grid-container {
6
+ display: grid;
7
+ flex-grow: 1;
8
+ grid-gap: 1px;
9
+ height: 0;
10
+ background-color: rgba(0, 0, 0, 0.8);
11
+
12
+ &._1 {
13
+ grid-template-rows: 1fr;
14
+ grid-template-columns: 1fr;
15
+ }
16
+
17
+ &._4 {
18
+ grid-template-rows: 1fr 1fr;
19
+ grid-template-columns: 1fr 1fr;
20
+ }
21
+ &._9 {
22
+ grid-template-rows: 1fr 1fr 1fr;
23
+ grid-template-columns: 1fr 1fr 1fr;
24
+ }
25
+ &._16 {
26
+ grid-template-rows: 1fr 1fr 1fr 1fr;
27
+ grid-template-columns: 1fr 1fr 1fr 1fr;
28
+ }
29
+ &._25 {
30
+ grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
31
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
32
+ }
33
+ &._6 {
34
+ grid-template-rows: 1fr 1fr 1fr;
35
+ grid-template-columns: 1fr 1fr 1fr;
36
+ :nth-child(1) {
37
+ grid-column-start: 1;
38
+ grid-column-end: 3;
39
+ grid-row-start: 1;
40
+ grid-row-end: 3;
41
+ }
42
+ }
43
+ &._8 {
44
+ grid-template-rows: 1fr 1fr 1fr 1fr;
45
+ grid-template-columns: 1fr 1fr 1fr 1fr;
46
+ :nth-child(1) {
47
+ grid-column-start: 1;
48
+ grid-column-end: 4;
49
+ grid-row-start: 1;
50
+ grid-row-end: 4;
51
+ }
52
+ }
53
+ &._10 {
54
+ grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
55
+ grid-template-columns: 1fr 1fr 1fr;
56
+ :nth-child(1) {
57
+ grid-column-start: 1;
58
+ grid-column-end: 3;
59
+ grid-row-start: 1;
60
+ grid-row-end: 4;
61
+ }
62
+ }
63
+ &._13 {
64
+ grid-template-rows: 1fr 1fr 1fr 1fr;
65
+ grid-template-columns: 1fr 1fr 1fr 1fr;
66
+ :nth-child(1) {
67
+ grid-column-start: 1;
68
+ grid-column-end: 3;
69
+ grid-row-start: 1;
70
+ grid-row-end: 3;
71
+ }
72
+ }
73
+ &._14 {
74
+ grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
75
+ grid-template-columns: 1fr 1fr 1fr 1fr;
76
+ :nth-child(1) {
77
+ grid-column-start: 1;
78
+ grid-column-end: 3;
79
+ grid-row-start: 1;
80
+ grid-row-end: 4;
81
+ }
82
+ :nth-child(2) {
83
+ grid-column-start: 3;
84
+ grid-column-end: 5;
85
+ }
86
+ }
87
+ &._17 {
88
+ grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
89
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
90
+ :nth-child(1) {
91
+ grid-column-start: 1;
92
+ grid-column-end: 4;
93
+ grid-row-start: 1;
94
+ grid-row-end: 4;
95
+ }
96
+ }
97
+ &._22 {
98
+ grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
99
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
100
+ :nth-child(1) {
101
+ grid-column-start: 1;
102
+ grid-column-end: 3;
103
+ grid-row-start: 1;
104
+ grid-row-end: 3;
105
+ }
106
+ }
107
+ .grid-item-container {
108
+ display: flex;
109
+ flex-direction: column;
110
+ min-width: 0;
111
+ min-height: 0;
112
+ background-color: #2b3d51;
113
+ align-items: center;
114
+ &.emptyImg {
115
+ background-image: url('../images/empty.png');
116
+ background-repeat: no-repeat;
117
+ background-position: center;
118
+ }
119
+ &.active {
120
+ box-shadow: 0 0 0 1px #52c41a;
121
+ }
122
+ > .content {
123
+ width: 100%;
124
+ height: calc(100% - 26px);
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ }
129
+ }
130
+ }
131
+
132
+ .bottom-controls {
133
+ display: flex;
134
+ align-items: center;
135
+ width: 100%;
136
+ height: 33px;
137
+ padding: 0 12px;
138
+ background-color: #243241;
139
+
140
+ .right {
141
+ margin-left: auto;
142
+
143
+ > div {
144
+ height: 24px;
145
+ }
146
+ }
147
+ .split-line {
148
+ margin-top: 6px;
149
+ width: 1px;
150
+ background-color: rgba(255, 255, 255, 0.1);
151
+ height: 14px;
152
+ }
153
+ .controls-icon-hover {
154
+ color: rgba(255, 255, 255, 0.65);
155
+ display: flex;
156
+ align-items: center;
157
+ padding-top: 2px;
158
+ .hover-hide {
159
+ display: inline-block;
160
+ vertical-align: 0.1em;
161
+ font-size: 12px;
162
+ }
163
+ .hover-show {
164
+ display: none;
165
+ vertical-align: 0.1em;
166
+ font-size: 12px;
167
+ }
168
+ &:hover {
169
+ .hover-hide {
170
+ display: none;
171
+ }
172
+ .hover-show {
173
+ display: inline-block;
174
+ color: #1890ff;
175
+ vertical-align: 0.2em;
176
+ }
177
+ }
178
+ }
179
+ .grid-change-disable {
180
+ color: rgba(255, 255, 255, 0.65);
181
+ display: flex;
182
+ align-items: center;
183
+ padding-top: 2px;
184
+ cursor: not-allowed;
185
+ .arrow {
186
+ display: inline-block;
187
+ vertical-align: 0.1em;
188
+ font-size: 12px;
189
+ }
190
+ }
191
+ }
192
+ }
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
8
7
  var _jsxRuntime = require("react/jsx-runtime");
9
8
  var _react = require("react");
10
9
  var _controls = require("../controls");
@@ -14,13 +13,15 @@ var _player = _interopRequireDefault(require("../player"));
14
13
  var _utils = require("../utils");
15
14
  var _ahooks = require("ahooks");
16
15
  var _space = _interopRequireDefault(require("antd/lib/space"));
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
17
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
18
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
19
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
20
  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."); }
20
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
22
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
22
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
23
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
24
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
24
25
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
25
26
  function adopt(value) {
26
27
  return value instanceof P ? value : new P(function (resolve) {
@@ -116,75 +117,72 @@ var LivePlayer = function LivePlayer(props, selfRef) {
116
117
  }
117
118
  var player = null;
118
119
  (function () {
119
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regenerator["default"].mark(function _callee() {
120
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regenerator().m(function _callee() {
120
121
  var token;
121
- return _regenerator["default"].wrap(function _callee$(_context) {
122
- while (1) {
123
- switch (_context.prev = _context.next) {
124
- case 0:
125
- if (!(type === 'icc_ws')) {
126
- _context.next = 5;
127
- break;
128
- }
129
- _context.next = 3;
130
- return _api["default"].getToken({
131
- deviceId: deviceId
132
- });
133
- case 3:
134
- token = _context.sent;
135
- localStorage.setItem('accessToken', token);
136
- case 5:
137
- _context.next = 7;
138
- return new _player["default"]({
139
- url: url,
140
- deviceIp: deviceIp,
141
- deviceId: deviceId,
142
- devicePort: devicePort,
143
- userName: userName,
144
- password: password,
145
- streamType: streamType,
146
- deviceCode: deviceCode,
147
- channelNum: channelNum,
148
- enableAgent: enableAgent,
149
- container: container,
150
- type: type,
151
- reload: function reload() {
152
- if (typeof _reload === 'function') {
153
- _reload();
154
- }
155
- },
156
- onClose: function onClose() {
157
- if (typeof _onClose === 'function') {
158
- _onClose();
159
- }
122
+ return _regenerator().w(function (_context) {
123
+ while (1) switch (_context.n) {
124
+ case 0:
125
+ if (!(type === 'icc_ws')) {
126
+ _context.n = 2;
127
+ break;
128
+ }
129
+ _context.n = 1;
130
+ return _api["default"].getToken({
131
+ deviceId: deviceId
132
+ });
133
+ case 1:
134
+ token = _context.v;
135
+ localStorage.setItem('accessToken', token);
136
+ case 2:
137
+ _context.n = 3;
138
+ return new _player["default"]({
139
+ url: url,
140
+ deviceIp: deviceIp,
141
+ deviceId: deviceId,
142
+ devicePort: devicePort,
143
+ userName: userName,
144
+ password: password,
145
+ streamType: streamType,
146
+ deviceCode: deviceCode,
147
+ channelNum: channelNum,
148
+ enableAgent: enableAgent,
149
+ container: container,
150
+ type: type,
151
+ reload: function reload() {
152
+ if (typeof _reload === 'function') {
153
+ _reload();
160
154
  }
161
- });
162
- case 7:
163
- player = _context.sent;
164
- playerRef.current = player;
155
+ },
156
+ onClose: function onClose() {
157
+ if (typeof _onClose === 'function') {
158
+ _onClose();
159
+ }
160
+ }
161
+ });
162
+ case 3:
163
+ player = _context.v;
164
+ playerRef.current = player;
165
+ setState({
166
+ loading: true,
167
+ error: false
168
+ });
169
+ player.play().then(function () {
165
170
  setState({
166
- loading: true,
171
+ play: true,
167
172
  error: false
168
173
  });
169
- player.play().then(function () {
170
- setState({
171
- play: true,
172
- error: false
173
- });
174
- })["catch"](function () {
175
- return setState({
176
- error: true
177
- });
178
- })["finally"](function () {
179
- setState({
180
- loading: false
181
- });
182
- loaded && loaded();
174
+ })["catch"](function () {
175
+ return setState({
176
+ error: true
177
+ });
178
+ })["finally"](function () {
179
+ setState({
180
+ loading: false
183
181
  });
184
- case 11:
185
- case "end":
186
- return _context.stop();
187
- }
182
+ loaded && loaded();
183
+ });
184
+ case 4:
185
+ return _context.a(2);
188
186
  }
189
187
  }, _callee);
190
188
  }));
@@ -264,6 +262,5 @@ var LivePlayer = function LivePlayer(props, selfRef) {
264
262
  })) : null;
265
263
  };
266
264
  // LivePlayer.displayName = 'live-player';
267
- var _default = /*#__PURE__*/(0, _react.forwardRef)(LivePlayer);
268
- exports["default"] = _default;
265
+ var _default = exports["default"] = /*#__PURE__*/(0, _react.forwardRef)(LivePlayer);
269
266
  //# sourceMappingURL=index.js.map