How to Display a Video in Your Web Page
The issue is that you are trying to load a video file ('mp4') using the FileReader and assign it to an img element. The FileReader is typically used for reading text or binary data, not for loading videos.
To display a video, you can use the <video> tag instead. Here's an example of how you can display a video using the <video> tag:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>WebCat</title>
</head>
<body>
<video src="https://jsmov2.a.yximgs.com/upic/2023/07/29/17/BMjAyMzA3MjkxNzU0MTdfMjQ1NDk3NDA1Nl8xMDkxNzcxMjk0MTFfMV8z_b_B3adfcd43dabb9327cb0ca934ff913dff.mp4" controls>
Your browser does not support the video tag.
</video>
</body>
</html>
In this example, the src attribute of the <video> tag is set to the URL of the video file. The controls attribute is added to display video controls (play/pause, volume, etc.). If the browser does not support the <video> tag, the text "Your browser does not support the video tag." will be displayed.
原文地址: https://www.cveoy.top/t/topic/qi7C 著作权归作者所有。请勿转载和采集!