VideoPlayerPopup.js 585 Bytes
Component({
  properties: {
    show: {
      type: Boolean,
      value: false,
    },
    videoUrl: {
      type: String,
      value: '',
    },
  },

  data: {},

  methods: {
    onClose() {
      this.setData({
        show: false,
      });
      this.triggerEvent('close');
    },
    preventMove() {
      // 阻止滚动穿透
      return false;
    },
    onPlay() {
      // 视频开始播放
    },
    onError(e) {
      console.error('视频播放错误:', e);
      wx.showToast({
        title: '视频播放失败',
        icon: 'none',
      });
    },
  },
});