mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -04:00
Improve player behavior on android
This commit is contained in:
parent
58c6815dc3
commit
5108649bf0
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
import { type Audio, type Episode, type Subtitle, getLocalSetting, useAccount } from "@kyoo/models";
|
import { type Audio, type Episode, type Subtitle, getLocalSetting, useAccount } from "@kyoo/models";
|
||||||
import { useSnackbar } from "@kyoo/primitives";
|
import { useSnackbar } from "@kyoo/primitives";
|
||||||
import { atom, useAtom, useAtomValue, useSetAtom } from "jotai";
|
import { atom, useAtom, useAtomValue, useSetAtom, getDefaultStore } from "jotai";
|
||||||
import { useAtomCallback } from "jotai/utils";
|
import { useAtomCallback } from "jotai/utils";
|
||||||
import {
|
import {
|
||||||
type ElementRef,
|
type ElementRef,
|
||||||
@ -239,6 +239,7 @@ export const Video = memo(function Video({
|
|||||||
showNotificationControls
|
showNotificationControls
|
||||||
playInBackground
|
playInBackground
|
||||||
playWhenInactive
|
playWhenInactive
|
||||||
|
disableDisconnectError
|
||||||
paused={!isPlaying}
|
paused={!isPlaying}
|
||||||
muted={isMuted}
|
muted={isMuted}
|
||||||
volume={volume}
|
volume={volume}
|
||||||
@ -252,7 +253,10 @@ export const Video = memo(function Video({
|
|||||||
setPrivateProgress(progress.currentTime);
|
setPrivateProgress(progress.currentTime);
|
||||||
setBuffered(progress.playableDuration);
|
setBuffered(progress.playableDuration);
|
||||||
}}
|
}}
|
||||||
onPlaybackStateChanged={(state) => setPlay(state.isPlaying)}
|
onPlaybackStateChanged={(state) => {
|
||||||
|
if (state.isSeeking || getDefaultStore().get(loadAtom)) return;
|
||||||
|
setPlay(state.isPlaying);
|
||||||
|
}}
|
||||||
fonts={fonts}
|
fonts={fonts}
|
||||||
subtitles={subtitles}
|
subtitles={subtitles}
|
||||||
onMediaUnsupported={() => {
|
onMediaUnsupported={() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user