On the use of promise

    createVideoContext () {
      var p = new Promise((resolve, reject) => {
        var myVideo = wx.createVideoContext("myVideo")
        resolve(myVideo)
      })
      return p
    }
wx.createVideoContext("myVideo")    
May.27,2022

`createVideoContext () {
var myVideo = Promise.resolve (wx.createVideoContext ('myVideo'))
return myVideo
} `

how about this?


wepy is good. Mini Program api comes with its own package. Wepy is written as await wepy.createVideoContext ('myVideo')

.
Menu