| | |
| | | <script> |
| | | import Hls from 'hls.js' |
| | | import DPlayer from 'dplayer' |
| | | import myConstant from "../../config/myConstant.js" |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | disabledPointer: false, |
| | | dp: null, |
| | | hls: null, |
| | | playHistory: [], |
| | | playRecordIds: [], |
| | | volumeInit: 0.1, |
| | |
| | | currentTime: 0, |
| | | duration: 0, |
| | | playingVideoData: { |
| | | pic: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", |
| | | pic: "", |
| | | url: "", |
| | | type: "normal", |
| | | title: "", |
| | | id: "" |
| | | }, |
| | | hls: null, |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | return |
| | | } |
| | | |
| | | if (videoData.url != null && videoData.urlL != "" && videoData.url.endsWith("m3u8")) { |
| | | if (videoData.url != null && videoData.url != "" && videoData.url.endsWith("m3u8")) { |
| | | videoData.type = "customHls"; |
| | | } else { |
| | | videoData.type = "normal"; |
| | | } |
| | | |
| | | if (videoData.pic === null || videoData.pic == ''){ |
| | | videoData.pic = myConstant.defaultBGVideo; |
| | | } |
| | | |
| | | //重要!!防止hls类型视频在切换后不停在后台缓存 |
| | | if (this.hls != null) { |
| | | this.hls.destroy(); |