wargerm 0.4.23 → 0.4.26
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/dist/index.esm.js +24 -13
- package/dist/index.js +24 -13
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
@@ -11133,7 +11133,7 @@ function Xgplay(_ref, fRef) {
|
|
11133
11133
|
var playerRef = useRef(null);
|
11134
11134
|
useEffect(function () {
|
11135
11135
|
if (ref.current) {
|
11136
|
-
if ((type === null || type === void 0 ? void 0 : type.indexOf('
|
11136
|
+
if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
|
11137
11137
|
playerRef.current = new HlsJsPlayer(_objectSpread2({
|
11138
11138
|
el: ref.current,
|
11139
11139
|
width: '100%',
|
@@ -11142,6 +11142,7 @@ function Xgplay(_ref, fRef) {
|
|
11142
11142
|
isLive: true,
|
11143
11143
|
autoplayMuted: true
|
11144
11144
|
}, config));
|
11145
|
+
setRef(playerRef.current);
|
11145
11146
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
|
11146
11147
|
playerRef.current = new FlvPlayer(_objectSpread2({
|
11147
11148
|
el: ref.current,
|
@@ -11149,8 +11150,21 @@ function Xgplay(_ref, fRef) {
|
|
11149
11150
|
height: '100%',
|
11150
11151
|
autoplay: true,
|
11151
11152
|
isLive: true,
|
11152
|
-
autoplayMuted: true
|
11153
|
+
autoplayMuted: true,
|
11154
|
+
flvOptionalConfig: {
|
11155
|
+
enableWorker: true,
|
11156
|
+
enableStashBuffer: false,
|
11157
|
+
stashInitialSize: 2048,
|
11158
|
+
lazyLoad: true,
|
11159
|
+
lazyLoadMaxDuration: 2 * 60,
|
11160
|
+
autoCleanupSourceBuffer: true,
|
11161
|
+
autoCleanupMaxBackwardDuration: 35 * 60,
|
11162
|
+
autoCleanupMinBackwardDuration: 30 * 60,
|
11163
|
+
reuseRedirectedURL: true //重用301/302重定向url,用于随后的请求,如查找、重新连接等
|
11164
|
+
|
11165
|
+
}
|
11153
11166
|
}, config));
|
11167
|
+
setRef(playerRef.current);
|
11154
11168
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11155
11169
|
playerRef.current = new Player(_objectSpread2({
|
11156
11170
|
el: ref.current,
|
@@ -11160,23 +11174,20 @@ function Xgplay(_ref, fRef) {
|
|
11160
11174
|
isLive: true,
|
11161
11175
|
autoplayMuted: true
|
11162
11176
|
}, config));
|
11177
|
+
setRef(playerRef.current);
|
11163
11178
|
}
|
11164
11179
|
}
|
11165
11180
|
|
11181
|
+
console.log('playerRef.current', playerRef.current);
|
11166
11182
|
return function () {
|
11167
|
-
|
11168
|
-
};
|
11169
|
-
}, []);
|
11170
|
-
useEffect(function () {
|
11171
|
-
if (playerRef.current) {
|
11172
|
-
setRef(playerRef.current);
|
11173
|
-
}
|
11183
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current2$h, _playerRef$current3, _playerRef$current3$f, _playerRef$current4;
|
11174
11184
|
|
11175
|
-
|
11176
|
-
|
11177
|
-
|
11178
|
-
(_playerRef$
|
11185
|
+
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.pause();
|
11186
|
+
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : (_playerRef$current2$h = _playerRef$current2.hls) === null || _playerRef$current2$h === void 0 ? void 0 : _playerRef$current2$h.destroy();
|
11187
|
+
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$f = _playerRef$current3.flv) === null || _playerRef$current3$f === void 0 ? void 0 : _playerRef$current3$f.destroy();
|
11188
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(true);
|
11179
11189
|
setRef(null);
|
11190
|
+
playerRef.current = null;
|
11180
11191
|
};
|
11181
11192
|
}, []);
|
11182
11193
|
useImperativeHandle(fRef, function () {
|
package/dist/index.js
CHANGED
@@ -11171,7 +11171,7 @@ function Xgplay(_ref, fRef) {
|
|
11171
11171
|
var playerRef = React.useRef(null);
|
11172
11172
|
React.useEffect(function () {
|
11173
11173
|
if (ref.current) {
|
11174
|
-
if ((type === null || type === void 0 ? void 0 : type.indexOf('
|
11174
|
+
if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
|
11175
11175
|
playerRef.current = new HlsJsPlayer__default['default'](_objectSpread2({
|
11176
11176
|
el: ref.current,
|
11177
11177
|
width: '100%',
|
@@ -11180,6 +11180,7 @@ function Xgplay(_ref, fRef) {
|
|
11180
11180
|
isLive: true,
|
11181
11181
|
autoplayMuted: true
|
11182
11182
|
}, config));
|
11183
|
+
setRef(playerRef.current);
|
11183
11184
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
|
11184
11185
|
playerRef.current = new FlvPlayer__default['default'](_objectSpread2({
|
11185
11186
|
el: ref.current,
|
@@ -11187,8 +11188,21 @@ function Xgplay(_ref, fRef) {
|
|
11187
11188
|
height: '100%',
|
11188
11189
|
autoplay: true,
|
11189
11190
|
isLive: true,
|
11190
|
-
autoplayMuted: true
|
11191
|
+
autoplayMuted: true,
|
11192
|
+
flvOptionalConfig: {
|
11193
|
+
enableWorker: true,
|
11194
|
+
enableStashBuffer: false,
|
11195
|
+
stashInitialSize: 2048,
|
11196
|
+
lazyLoad: true,
|
11197
|
+
lazyLoadMaxDuration: 2 * 60,
|
11198
|
+
autoCleanupSourceBuffer: true,
|
11199
|
+
autoCleanupMaxBackwardDuration: 35 * 60,
|
11200
|
+
autoCleanupMinBackwardDuration: 30 * 60,
|
11201
|
+
reuseRedirectedURL: true //重用301/302重定向url,用于随后的请求,如查找、重新连接等
|
11202
|
+
|
11203
|
+
}
|
11191
11204
|
}, config));
|
11205
|
+
setRef(playerRef.current);
|
11192
11206
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11193
11207
|
playerRef.current = new Player__default['default'](_objectSpread2({
|
11194
11208
|
el: ref.current,
|
@@ -11198,23 +11212,20 @@ function Xgplay(_ref, fRef) {
|
|
11198
11212
|
isLive: true,
|
11199
11213
|
autoplayMuted: true
|
11200
11214
|
}, config));
|
11215
|
+
setRef(playerRef.current);
|
11201
11216
|
}
|
11202
11217
|
}
|
11203
11218
|
|
11219
|
+
console.log('playerRef.current', playerRef.current);
|
11204
11220
|
return function () {
|
11205
|
-
|
11206
|
-
};
|
11207
|
-
}, []);
|
11208
|
-
React.useEffect(function () {
|
11209
|
-
if (playerRef.current) {
|
11210
|
-
setRef(playerRef.current);
|
11211
|
-
}
|
11221
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current2$h, _playerRef$current3, _playerRef$current3$f, _playerRef$current4;
|
11212
11222
|
|
11213
|
-
|
11214
|
-
|
11215
|
-
|
11216
|
-
(_playerRef$
|
11223
|
+
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.pause();
|
11224
|
+
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : (_playerRef$current2$h = _playerRef$current2.hls) === null || _playerRef$current2$h === void 0 ? void 0 : _playerRef$current2$h.destroy();
|
11225
|
+
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$f = _playerRef$current3.flv) === null || _playerRef$current3$f === void 0 ? void 0 : _playerRef$current3$f.destroy();
|
11226
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(true);
|
11217
11227
|
setRef(null);
|
11228
|
+
playerRef.current = null;
|
11218
11229
|
};
|
11219
11230
|
}, []);
|
11220
11231
|
React.useImperativeHandle(fRef, function () {
|
package/package.json
CHANGED