Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the ways of WeChat Mini Programs's video recording?

Shulou Source: shulou.com Published: 2022-05-31 13:32:55 10月01日 Update

This article mainly introduces the relevant knowledge of WeChat Mini Programs's video recording methods, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this WeChat Mini Programs video recording method. Let's take a look.

Method one

Wx.chooseVideo, the api Wechat will pop up two options to select video and shoot, because this time it is mainly about shooting video. When we click to shoot, Wechat will automatically pull to the camera for shooting. After recording, the system will temporarily cache the MP4 file through wx.chooseVideo.

Benefit: since the camera is generated by Wechat, the compatibility will be relatively stable.

The downside: it is also because of the interface generated by Wechat, so it is impossible to override the elements and change the style of the interface.

Method two

Generated by the native camera component, and then recorded by calling CameraContext.startRecord, and then stopped by CameraContext.stopRecord, CameraContext.stopRecord will have the corresponding temporarily cached MP4 file.

Benefits: native components we can use cover-view or cover-image to write corresponding styles in camera components, such as locking portraits and other operations, so there will be a variety of styles.

The downside: the compatibility is relatively poor. Once the stopRecord reports an error, it cannot stop the second time, resulting in the inability to define the camera component to start re-recording.

For example, in the scenario, the countdown time is 3 seconds to call stopRecord, and the user triggers the stopRecord through the click event, because sometimes the phone processing is relatively slow, because the stopRecord is triggered twice, but because the error return is faster than the first correct return, the stopRecord will always packet is stopping and stay stuck. And there are still a lot of people in the community who report similar errors that can't stop recording, so try to choose method one if you don't need to add something to the camera component.

This is the end of the article on "what are the ways of WeChat Mini Programs's video recording?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what are the ways of WeChat Mini Programs video recording?" if you want to learn more knowledge, you are welcome to follow the industry information channel.

Tags: Video components methods programs styles videos methods knowledge shooting photography generation compatibility content disadvantages advantages files aspects interfaces articles caching Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info Linux Apple NVidia