Commit 4c7dfa8dd309d6236fa4d9555f8cdb38e2eccab1

Authored by zhiyangdu
1 parent 7782de8d

视频播放

Showing 1 changed file with 13 additions and 15 deletions
src/pages/index/index.vue
... ... @@ -6,14 +6,14 @@
6 6 <div class="item">
7 7 <div @click="link(1)">
8 8 </div>
9   - <div @click="link(2)">
  9 + <div @click="link(2)">
10 10  
11 11 </div>
12 12 </div>
13 13 <!--视频-->
14 14 <div class="video1_poster">
15 15 <div class="video_box">
16   - <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay($event)"
  16 + <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay(1)"
17 17 ref="videoPlayer"
18 18 :playsinline="playsinline"
19 19 :options="playerOptions"
... ... @@ -41,7 +41,7 @@
41 41 <!--视频-->
42 42 <div class="div12 video2_poster">
43 43 <div class="video_box">
44   - <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay($event)"
  44 + <video-player class="video-player vjs-custom-skin" @play="onPlayerPlay(2)"
45 45 ref="videoPlayer"
46 46 :playsinline="playsinline"
47 47 :options="playerOptions"
... ... @@ -67,7 +67,7 @@
67 67 </template>
68 68  
69 69 <script>
70   - import { videoPlayer } from 'vue-video-player';
  70 + import {videoPlayer} from 'vue-video-player';
71 71 import 'video.js/dist/video-js.css';
72 72 import '../../../static/css/video.css';
73 73 export default {
... ... @@ -101,7 +101,7 @@
101 101 }
102 102 }
103 103 },
104   - components:{
  104 + components: {
105 105 videoPlayer
106 106 },
107 107 created(){
... ... @@ -110,9 +110,9 @@
110 110 methods: {
111 111 link(index){
112 112 debugger
113   - if(index==1){
  113 + if (index == 1) {
114 114 window.location.href = this.getParams(this.mode).shop.apiAddress + "/html/mall/1/#/pages/main/cultureDetail/cultureDetail?id=9621652"
115   - }else{
  115 + } else {
116 116 window.location.href = this.getParams(this.mode).shop.apiAddress + "/html/mall/1/#/pages/main/cultureDetail/cultureDetail?id=9620396"
117 117 }
118 118  
... ... @@ -121,14 +121,12 @@
121 121 * 视频播放
122 122 * @param {object} $event [播放器对象]
123 123 */
124   - onPlayerPlay($event) {
125   -// if(this.isiPhone.value && window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.CNDSPlayer) {
126   -// window.webkit.messageHandlers.CNDSPlayer.postMessage({body: {
127   -// playUrl:"https://v.youku.com/v_show/id_XNDQyOTAxNjE2MA==.html?s=e438e14b3fa94613a1bb&scm=20140719.manual.15319.show_e438e14b3fa94613a1bb",
128   -//// playUrl: this.playerOptions.sources[0].src, // 视频URL
129   -// isLive: 0 // 0录播1直播
130   -// }});
131   -// }
  124 + onPlayerPlay(event) {
  125 + if (event == 1) {
  126 + this.playerOptions.sources[0].src= "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/12/30/5e09739a07d18.mp4"
  127 + } else {
  128 + this.playerOptions.sources[0].src= "https://wjjtest.ys2.cnliveimg.com/802/shop/img/2019/12/30/5e0973f0aa9be.mp4"
  129 + }
132 130 },
133 131 }
134 132 }
... ...