Wechat applet Android video playback freeze problem

Encountered two problems in the video component in the development of WeChat applets

1. There will be obvious lag when playing videos on Android phones

At first I thought it was a network problem, or a video file problem. Checked it out and it's ok.

Finally, add an attribute and it will be OK.

uniapp and native applet methods

:custom-cache="false" 
custom-cache={
    
    {false}}

The video component is compatible with iOS phones

Adding this attribute to custom-cache will make

2. There will be a black screen problem for a few seconds when the iOS phone plays the video for the first time

Therefore, I added the judgment of the current mobile phone model

uni.getDeviceInfo().deviceType
Get the current device api

When it is an iPhone, do not add the custom-cache attribute,

Otherwise add the custom-cache attribute

* I added custom-cachet='true' and it is still useless, so I just use if to judge directly through the template view

Guess you like

Origin blog.csdn.net/qq_35946021/article/details/128980219