In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of WeChat Mini Programs how to call video, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe everyone will gain something after reading this video article on how to call WeChat Mini Programs. Let's take a look.
Wx.chooseVideo (OBJECT)
Shoot a video or select a video from a mobile photo album and return to the temporary file path of the video.
OBJECT parameter description:
Parameter type is required to indicate whether sourceTypeStringArray "album" selects videos from photo albums, and "camera" uses a camera to shoot videos. Default is: ['album',' camera'] maxDurationNumber whether to shoot videos for the longest time (in seconds). The maximum support for 60 seconds is whether the cameraString is set to the front or rear camera by default. Front: front, back: post. The default backsuccessFunction No API is called successfully, and the temporary file path of the video file is returned. For more information, please see the returned parameters indicating that failFunction API calls failed callback function completeFunction No API call ends callback function (both successful and failed calls will be executed)
Success return parameter description:
Parameter description tempFilePath temporary file path of selected video duration length of selected video size amount of data size height returns the length width of the selected video returns the width of the selected video
Note: the temporary path of the file can be used normally during the startup of Mini Program. For lasting preservation, you need to call wx.saveFile actively and access it only when Mini Program is started next time.
Sample code:
Get video Page ({bindButtonTap:function () {var that = thiswx.chooseVideo ({sourceType: ['album','camera'], maxDuration:60, camera:' back' Success: function (res) {that.setData ({src:res.tempFilePath}) wx.saveVideoToPhotosAlbum (OBJECT)
The basic library 1.2.0 is supported, and the lower version needs to be compatible.
User authorization (scope.writePhotosAlbum) is required to save videos to system photo albums. For more information, please see user authorization.
OBJECT parameter description:
The parameter name type is required to indicate that filePathString is a video file path, which can be a temporary file path or a permanent file path. SuccessFunction No API calls successful callback function failFunction No API call failed callback function completeFunction No API call ends callback function (both successful and failed API calls will be executed)
Success return parameter description:
The parameter name type describes the result of the errMsgString call
Sample code:
Wx.saveVideoToPhotosAlbum ({success (res) {}}) Bug & Tip
Tip: the camera parameter cannot take effect on some Android phones because the system ROM does not support it.
This is the end of the article on "how to call Video by WeChat Mini Programs". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to call video by WeChat Mini Programs". If you want to learn more, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.