Commit 4cc4e43b authored by isstuev's avatar isstuev

remove video autoplay from lists

parent 50a96d5d
...@@ -31,6 +31,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P ...@@ -31,6 +31,7 @@ const NFTItem = ({ token, value, isLoading, withTokenLink, ...tokenInstance }: P
animationUrl={ tokenInstance?.animation_url ?? null } animationUrl={ tokenInstance?.animation_url ?? null }
imageUrl={ tokenInstance?.image_url ?? null } imageUrl={ tokenInstance?.image_url ?? null }
isLoading={ isLoading } isLoading={ isLoading }
autoplayVideo={ false }
/> />
</Link> </Link>
<Flex justifyContent="space-between" w="100%" flexWrap="wrap"> <Flex justifyContent="space-between" w="100%" flexWrap="wrap">
......
...@@ -18,9 +18,10 @@ interface Props { ...@@ -18,9 +18,10 @@ interface Props {
className?: string; className?: string;
isLoading?: boolean; isLoading?: boolean;
withFullscreen?: boolean; withFullscreen?: boolean;
autoplayVideo?: boolean;
} }
const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen }: Props) => { const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen, autoplayVideo }: Props) => {
const [ isMediaLoading, setIsMediaLoading ] = React.useState(true); const [ isMediaLoading, setIsMediaLoading ] = React.useState(true);
const [ isLoadingError, setIsLoadingError ] = React.useState(false); const [ isLoadingError, setIsLoadingError ] = React.useState(false);
...@@ -71,7 +72,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen ...@@ -71,7 +72,7 @@ const NftMedia = ({ imageUrl, animationUrl, className, isLoading, withFullscreen
switch (type) { switch (type) {
case 'video': case 'video':
return <NftVideo { ...props }/>; return <NftVideo { ...props } autoPlay={ autoplayVideo }/>;
case 'html': case 'html':
return <NftHtml { ...props }/>; return <NftHtml { ...props }/>;
case 'image': case 'image':
......
...@@ -5,15 +5,17 @@ import { mediaStyleProps, videoPlayProps } from './utils'; ...@@ -5,15 +5,17 @@ import { mediaStyleProps, videoPlayProps } from './utils';
interface Props { interface Props {
src: string; src: string;
autoPlay?: boolean;
onLoad: () => void; onLoad: () => void;
onError: () => void; onError: () => void;
onClick?: () => void; onClick?: () => void;
} }
const NftVideo = ({ src, onLoad, onError, onClick }: Props) => { const NftVideo = ({ src, autoPlay = true, onLoad, onError, onClick }: Props) => {
return ( return (
<chakra.video <chakra.video
{ ...videoPlayProps } { ...videoPlayProps }
autoPlay={ autoPlay }
src={ src } src={ src }
onCanPlayThrough={ onLoad } onCanPlayThrough={ onLoad }
onError={ onError } onError={ onError }
......
...@@ -18,6 +18,7 @@ const NftVideoFullscreen = ({ src, isOpen, onClose }: Props) => { ...@@ -18,6 +18,7 @@ const NftVideoFullscreen = ({ src, isOpen, onClose }: Props) => {
src={ src } src={ src }
maxH="90vh" maxH="90vh"
maxW="90vw" maxW="90vw"
autoPlay={ true }
/> />
</NftMediaFullscreenModal> </NftMediaFullscreenModal>
); );
......
...@@ -41,7 +41,6 @@ export const mediaStyleProps = { ...@@ -41,7 +41,6 @@ export const mediaStyleProps = {
}; };
export const videoPlayProps = { export const videoPlayProps = {
autoPlay: true,
disablePictureInPicture: true, disablePictureInPicture: true,
loop: true, loop: true,
muted: true, muted: true,
......
...@@ -23,6 +23,7 @@ const TokenInventoryItem = ({ item, token, isLoading }: Props) => { ...@@ -23,6 +23,7 @@ const TokenInventoryItem = ({ item, token, isLoading }: Props) => {
animationUrl={ item.animation_url } animationUrl={ item.animation_url }
imageUrl={ item.image_url } imageUrl={ item.image_url }
isLoading={ isLoading } isLoading={ isLoading }
autoplayVideo={ false }
/> />
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment