mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-02-22 02:24:44 +08:00
feat: native lock and autoOrientation
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user