# wx.previewMedia(Object object)
Start from base library version 2.12.0. Please remaining backward compatible.
with Promise style call: Supported
Mini Program plugin: Support, need to Mini Program base library version no less than 2.15.0
Preview pictures and videos.
# parameter
# Object object
attribute | type | Default values | Required | Introductions | Minimum version |
---|---|---|---|---|---|
sources | Array.<Object> | yes | List of resources to preview | ||
current | number | 0 | no | Resource Number Currently Displayed | |
showmenu | boolean | true | no | Displays long press menu | 2.13.0 |
referrerPolicy | string | no-referrer | no | origin : Send the full referrer no-referrer : Do not send. Format fixed to https://servicewechat.com/{appid}/{version}/page-frame.html Where {appid} For Mini Program appid,{version} Is the version number of the Mini Program, which is 0 Represents a development version, a trial version, and a review version with a version number of devtools Represented as developer tools and the rest as official versions | 2.13.0 |
success | function | no | Interface calls the successful callback function | ||
fail | function | no | Interface calls failed callback functions | ||
complete | function | no | Callback function at the end of an interface call (both successful and unsuccessful calls are executed) |
object.sources Structure
attribute | type | Default values | Required | Introductions |
---|---|---|---|---|
url | String | yes | Address of a picture or video | |
type | String | image | no | Type of resource, default to picture |
poster | string | no | Cover image of the video |
type Legal value
value | Introductions | Minimum version |
---|---|---|
image | picture | |
video | video |