mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-04 03:36:29 +08:00
feat: add useKeepAwake to LivePlayer and update version to 1.2.7
This commit is contained in:
@@ -8,7 +8,7 @@ import { PlayerControls } from "@/components/PlayerControls";
|
|||||||
import { EpisodeSelectionModal } from "@/components/EpisodeSelectionModal";
|
import { EpisodeSelectionModal } from "@/components/EpisodeSelectionModal";
|
||||||
import { SourceSelectionModal } from "@/components/SourceSelectionModal";
|
import { SourceSelectionModal } from "@/components/SourceSelectionModal";
|
||||||
import { SeekingBar } from "@/components/SeekingBar";
|
import { SeekingBar } from "@/components/SeekingBar";
|
||||||
import { NextEpisodeOverlay } from "@/components/NextEpisodeOverlay";
|
// import { NextEpisodeOverlay } from "@/components/NextEpisodeOverlay";
|
||||||
import VideoLoadingAnimation from "@/components/VideoLoadingAnimation";
|
import VideoLoadingAnimation from "@/components/VideoLoadingAnimation";
|
||||||
import useDetailStore from "@/stores/detailStore";
|
import useDetailStore from "@/stores/detailStore";
|
||||||
import { useTVRemoteHandler } from "@/hooks/useTVRemoteHandler";
|
import { useTVRemoteHandler } from "@/hooks/useTVRemoteHandler";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useRef, useState, useEffect } from "react";
|
import React, { useRef, useState, useEffect } from "react";
|
||||||
import { View, StyleSheet, Text, ActivityIndicator } from "react-native";
|
import { View, StyleSheet, Text, ActivityIndicator } from "react-native";
|
||||||
import { Video, ResizeMode, AVPlaybackStatus } from "expo-av";
|
import { Video, ResizeMode, AVPlaybackStatus } from "expo-av";
|
||||||
|
import { useKeepAwake } from "expo-keep-awake";
|
||||||
|
|
||||||
interface LivePlayerProps {
|
interface LivePlayerProps {
|
||||||
streamUrl: string | null;
|
streamUrl: string | null;
|
||||||
@@ -15,6 +16,7 @@ export default function LivePlayer({ streamUrl, channelTitle, onPlaybackStatusUp
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [isTimeout, setIsTimeout] = useState(false);
|
const [isTimeout, setIsTimeout] = useState(false);
|
||||||
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
useKeepAwake();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (timeoutRef.current) {
|
if (timeoutRef.current) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "OrionTV",
|
"name": "OrionTV",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "expo-router/entry",
|
"main": "expo-router/entry",
|
||||||
"version": "1.2.6",
|
"version": "1.2.7",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
"start": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
||||||
"start-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
"start-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
||||||
|
|||||||
Reference in New Issue
Block a user