When canvas acquires the first frame image of the video, the mobile end returns data:

< li VFF = "(iMagne index) in batch": key= "index" >

        <video :src="i.tea_vidio_link" @loadeddata="getVedioImage(index)" ref="piVedio" 
            crossOrigin="anonymous"></video>


getVedioImage (index) {

  console.log(111111)
  var video=this.$refs.piVedio[index]
  var canvas = document.createElement("canvas");
  canvas.width = video.videoWidth ;
  canvas.height = video.videoHeight;
  
  canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
  console.log(canvas.toDataURL("image/jpeg"))
  var src=canvas.toDataURL("image/jpeg");
  video.poster=src;
},
Apr.28,2022

how to solve it? I've been working on it for a long time. The mobile end of ok on PC does not display


Hello, is this solved?

Menu