Here is my url:
https://firebasestorage.googleapis.com/v0/b/roger.appspot.com/o/images%2Fd4%2FIMG_6538.mov?alt=media&token=19f7b5e7-77d6-480e-97f1-55ad9d27bb08
I'm using includes
to run over the URL to find mov
However, my function returns null
// check media url to see if link left should render video or image
useEffect(() => {
async () => {
if (imageUrl) {
const isVideo = await imageUrl.includes("mp4", "mov", "MOV");
if (isVideo) {
return setMediaType("video");
}
setMediaType("image");
}
};
}, [imageUrl]);
When I console log mediaType
I get null
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…