live.vue 872 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view v-if="url!=null && url!==''">
  3. <web-view :src="url" />
  4. </view>
  5. <view v-else style="display: flex; align-items: center; height: 30vh; justify-content: center; color: #666;">
  6. 抱歉,该课件暂不支持查看!
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. components: {
  12. },
  13. data() {
  14. return {
  15. courseId: '',
  16. liveId: '',
  17. url: ''
  18. }
  19. },
  20. onLoad: function(option) {
  21. this.courseId = option.courseId
  22. this.liveId = option.liveId
  23. // 解码后重新加密
  24. const param = decodeURIComponent(option.url)
  25. this.url = `${this.$urls.api}/player/live.html?source=${encodeURIComponent(param)}`
  26. console.log('full', this.url)
  27. },
  28. methods: {
  29. statechange(e) {
  30. console.log('live-player code:', e.detail.code)
  31. },
  32. error(e) {
  33. console.error('live-player error:', e.detail.errMsg)
  34. }
  35. }
  36. }
  37. </script>