@byteplus/react-native-live-pull 1.1.3-rc.0 → 1.1.3-rc.1
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/lib/commonjs/index.js
CHANGED
|
@@ -4566,6 +4566,7 @@ var TVLManager = function () {
|
|
|
4566
4566
|
var _setEnableSuperResolution_decorators;
|
|
4567
4567
|
var _setVolume_decorators;
|
|
4568
4568
|
var _setEnableIgnoreAudioInterruption_decorators;
|
|
4569
|
+
var _setAllowsVideoRendering_decorators;
|
|
4569
4570
|
_classThis = /** @class */ (function () {
|
|
4570
4571
|
function TVLManager_1() {
|
|
4571
4572
|
/** {zh}
|
|
@@ -4876,6 +4877,9 @@ var TVLManager = function () {
|
|
|
4876
4877
|
TVLManager_1.prototype.setEnableIgnoreAudioInterruption = function (enable) {
|
|
4877
4878
|
throw new Error('not implement');
|
|
4878
4879
|
};
|
|
4880
|
+
TVLManager_1.prototype.setAllowsVideoRendering = function (enable) {
|
|
4881
|
+
throw new Error('not implement');
|
|
4882
|
+
};
|
|
4879
4883
|
return TVLManager_1;
|
|
4880
4884
|
}());
|
|
4881
4885
|
__setFunctionName(_classThis, "TVLManager");
|
|
@@ -4912,6 +4916,7 @@ var TVLManager = function () {
|
|
|
4912
4916
|
_setEnableSuperResolution_decorators = [NativeMethodSync('setEnableSuperResolution:')];
|
|
4913
4917
|
_setVolume_decorators = [NativeMethodSync('setVolume:')];
|
|
4914
4918
|
_setEnableIgnoreAudioInterruption_decorators = [NativeMethodSync('setEnableIgnoreAudioInterruption:')];
|
|
4919
|
+
_setAllowsVideoRendering_decorators = [NativeMethodSync('setAllowsVideoRendering:')];
|
|
4915
4920
|
__esDecorate(_classThis, null, _static_setLogLevel_decorators, { kind: "method", name: "setLogLevel", static: true, private: false, access: { has: function (obj) { return "setLogLevel" in obj; }, get: function (obj) { return obj.setLogLevel; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
4916
4921
|
__esDecorate(_classThis, null, _static_getVersion_decorators, { kind: "method", name: "getVersion", static: true, private: false, access: { has: function (obj) { return "getVersion" in obj; }, get: function (obj) { return obj.getVersion; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
4917
4922
|
__esDecorate(_classThis, null, _static_setHttpDNSHostIP_decorators, { kind: "method", name: "setHttpDNSHostIP", static: true, private: false, access: { has: function (obj) { return "setHttpDNSHostIP" in obj; }, get: function (obj) { return obj.setHttpDNSHostIP; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
@@ -4939,6 +4944,7 @@ var TVLManager = function () {
|
|
|
4939
4944
|
__esDecorate(_classThis, null, _setEnableSuperResolution_decorators, { kind: "method", name: "setEnableSuperResolution", static: false, private: false, access: { has: function (obj) { return "setEnableSuperResolution" in obj; }, get: function (obj) { return obj.setEnableSuperResolution; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4940
4945
|
__esDecorate(_classThis, null, _setVolume_decorators, { kind: "method", name: "setVolume", static: false, private: false, access: { has: function (obj) { return "setVolume" in obj; }, get: function (obj) { return obj.setVolume; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4941
4946
|
__esDecorate(_classThis, null, _setEnableIgnoreAudioInterruption_decorators, { kind: "method", name: "setEnableIgnoreAudioInterruption", static: false, private: false, access: { has: function (obj) { return "setEnableIgnoreAudioInterruption" in obj; }, get: function (obj) { return obj.setEnableIgnoreAudioInterruption; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4947
|
+
__esDecorate(_classThis, null, _setAllowsVideoRendering_decorators, { kind: "method", name: "setAllowsVideoRendering", static: false, private: false, access: { has: function (obj) { return "setAllowsVideoRendering" in obj; }, get: function (obj) { return obj.setAllowsVideoRendering; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4942
4948
|
__esDecorate(null, null, _observer_decorators, { kind: "field", name: "observer", static: false, private: false, access: { has: function (obj) { return "observer" in obj; }, get: function (obj) { return obj.observer; }, set: function (obj, value) { obj.observer = value; } }, metadata: _metadata }, _observer_initializers, _observer_extraInitializers);
|
|
4943
4949
|
__esDecorate(null, null, _playerView_decorators, { kind: "field", name: "playerView", static: false, private: false, access: { has: function (obj) { return "playerView" in obj; }, get: function (obj) { return obj.playerView; }, set: function (obj, value) { obj.playerView = value; } }, metadata: _metadata }, _playerView_initializers, _playerView_extraInitializers);
|
|
4944
4950
|
__esDecorate(null, null, _volume_decorators, { kind: "field", name: "volume", static: false, private: false, access: { has: function (obj) { return "volume" in obj; }, get: function (obj) { return obj.volume; }, set: function (obj, value) { obj.volume = value; } }, metadata: _metadata }, _volume_initializers, _volume_extraInitializers);
|
|
@@ -11222,6 +11228,42 @@ var ios_PictureInPictureManagerListener = /** @class */ (function (_super) {
|
|
|
11222
11228
|
return ios_PictureInPictureManagerListener;
|
|
11223
11229
|
}(VeLivePictureInPictureManagerListener));
|
|
11224
11230
|
|
|
11231
|
+
/**
|
|
11232
|
+
* ios player pool list
|
|
11233
|
+
*/
|
|
11234
|
+
var playerPool = new Set();
|
|
11235
|
+
function handleIOS(nextAppState) {
|
|
11236
|
+
switch (nextAppState) {
|
|
11237
|
+
case 'active':
|
|
11238
|
+
playerPool.forEach(function (player) {
|
|
11239
|
+
var iosPlayer = unpackObject(player);
|
|
11240
|
+
iosPlayer.setAllowsVideoRendering(true);
|
|
11241
|
+
});
|
|
11242
|
+
break;
|
|
11243
|
+
case 'background':
|
|
11244
|
+
playerPool.forEach(function (player) {
|
|
11245
|
+
var iosPlayer = unpackObject(player);
|
|
11246
|
+
iosPlayer.setAllowsVideoRendering(false);
|
|
11247
|
+
});
|
|
11248
|
+
break;
|
|
11249
|
+
}
|
|
11250
|
+
}
|
|
11251
|
+
reactNative.AppState.addEventListener('change', function (nextAppState) {
|
|
11252
|
+
switch (reactNative.Platform.OS) {
|
|
11253
|
+
case 'android':
|
|
11254
|
+
break;
|
|
11255
|
+
case 'ios':
|
|
11256
|
+
handleIOS(nextAppState);
|
|
11257
|
+
break;
|
|
11258
|
+
}
|
|
11259
|
+
});
|
|
11260
|
+
function addPlayer(player) {
|
|
11261
|
+
playerPool.add(player);
|
|
11262
|
+
}
|
|
11263
|
+
function removePlayer(player) {
|
|
11264
|
+
playerPool.delete(player);
|
|
11265
|
+
}
|
|
11266
|
+
|
|
11225
11267
|
function runImpl(context, androidImpl, iosImpl) {
|
|
11226
11268
|
if (env.getOS() === 'android') {
|
|
11227
11269
|
var androidEngine = unpackObject(context);
|
|
@@ -11343,6 +11385,7 @@ extendsClassMethod(VeLivePlayer, 'disablePictureInPicture', function () {
|
|
|
11343
11385
|
extendsClassMethod(VeLivePlayer, 'destroy', function (origin) {
|
|
11344
11386
|
return function destroy() {
|
|
11345
11387
|
var _this = this;
|
|
11388
|
+
removePlayer(this);
|
|
11346
11389
|
return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
11347
11390
|
return __generator(this, function (_a) {
|
|
11348
11391
|
origin();
|
|
@@ -11654,14 +11697,28 @@ function initIOSPlayer(options) {
|
|
|
11654
11697
|
*/
|
|
11655
11698
|
function initPlayer(options) {
|
|
11656
11699
|
return __awaiter(this, void 0, void 0, function () {
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11663
|
-
|
|
11664
|
-
|
|
11700
|
+
var player, _a;
|
|
11701
|
+
return __generator(this, function (_b) {
|
|
11702
|
+
switch (_b.label) {
|
|
11703
|
+
case 0:
|
|
11704
|
+
_a = reactNative.Platform.OS;
|
|
11705
|
+
switch (_a) {
|
|
11706
|
+
case 'android': return [3 /*break*/, 1];
|
|
11707
|
+
case 'ios': return [3 /*break*/, 3];
|
|
11708
|
+
}
|
|
11709
|
+
return [3 /*break*/, 5];
|
|
11710
|
+
case 1: return [4 /*yield*/, initAndroidPlayer(options)];
|
|
11711
|
+
case 2:
|
|
11712
|
+
player = (_b.sent());
|
|
11713
|
+
return [3 /*break*/, 6];
|
|
11714
|
+
case 3: return [4 /*yield*/, initIOSPlayer(options)];
|
|
11715
|
+
case 4:
|
|
11716
|
+
player = (_b.sent());
|
|
11717
|
+
return [3 /*break*/, 6];
|
|
11718
|
+
case 5: throw new Error('Unsupported platform');
|
|
11719
|
+
case 6:
|
|
11720
|
+
addPlayer(player);
|
|
11721
|
+
return [2 /*return*/, player];
|
|
11665
11722
|
}
|
|
11666
11723
|
});
|
|
11667
11724
|
});
|
package/lib/module/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeEventEmitter, Image, Platform, requireNativeComponent, NativeModules } from 'react-native';
|
|
1
|
+
import { NativeEventEmitter, Image, Platform, requireNativeComponent, AppState, NativeModules } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -4564,6 +4564,7 @@ var TVLManager = function () {
|
|
|
4564
4564
|
var _setEnableSuperResolution_decorators;
|
|
4565
4565
|
var _setVolume_decorators;
|
|
4566
4566
|
var _setEnableIgnoreAudioInterruption_decorators;
|
|
4567
|
+
var _setAllowsVideoRendering_decorators;
|
|
4567
4568
|
_classThis = /** @class */ (function () {
|
|
4568
4569
|
function TVLManager_1() {
|
|
4569
4570
|
/** {zh}
|
|
@@ -4874,6 +4875,9 @@ var TVLManager = function () {
|
|
|
4874
4875
|
TVLManager_1.prototype.setEnableIgnoreAudioInterruption = function (enable) {
|
|
4875
4876
|
throw new Error('not implement');
|
|
4876
4877
|
};
|
|
4878
|
+
TVLManager_1.prototype.setAllowsVideoRendering = function (enable) {
|
|
4879
|
+
throw new Error('not implement');
|
|
4880
|
+
};
|
|
4877
4881
|
return TVLManager_1;
|
|
4878
4882
|
}());
|
|
4879
4883
|
__setFunctionName(_classThis, "TVLManager");
|
|
@@ -4910,6 +4914,7 @@ var TVLManager = function () {
|
|
|
4910
4914
|
_setEnableSuperResolution_decorators = [NativeMethodSync('setEnableSuperResolution:')];
|
|
4911
4915
|
_setVolume_decorators = [NativeMethodSync('setVolume:')];
|
|
4912
4916
|
_setEnableIgnoreAudioInterruption_decorators = [NativeMethodSync('setEnableIgnoreAudioInterruption:')];
|
|
4917
|
+
_setAllowsVideoRendering_decorators = [NativeMethodSync('setAllowsVideoRendering:')];
|
|
4913
4918
|
__esDecorate(_classThis, null, _static_setLogLevel_decorators, { kind: "method", name: "setLogLevel", static: true, private: false, access: { has: function (obj) { return "setLogLevel" in obj; }, get: function (obj) { return obj.setLogLevel; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
4914
4919
|
__esDecorate(_classThis, null, _static_getVersion_decorators, { kind: "method", name: "getVersion", static: true, private: false, access: { has: function (obj) { return "getVersion" in obj; }, get: function (obj) { return obj.getVersion; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
4915
4920
|
__esDecorate(_classThis, null, _static_setHttpDNSHostIP_decorators, { kind: "method", name: "setHttpDNSHostIP", static: true, private: false, access: { has: function (obj) { return "setHttpDNSHostIP" in obj; }, get: function (obj) { return obj.setHttpDNSHostIP; } }, metadata: _metadata }, null, _staticExtraInitializers);
|
|
@@ -4937,6 +4942,7 @@ var TVLManager = function () {
|
|
|
4937
4942
|
__esDecorate(_classThis, null, _setEnableSuperResolution_decorators, { kind: "method", name: "setEnableSuperResolution", static: false, private: false, access: { has: function (obj) { return "setEnableSuperResolution" in obj; }, get: function (obj) { return obj.setEnableSuperResolution; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4938
4943
|
__esDecorate(_classThis, null, _setVolume_decorators, { kind: "method", name: "setVolume", static: false, private: false, access: { has: function (obj) { return "setVolume" in obj; }, get: function (obj) { return obj.setVolume; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4939
4944
|
__esDecorate(_classThis, null, _setEnableIgnoreAudioInterruption_decorators, { kind: "method", name: "setEnableIgnoreAudioInterruption", static: false, private: false, access: { has: function (obj) { return "setEnableIgnoreAudioInterruption" in obj; }, get: function (obj) { return obj.setEnableIgnoreAudioInterruption; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4945
|
+
__esDecorate(_classThis, null, _setAllowsVideoRendering_decorators, { kind: "method", name: "setAllowsVideoRendering", static: false, private: false, access: { has: function (obj) { return "setAllowsVideoRendering" in obj; }, get: function (obj) { return obj.setAllowsVideoRendering; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
4940
4946
|
__esDecorate(null, null, _observer_decorators, { kind: "field", name: "observer", static: false, private: false, access: { has: function (obj) { return "observer" in obj; }, get: function (obj) { return obj.observer; }, set: function (obj, value) { obj.observer = value; } }, metadata: _metadata }, _observer_initializers, _observer_extraInitializers);
|
|
4941
4947
|
__esDecorate(null, null, _playerView_decorators, { kind: "field", name: "playerView", static: false, private: false, access: { has: function (obj) { return "playerView" in obj; }, get: function (obj) { return obj.playerView; }, set: function (obj, value) { obj.playerView = value; } }, metadata: _metadata }, _playerView_initializers, _playerView_extraInitializers);
|
|
4942
4948
|
__esDecorate(null, null, _volume_decorators, { kind: "field", name: "volume", static: false, private: false, access: { has: function (obj) { return "volume" in obj; }, get: function (obj) { return obj.volume; }, set: function (obj, value) { obj.volume = value; } }, metadata: _metadata }, _volume_initializers, _volume_extraInitializers);
|
|
@@ -11220,6 +11226,42 @@ var ios_PictureInPictureManagerListener = /** @class */ (function (_super) {
|
|
|
11220
11226
|
return ios_PictureInPictureManagerListener;
|
|
11221
11227
|
}(VeLivePictureInPictureManagerListener));
|
|
11222
11228
|
|
|
11229
|
+
/**
|
|
11230
|
+
* ios player pool list
|
|
11231
|
+
*/
|
|
11232
|
+
var playerPool = new Set();
|
|
11233
|
+
function handleIOS(nextAppState) {
|
|
11234
|
+
switch (nextAppState) {
|
|
11235
|
+
case 'active':
|
|
11236
|
+
playerPool.forEach(function (player) {
|
|
11237
|
+
var iosPlayer = unpackObject(player);
|
|
11238
|
+
iosPlayer.setAllowsVideoRendering(true);
|
|
11239
|
+
});
|
|
11240
|
+
break;
|
|
11241
|
+
case 'background':
|
|
11242
|
+
playerPool.forEach(function (player) {
|
|
11243
|
+
var iosPlayer = unpackObject(player);
|
|
11244
|
+
iosPlayer.setAllowsVideoRendering(false);
|
|
11245
|
+
});
|
|
11246
|
+
break;
|
|
11247
|
+
}
|
|
11248
|
+
}
|
|
11249
|
+
AppState.addEventListener('change', function (nextAppState) {
|
|
11250
|
+
switch (Platform.OS) {
|
|
11251
|
+
case 'android':
|
|
11252
|
+
break;
|
|
11253
|
+
case 'ios':
|
|
11254
|
+
handleIOS(nextAppState);
|
|
11255
|
+
break;
|
|
11256
|
+
}
|
|
11257
|
+
});
|
|
11258
|
+
function addPlayer(player) {
|
|
11259
|
+
playerPool.add(player);
|
|
11260
|
+
}
|
|
11261
|
+
function removePlayer(player) {
|
|
11262
|
+
playerPool.delete(player);
|
|
11263
|
+
}
|
|
11264
|
+
|
|
11223
11265
|
function runImpl(context, androidImpl, iosImpl) {
|
|
11224
11266
|
if (env.getOS() === 'android') {
|
|
11225
11267
|
var androidEngine = unpackObject(context);
|
|
@@ -11341,6 +11383,7 @@ extendsClassMethod(VeLivePlayer, 'disablePictureInPicture', function () {
|
|
|
11341
11383
|
extendsClassMethod(VeLivePlayer, 'destroy', function (origin) {
|
|
11342
11384
|
return function destroy() {
|
|
11343
11385
|
var _this = this;
|
|
11386
|
+
removePlayer(this);
|
|
11344
11387
|
return runImpl(this, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
11345
11388
|
return __generator(this, function (_a) {
|
|
11346
11389
|
origin();
|
|
@@ -11652,14 +11695,28 @@ function initIOSPlayer(options) {
|
|
|
11652
11695
|
*/
|
|
11653
11696
|
function initPlayer(options) {
|
|
11654
11697
|
return __awaiter(this, void 0, void 0, function () {
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11698
|
+
var player, _a;
|
|
11699
|
+
return __generator(this, function (_b) {
|
|
11700
|
+
switch (_b.label) {
|
|
11701
|
+
case 0:
|
|
11702
|
+
_a = Platform.OS;
|
|
11703
|
+
switch (_a) {
|
|
11704
|
+
case 'android': return [3 /*break*/, 1];
|
|
11705
|
+
case 'ios': return [3 /*break*/, 3];
|
|
11706
|
+
}
|
|
11707
|
+
return [3 /*break*/, 5];
|
|
11708
|
+
case 1: return [4 /*yield*/, initAndroidPlayer(options)];
|
|
11709
|
+
case 2:
|
|
11710
|
+
player = (_b.sent());
|
|
11711
|
+
return [3 /*break*/, 6];
|
|
11712
|
+
case 3: return [4 /*yield*/, initIOSPlayer(options)];
|
|
11713
|
+
case 4:
|
|
11714
|
+
player = (_b.sent());
|
|
11715
|
+
return [3 /*break*/, 6];
|
|
11716
|
+
case 5: throw new Error('Unsupported platform');
|
|
11717
|
+
case 6:
|
|
11718
|
+
addPlayer(player);
|
|
11719
|
+
return [2 /*return*/, player];
|
|
11663
11720
|
}
|
|
11664
11721
|
});
|
|
11665
11722
|
});
|
|
@@ -63,6 +63,7 @@ export declare class TVLManager {
|
|
|
63
63
|
setEnableSuperResolution(enable: BOOL): void;
|
|
64
64
|
setVolume(volume: float): void;
|
|
65
65
|
setEnableIgnoreAudioInterruption(enable: BOOL): void;
|
|
66
|
+
setAllowsVideoRendering(enable: BOOL): void;
|
|
66
67
|
}
|
|
67
68
|
export declare enum VeLivePlayerType {
|
|
68
69
|
|