On the failure of WeChat Mini Programs VideoContext.stop ()

when a video is played
you want to stop playing a video by clicking on a location
using VideoContext.stop () has no effect at all

see someone offering this idea:

_this.videoContext.seek(0)
_this.videoContext.pause();
/**
   * 
   * 
   */
  palyVideo:function(e) {
    let _this = this;
    _this.setData({
      hidden: false,
    });
    _this.videoContext.play();  
  },

  /**
   * 
   * 
   */
  hiddenVideo:function(e) {
    let _this = this; 
    _this.videoContext.seek(0)
    _this.videoContext.pause();

    // _this.setData({
    //   hidden: true,
    // });

  },


  /**
   * --
   */
  onReady: function (res) { 
    let _this = this;
    _this.videoContext = wx.createVideoContext("myVideo"); 
  },
May.06,2022

it's not valid in developer tools. Real machine testing is fine

.
Menu