Video.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="video-page">
  3. <div class="video-title">
  4. <h3 class="video-title-h3">12月03日直播</h3>
  5. </div>
  6. <div class="video-info">
  7. <div class="video-src">
  8. <!--<video controls="controls" width="800" style="display:block;"
  9. src="https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20190516/acalssOne%E7%BD%91%E9%A1%B5%E7%99%BB%E5%BD%95%E5%AD%A6%E4%B9%A0%E6%96%B9%E6%B3%95.mp4">
  10. 您的浏览器不支持 video 标签。
  11. </video>-->
  12. <video-player class="video-player-box" style="width:800px;"
  13. ref="videoPlayer"
  14. :options="playerOptions"
  15. :playsinline="true"
  16. customEventName="customstatechangedeventname"
  17. @play="onPlayerPlay($event)"
  18. @pause="onPlayerPause($event)"
  19. @ended="onPlayerEnded($event)"
  20. @waiting="onPlayerWaiting($event)"
  21. @playing="onPlayerPlaying($event)"
  22. @loadeddata="onPlayerLoadeddata($event)"
  23. @timeupdate="onPlayerTimeupdate($event)"
  24. @canplay="onPlayerCanplay($event)"
  25. @canplaythrough="onPlayerCanplaythrough($event)"
  26. @statechanged="playerStateChanged($event)"
  27. @ready="playerReadied">
  28. </video-player>
  29. </div>
  30. <div class="video-detail-info">
  31. <Form :label-width="100">
  32. <FormItem label="获奖情况:">
  33. <span>{{routerData.activityAwardName}}</span>
  34. </FormItem>
  35. <FormItem label="主讲:">
  36. <span>{{routerData.employeeName}}</span>
  37. </FormItem>
  38. <FormItem label="单位:">
  39. <span>{{routerData.employeeSchoolName}}</span>
  40. </FormItem>
  41. <FormItem label="年级:">
  42. <span>{{routerData.gradeName}}</span>
  43. </FormItem>
  44. <FormItem label="学科:">
  45. <span>{{routerData.categoryName}}</span>
  46. </FormItem>
  47. <FormItem label="教学设计:">
  48. <span>暂无数据</span>
  49. </FormItem>
  50. <FormItem label="教学反思:">
  51. <span>暂无数据</span>
  52. </FormItem>
  53. </Form>
  54. <div class="download-video">
  55. <a download="video" style="color:#999999;font-size:14px;" href="https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20190517/%E5%B0%8F%E5%AD%A6%E8%8B%B1%E8%AF%AD301%E8%83%A1%E9%A2%96--2019.mp4">
  56. <Icon type="md-cloud-download" size="22" color="white" />
  57. 下载视频
  58. </a>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="video-other">
  63. <h3 class="video-title-h3">推荐作品</h3>
  64. </div>
  65. <div class="videos-wrap">
  66. <div class="video-item" v-for="(item , index) in videos" @click="showVideo(index)">
  67. <img src="../../assets/image/default-act.png" width="95%" />
  68. <p>{{item.title}}</p>
  69. </div>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import rewardList from '@/static/rewardList.json'
  75. export default {
  76. data() {
  77. return {
  78. playerOptions: {
  79. // videojs options
  80. muted: true,
  81. language: 'en',
  82. preload: 'auto',
  83. playbackRates: [0.7, 1.0, 1.5, 2.0],
  84. sources: [{
  85. type: "video/mp4",
  86. src: "https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20190517/%E5%B0%8F%E5%AD%A6%E8%8B%B1%E8%AF%AD301%E8%83%A1%E9%A2%96--2019.mp4"
  87. //src: "https://teammodelstorage.blob.core.chinacloudapi.cn/teammodelcontest/20190517/%E5%B0%8F%E5%AD%A6%E8%8B%B1%E8%AF%AD301%E8%83%A1%E9%A2%96--20180419.MP4"
  88. }],
  89. poster: "/static/images/author.jpg",
  90. },
  91. routerData: {},
  92. rewardDatas: [],
  93. videos: [
  94. {
  95. title:'12月14日直播'
  96. },
  97. {
  98. title:'12月14日直播'
  99. },
  100. {
  101. title:'12月14日直播'
  102. },
  103. {
  104. title:'12月14日直播'
  105. },
  106. {
  107. title:'12月14日直播'
  108. },
  109. {
  110. title:'12月14日直播'
  111. },
  112. {
  113. title:'12月14日直播'
  114. },
  115. {
  116. title:'12月14日直播'
  117. }
  118. ]
  119. }
  120. },
  121. methods: {
  122. showVideo(index) {
  123. //alert(index);
  124. this.$router.push(
  125. {
  126. name: 'video',
  127. query: {
  128. rewardIndex: index
  129. }
  130. }
  131. );
  132. }
  133. },
  134. mounted() {
  135. let index = this.$route.query.rewardIndex;
  136. //alert(index);
  137. this.rewardDatas = rewardList.data.list;
  138. if (index == undefined) {
  139. this.routerData = this.rewardDatas[0];
  140. } else {
  141. this.routerData = this.rewardDatas[index];
  142. }
  143. },
  144. watch: {
  145. $route() {
  146. let index = this.$route.query.rewardIndex;
  147. //alert(index);
  148. if (index == undefined) {
  149. this.routerData = this.rewardDatas[0];
  150. } else {
  151. this.routerData = this.rewardDatas[index];
  152. }
  153. }
  154. }
  155. }
  156. </script>
  157. <style>
  158. .video-page {
  159. width: 1200px;
  160. margin: 100px auto;
  161. }
  162. .video-title {
  163. margin-bottom: 20px;
  164. height: 20px;
  165. }
  166. .video-title-h3 {
  167. height: 20px;
  168. font-size: 20px;
  169. line-height: 20px;
  170. border-left: 6px solid #37b1fa;
  171. padding-left: 12px;
  172. }
  173. .video-info {
  174. width: 100%;
  175. display: table;
  176. }
  177. .video-detail-info {
  178. width:400px;
  179. background:#222222;
  180. display:table-cell;
  181. vertical-align:top;
  182. padding:20px 10px 20px 30px;
  183. position:relative;
  184. }
  185. .video-detail-info .ivu-form-item {
  186. margin-bottom:8px;
  187. }
  188. .video-detail-info .ivu-form .ivu-form-item-label {
  189. font-size:14px;
  190. color:#999999;
  191. }
  192. .video-detail-info .ivu-form-item-content {
  193. font-size: 14px;
  194. color: #ffffff;
  195. }
  196. .video-src {
  197. display:table-cell;
  198. width:800px;
  199. background:#000000;
  200. }
  201. .video-src .video-js {
  202. width:800px;
  203. height:450px;
  204. }
  205. .download-video {
  206. text-align:center;
  207. position:absolute;
  208. width:100%;
  209. bottom:20px;
  210. left:0;
  211. }
  212. .video-other {
  213. margin-top:20px;
  214. }
  215. .videos-wrap {
  216. margin:0px -10px 0px -10px;
  217. }
  218. .video-item {
  219. width: 25%;
  220. display: inline-block;
  221. padding: 0px 10px;
  222. margin-top:20px;
  223. cursor:pointer;
  224. }
  225. .video-item p {
  226. font-size: 16px;
  227. color: #000;
  228. margin-top: 10px;
  229. text-decoration: none;
  230. text-indent: 8px;
  231. }
  232. </style>