videoToast.js 644 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // components/videoToast/videoToast.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. videoSrc:{
  8. type:String,
  9. value:null
  10. },
  11. poster:{
  12. type:String,
  13. value:null
  14. }
  15. },
  16. /**
  17. * 组件的初始数据
  18. */
  19. data: {
  20. videoContext:null
  21. },
  22. ready:function () {
  23. this.data.videoContext = wx.createVideoContext('myVideo')
  24. },
  25. /**
  26. * 组件的方法列表
  27. */
  28. methods: {
  29. hiddenAction:function () {
  30. this.data.videoContext.stop();
  31. this.triggerEvent('action');
  32. },
  33. /**
  34. * 阻断事件透传
  35. */
  36. tapAction:function() {
  37. }
  38. }
  39. })