uniapp can't play the video when using the video tag, and there is a black screen problem
The problem occurs
And an error occurs after clicking play
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
I hope it can solve everyone's problems