wargerm 0.4.24 → 0.4.25
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 +9 -11
- package/dist/index.js +9 -11
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -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,
|
@@ -11151,6 +11152,7 @@ function Xgplay(_ref, fRef) {
|
|
11151
11152
|
isLive: true,
|
11152
11153
|
autoplayMuted: true
|
11153
11154
|
}, config));
|
11155
|
+
setRef(playerRef.current);
|
11154
11156
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11155
11157
|
playerRef.current = new Player(_objectSpread2({
|
11156
11158
|
el: ref.current,
|
@@ -11160,24 +11162,20 @@ function Xgplay(_ref, fRef) {
|
|
11160
11162
|
isLive: true,
|
11161
11163
|
autoplayMuted: true
|
11162
11164
|
}, config));
|
11165
|
+
setRef(playerRef.current);
|
11163
11166
|
}
|
11164
11167
|
}
|
11165
11168
|
|
11169
|
+
console.log('playerRef.current', playerRef.current);
|
11166
11170
|
return function () {
|
11167
|
-
|
11168
|
-
};
|
11169
|
-
}, []);
|
11170
|
-
useEffect(function () {
|
11171
|
-
if (playerRef.current) {
|
11172
|
-
setRef(playerRef.current);
|
11173
|
-
}
|
11174
|
-
|
11175
|
-
return function () {
|
11176
|
-
var _playerRef$current, _playerRef$current2;
|
11171
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current2$h, _playerRef$current3, _playerRef$current3$f, _playerRef$current4;
|
11177
11172
|
|
11178
11173
|
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.pause();
|
11179
|
-
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.destroy(
|
11174
|
+
(_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();
|
11175
|
+
(_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();
|
11176
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(true);
|
11180
11177
|
setRef(null);
|
11178
|
+
playerRef.current = null;
|
11181
11179
|
};
|
11182
11180
|
}, []);
|
11183
11181
|
useImperativeHandle(fRef, function () {
|
package/dist/index.js
CHANGED
@@ -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,
|
@@ -11189,6 +11190,7 @@ function Xgplay(_ref, fRef) {
|
|
11189
11190
|
isLive: true,
|
11190
11191
|
autoplayMuted: true
|
11191
11192
|
}, config));
|
11193
|
+
setRef(playerRef.current);
|
11192
11194
|
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11193
11195
|
playerRef.current = new Player__default['default'](_objectSpread2({
|
11194
11196
|
el: ref.current,
|
@@ -11198,24 +11200,20 @@ function Xgplay(_ref, fRef) {
|
|
11198
11200
|
isLive: true,
|
11199
11201
|
autoplayMuted: true
|
11200
11202
|
}, config));
|
11203
|
+
setRef(playerRef.current);
|
11201
11204
|
}
|
11202
11205
|
}
|
11203
11206
|
|
11207
|
+
console.log('playerRef.current', playerRef.current);
|
11204
11208
|
return function () {
|
11205
|
-
|
11206
|
-
};
|
11207
|
-
}, []);
|
11208
|
-
React.useEffect(function () {
|
11209
|
-
if (playerRef.current) {
|
11210
|
-
setRef(playerRef.current);
|
11211
|
-
}
|
11212
|
-
|
11213
|
-
return function () {
|
11214
|
-
var _playerRef$current, _playerRef$current2;
|
11209
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current2$h, _playerRef$current3, _playerRef$current3$f, _playerRef$current4;
|
11215
11210
|
|
11216
11211
|
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.pause();
|
11217
|
-
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.destroy(
|
11212
|
+
(_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();
|
11213
|
+
(_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();
|
11214
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(true);
|
11218
11215
|
setRef(null);
|
11216
|
+
playerRef.current = null;
|
11219
11217
|
};
|
11220
11218
|
}, []);
|
11221
11219
|
React.useImperativeHandle(fRef, function () {
|