mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
auto lock player fix
This commit is contained in:
parent
0b7bcb52da
commit
e9659ee305
2 changed files with 39 additions and 7 deletions
|
|
@ -174,8 +174,8 @@
|
|||
LastUpgradeCheck = 1130;
|
||||
TargetAttributes = {
|
||||
13B07F861A680F5B00A75B9A = {
|
||||
DevelopmentTeam = NLXTHANK2N;
|
||||
LastSwiftMigration = 1250;
|
||||
DevelopmentTeam = "NLXTHANK2N";
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
|
|
@ -389,7 +389,10 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Nuvio/Nuvio.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = NLXTHANK2N;
|
||||
ENABLE_BITCODE = NO;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
|
|
@ -412,9 +415,6 @@
|
|||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
DEVELOPMENT_TEAM = "NLXTHANK2N";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
|
@ -425,7 +425,10 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Nuvio/Nuvio.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = NLXTHANK2N;
|
||||
INFOPLIST_FILE = Nuvio/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
|
|
@ -442,9 +445,6 @@
|
|||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
DEVELOPMENT_TEAM = "NLXTHANK2N";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1833,6 +1833,38 @@ const AndroidVideoPlayer: React.FC = () => {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Keep screen awake during active playback (Android)
|
||||
const keepAwakeModuleRef = useRef<any>(null);
|
||||
useEffect(() => {
|
||||
try {
|
||||
// Use require to avoid TS dynamic import constraints
|
||||
// If the module is unavailable, catch and ignore
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const mod = require('expo-keep-awake');
|
||||
keepAwakeModuleRef.current = mod;
|
||||
} catch (_e) {
|
||||
keepAwakeModuleRef.current = null;
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Toggle keep-awake based on playback state
|
||||
useEffect(() => {
|
||||
const mod = keepAwakeModuleRef.current;
|
||||
if (!mod) return;
|
||||
const activate = mod.activateKeepAwakeAsync || mod.activateKeepAwake;
|
||||
const deactivate = mod.deactivateKeepAwakeAsync || mod.deactivateKeepAwake;
|
||||
try {
|
||||
if (!paused && isPlayerReady && duration > 0) {
|
||||
activate && activate();
|
||||
} else {
|
||||
deactivate && deactivate();
|
||||
}
|
||||
} catch (_e) {}
|
||||
return () => {
|
||||
try { deactivate && deactivate(); } catch (_e) {}
|
||||
};
|
||||
}, [paused, isPlayerReady, duration]);
|
||||
|
||||
const handleErrorExit = () => {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue