Implementation of video upload preview image on mobile terminal

make an input type=file selection video for webapp, then preview it on the page, and then upload it.

was found on the Internet.
   var objectURL = URL.createObjectURL(this.files[0]);
    $(".previewVideo").html("<video src="" +
                objectURL +
                "" controls></video>");
    setTimeout(function () {
         var scale = 0.25,
                video = $("video")[0],
                canvas = document.createElement("canvas"),
                canvasFill = canvas.getContext("2d");
            canvas.width = video.videoWidth * scale;
            canvas.height = video.videoHeight * scale;
            canvasFill.drawImage(video, 0, 0, canvas.width, canvas.height);
            var src = canvas.toDataURL("image/jpeg");
            $(".previewImg").html("<img id="imgSmallView" src="" + src + "" alt="" />");
    }, 500);
  
  pc
  

clipboard.png

clipboard.png
is there any solution? I read on the Internet that I used html2canvas to get screenshots, but I don"t know how feasible it is.

Oct.12,2021

I guess the mobile video hasn't been loaded yet, so you can't intercept the event that
listens for video to start playing, and then process the screenshot

.

video.addEventListener ('playing', function () {/ *. * /});


Hello, have you solved this finally?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be2c23-30d9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be2c23-30d9e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?