video.vue 716 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view>
  3. <video style="width: 100%; height: 100vh;" :src="url" codec="software" :play-strategy="0" controls show-fullscreen-btn="true" autoplay></video>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. url: "",
  11. };
  12. },
  13. onLoad() {
  14. // #ifndef APP-NVUE
  15. const eventChannel = this.getOpenerEventChannel();
  16. // #endif
  17. // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
  18. eventChannel.on('acceptDataFromOpenerPage', (data) => {
  19. console.log(data)
  20. uni.setNavigationBarTitle({
  21. title: data.title
  22. })
  23. this.url = data.url
  24. })
  25. }
  26. }
  27. </script>
  28. <style lang="scss">
  29. </style>