Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use WeChat Mini Programs's video plug-in

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use WeChat Mini Programs's video plug-in". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use WeChat Mini Programs's video plug-in.

Introduce plug-ins into Mini Program.

Enter the Wechat public platform, find the third-party service in the settings, and add plug-ins in the plug-in management. Search for Tencent Video, click add, and open Tencent Video's details to find the appid and version number of the plug-in.

Next comes the code section, which is added to the app.json

"plugins": {"tencentVideo": {"version": "1.1.1", "provider": "wxa75efa648b60994b"}

Where version is the version number and provider is appid.

Second, reference the components of the plug-in in the pages you need to use

There is no specific description of this method in the official documentation, so it will lead to the problem that the txv-video corresponding to playerid cannot be found.

Open the json file where you want to use the plug-in page and add

"usingComponents": {"txv-video": "plugin://tencentVideo/video"}

This means that the txv-video component can be used in the page.

Third, use components in the page

Go to the wxml file and add it

This step is very simple. Vid is Tencent Video's vid,playerid is the unique identification number of the txv-video, and this component cannot be modified through css.

4. Introduce it into js

If you don't want to control the plug-in in js, you don't have to introduce it.

Const TxvContext = requirePlugin ("tencentVideo"); let txvContext = TxvContext.getTxvContext ('txv1'); txvContext.play (); / / at this point, I believe you have a better understanding of "how to use WeChat Mini Programs's video plug-in". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report