show controls only after loading

This commit is contained in:
Roland Osborne 2022-10-06 13:33:34 -07:00
parent 295d7ee8a7
commit c471a76914
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@ export function VideoAsset({ topicId, asset }) {
{ state.url && (
<Video source={{ uri: state.url }} style={{ width: state.width, height: state.height }} resizeMode={'cover'}
onReadyForDisplay={(e) => actions.setResolution(e.naturalSize.width, e.naturalSize.height)}
useNativeControls resizeMode="contain" />
useNativeControls={state.controls} resizeMode="contain" />
)}
</>
);

View File

@ -12,6 +12,7 @@ export function useVideoAsset(topicId, asset) {
width: 1,
weight: 1,
url: null,
controls: false,
});
const conversation = useContext(ConversationContext);
@ -48,7 +49,7 @@ export function useVideoAsset(topicId, asset) {
const actions = {
setResolution: (width, height) => {
updateState({ videoRatio: width / height });
updateState({ controls: true, videoRatio: width / height });
}
};