mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
apply keepawake only when audio or video loaded
This commit is contained in:
parent
bb73e335d9
commit
f0dc16db8e
@ -1,5 +1,4 @@
|
||||
import { Keyboard, KeyboardAvoidingView, ActivityIndicator, Modal, Platform, TextInput, View, TouchableOpacity, Text, } from 'react-native';
|
||||
import { useKeepAwake } from 'expo-keep-awake';
|
||||
import { FlatList, ScrollView } from '@stream-io/flat-list-mvcp';
|
||||
import { memo, useState, useRef, useEffect } from 'react';
|
||||
import { useConversation } from './useConversation.hook';
|
||||
@ -59,8 +58,6 @@ export function ConversationBody() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
useKeepAwake();
|
||||
|
||||
const latch = () => {
|
||||
if (!state.momentum) {
|
||||
actions.latch();
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Image, View, Text, TouchableOpacity } from 'react-native';
|
||||
import { useRef } from 'react';
|
||||
import { useKeepAwake } from 'expo-keep-awake';
|
||||
import Colors from 'constants/Colors';
|
||||
import { Video, AVPlaybackStatus } from 'expo-av';
|
||||
import { useAudioAsset } from './useAudioAsset.hook';
|
||||
@ -12,6 +13,8 @@ export function AudioAsset({ topicId, asset, dismiss }) {
|
||||
|
||||
const { state, actions } = useAudioAsset(topicId, asset);
|
||||
|
||||
useKeepAwake();
|
||||
|
||||
const player = useRef(null);
|
||||
|
||||
return (
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { ActivityIndicator, Image, View, TouchableOpacity } from 'react-native';
|
||||
import Colors from 'constants/Colors';
|
||||
import { useKeepAwake } from 'expo-keep-awake';
|
||||
import { Video, AVPlaybackStatus } from 'expo-av';
|
||||
import { useVideoAsset } from './useVideoAsset.hook';
|
||||
import { styles } from './VideoAsset.styled';
|
||||
@ -9,6 +10,8 @@ export function VideoAsset({ topicId, asset, dismiss }) {
|
||||
|
||||
const { state, actions } = useVideoAsset(topicId, asset);
|
||||
|
||||
useKeepAwake();
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<TouchableOpacity activeOpacity={1} style={styles.container} onPress={actions.showControls}>
|
||||
|
Loading…
Reference in New Issue
Block a user