uniapp can't play the video when using the video tag, and there is a black screen problem

uniapp can't play the video when using the video tag, and there is a black screen problem

The problem occurs

insert image description here
And an error occurs after clicking play
insert image description here

Solution

The reason for the problem may be that the video stream of the video is not compatible or the video file cannot be seen under f12, so we use the computed property to solve this problem

js

computed:{
    
    
	videoHtml: function() {
    
    
		return `<video  autoplay loop muted controls="controls" width="100%" height="870px"><source src="${
      
      this.videoSrc}" type="video/mp4"></video>`;
	}
}

html

<view v-html="videoHtml"></view>

According to the above method, the problem will be solved
insert image description here

I hope it can solve everyone's problems

Guess you like

Origin blog.csdn.net/weixin_44255044/article/details/129882950