mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-21 09:14:44 +08:00
feat: add useKeepAwake to LivePlayer and update version to 1.2.7
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { useRef, useState, useEffect } from "react";
|
||||
import { View, StyleSheet, Text, ActivityIndicator } from "react-native";
|
||||
import { Video, ResizeMode, AVPlaybackStatus } from "expo-av";
|
||||
import { useKeepAwake } from "expo-keep-awake";
|
||||
|
||||
interface LivePlayerProps {
|
||||
streamUrl: string | null;
|
||||
@@ -15,6 +16,7 @@ export default function LivePlayer({ streamUrl, channelTitle, onPlaybackStatusUp
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [isTimeout, setIsTimeout] = useState(false);
|
||||
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||
useKeepAwake();
|
||||
|
||||
useEffect(() => {
|
||||
if (timeoutRef.current) {
|
||||
|
||||
Reference in New Issue
Block a user