mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
show controls only after loading
This commit is contained in:
parent
295d7ee8a7
commit
c471a76914
@ -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" />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
@ -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 });
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user