mirror of
https://github.com/MoonTechLab/LunaTV.git
synced 2026-03-14 01:57:29 +08:00
feat: native lock and autoOrientation
This commit is contained in:
@@ -871,6 +871,8 @@ function PlayPageClient() {
|
|||||||
lang: 'zh-cn',
|
lang: 'zh-cn',
|
||||||
hotkey: false,
|
hotkey: false,
|
||||||
fastForward: true,
|
fastForward: true,
|
||||||
|
autoOrientation: true,
|
||||||
|
lock: true,
|
||||||
moreVideoAttr: {
|
moreVideoAttr: {
|
||||||
crossOrigin: 'anonymous',
|
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', () => {
|
artPlayerRef.current.on('video:timeupdate', () => {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (now - lastSaveTimeRef.current > 5000) {
|
if (now - lastSaveTimeRef.current > 5000) {
|
||||||
|
|||||||
Reference in New Issue
Block a user