video.vue 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="video_con">
  3. <video id="myVideo" :src="video_url" controls :poster='posterImage' autoplay="true"></video>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. key: '',
  11. video_url:'',
  12. posterImage:''
  13. };
  14. },
  15. components: {},
  16. props: {},
  17. onReady() {
  18. // // 获取 video 上下文 videoContext 对象
  19. // this.videoContext = uni.createVideoContext('myVideo');
  20. // // 进入全屏状态
  21. // this.videoContext.requestFullScreen();
  22. },
  23. onLoad(options) {
  24. this.video_url=options.video_url
  25. this.posterImage=options.posterImage
  26. },
  27. methods: {
  28. }
  29. };
  30. </script>
  31. <style>
  32. page{
  33. width: 750rpx;
  34. margin: 0 auto;
  35. height: 100%;
  36. }
  37. .video_con{
  38. width: 750rpx;
  39. height: 100%;
  40. }
  41. video{
  42. width: 750rpx;
  43. height: 100%;
  44. }
  45. </style>