feat: native lock and autoOrientation

This commit is contained in:
shinya
2025-07-09 23:02:12 +08:00
parent 514410f561
commit 1338e788cc

View File

@@ -871,6 +871,8 @@ function PlayPageClient() {
lang: 'zh-cn',
hotkey: false,
fastForward: true,
autoOrientation: true,
lock: true,
moreVideoAttr: {
crossOrigin: 'anonymous',
},
@@ -1030,18 +1032,6 @@ function PlayPageClient() {
}
});
artPlayerRef.current.on('fullscreen', async (state: boolean) => {
if (state) {
if (screen.orientation && (screen.orientation as any).lock) {
await (screen.orientation as any).lock('landscape');
}
} else {
if (screen.orientation && (screen.orientation as any).unlock) {
(screen.orientation as any).unlock();
}
}
});
artPlayerRef.current.on('video:timeupdate', () => {
const now = Date.now();
if (now - lastSaveTimeRef.current > 5000) {