course.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <view class="video-box" v-if="videoItem">
  4. <video
  5. id="video-content-box"
  6. style="width: 100%;height: 420rpx;"
  7. :poster="poster"
  8. controls
  9. :show-fullscreen-btn="true"
  10. :auto-pause-if-open-native="true"
  11. :auto-pause-if-navigate="true"
  12. :enable-progress-gesture="false"
  13. :show-progress="true"
  14. :picture-in-picture-mode="[]"
  15. :show-background-playback-button="false"
  16. :src="videoItem.videoUrl"
  17. >
  18. </video>
  19. </view>
  20. <view class="descbox" >
  21. <view class="descbox-title">{{videoItem.title}}</view>
  22. <view class="descbox-desc">{{videoItem.description}}</view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. poster:'',
  31. videoItem:{},
  32. videoId:null,
  33. }
  34. },
  35. onLoad(option) {
  36. if(option.videoitem){
  37. this.videoItem=option.videoitem ? JSON.parse(option.videoitem) : {}
  38. this.videoId=this.videoItem.videoId
  39. this.poster = this.videoItem.videoImgUrl
  40. uni.setNavigationBarTitle({
  41. title: this.videoItem && this.videoItem.title ? this.videoItem.title : ''
  42. });
  43. }
  44. },
  45. methods: {
  46. }
  47. }
  48. </script>
  49. <style lang="scss" scoped>
  50. .video-box {
  51. width: 100%;
  52. height: 420rpx;
  53. overflow: hidden;
  54. position: relative;
  55. #myVideo {
  56. width: 100%;
  57. height: 100%;
  58. }
  59. }
  60. .descbox {
  61. padding: 20rpx 32rpx;
  62. margin-bottom: 20rpx;
  63. background-color: #fff;
  64. font-family: PingFang SC, PingFang SC;
  65. font-weight: 400;
  66. font-size: 28rpx;
  67. color: #222222;
  68. line-height: 42rpx;
  69. word-break: break-word;
  70. &-title {
  71. padding: 24rpx 0;
  72. font-weight: 500;
  73. font-size: 32rpx;
  74. }
  75. &-desc {
  76. overflow: hidden;
  77. position: relative;
  78. }
  79. }
  80. </style>