| New file |
| | |
| | | <template> |
| | | <div > |
| | | <div id="dplayer"></div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <script> |
| | | import DPlayer from 'dplayer'; |
| | | |
| | | export default { |
| | | name: 'VideoPlayer', |
| | | components:{}, |
| | | data() { |
| | | return { |
| | | winH: '300px', |
| | | id: 'dpPlayerDom', |
| | | player: null, |
| | | filePath:'', |
| | | type:'', |
| | | url:'', |
| | | dp: null, |
| | | time: 5, |
| | | } |
| | | |
| | | }, |
| | | mounted() { |
| | | this.initDPlayer(); |
| | | }, |
| | | methods: { |
| | | initDPlayer() { |
| | | this.dp = new DPlayer({ |
| | | container: document.getElementById('dplayer'), // 确保你的 HTML 中有这个元素 |
| | | danmaku: { |
| | | speedRate: 0.5, |
| | | api: 'http://192.168.0.147:8889/training/trainingContentCommon/getDanmaku',// 添加弹幕的后端地址 |
| | | user: this.$store.getters.userId, |
| | | bottom: "15%", |
| | | id: 1 |
| | | }, |
| | | video: { |
| | | url: 'static/1080p.mp4', // 这里填写视频的 URL |
| | | //url: 'static/911Mothers_2010W-480p.mp4', // 这里填写视频的 URL |
| | | pic: '/Users/kongdeqiang/Downloads/image/v2-1e575237731ad3d8169dfedb6658ed19_r.jpg', // 这里填写视频的封面图地址,可选 |
| | | type: 'auto', // 可选,自动判断类型,或者指定为 'hls', 'flv' 等 |
| | | autoPlay:true |
| | | }, |
| | | // 其他配置... |
| | | }); |
| | | // this.$nextTick(()=>{ |
| | | // if(this.time){ |
| | | // this.dp.seek(this.time) |
| | | // } |
| | | // }) |
| | | |
| | | }, |
| | | |
| | | beforeDestroy() { |
| | | if (this.dp) { |
| | | this.dp.destroy(); // 销毁播放器实例,释放资源 |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | |
| | | </style> |
| | | |
| | |
| | | // 配置文件 |
| | | Vue.prototype.$systemconfig = { |
| | | // 服务端路径 |
| | | basePath: 'http://183.196.93.178:8089', |
| | | // basePath:'http://192.168.0.40:8089' |
| | | basePath: 'http://192.168.0.78:8089', |
| | | //basePath:'http://183.196.93.178:8089' |
| | | } |
| | | Vue.prototype.$byutil = byUtils |
| | | Vue.prototype.$stringUtil = StringUtil |
| | |
| | | component: resolve => require(['../components/page/MonthFeePay.vue'], resolve), |
| | | meta: { title: '月租车缴费' } |
| | | }, |
| | | { |
| | | path: '/dplayer', |
| | | component: resolve => require(['../components/page/dPlayerTest.vue'], resolve), |
| | | meta: { title: 'dPlayerTest' } |
| | | }, |
| | | ] |
| | | }) |
| | | |
| | |
| | | parentId: 2, |
| | | indexUrl: "barrierOpenLog" |
| | | }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '月票车规则管理', |
| | | parentId: 2, |
| | | indexUrl: "whiteListRule" |
| | | }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '缴费日志管理', |
| | | parentId: 2, |
| | | indexUrl: "paymentLog" |
| | | }, |
| | | // { |
| | | // icon: 'el-icon-document', |
| | | // name: '月票车规则管理', |
| | | // parentId: 2, |
| | | // indexUrl: "whiteListRule" |
| | | // }, |
| | | // { |
| | | // icon: 'el-icon-document', |
| | | // name: '缴费日志管理', |
| | | // parentId: 2, |
| | | // indexUrl: "paymentLog" |
| | | // }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '白名单管理', |
| | |
| | | parentId: 2, |
| | | indexUrl: "enterParkCar" |
| | | }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '月票车规则管理', |
| | | parentId: 2, |
| | | indexUrl: "whiteListRule" |
| | | }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '缴费日志管理', |
| | | parentId: 2, |
| | | indexUrl: "paymentLog" |
| | | }, |
| | | // { |
| | | // icon: 'el-icon-document', |
| | | // name: '月票车规则管理', |
| | | // parentId: 2, |
| | | // indexUrl: "whiteListRule" |
| | | // }, |
| | | // { |
| | | // icon: 'el-icon-document', |
| | | // name: '缴费日志管理', |
| | | // parentId: 2, |
| | | // indexUrl: "paymentLog" |
| | | // }, |
| | | { |
| | | icon: 'el-icon-document', |
| | | name: '手动抬杆记录', |
| | |
| | | disableHostCheck: true, |
| | | proxy: { |
| | | '/':{ |
| | | //target:'http://183.196.93.178', |
| | | target:'http://127.0.0.1:8089', |
| | | target:'http://183.196.93.178:8089', |
| | | //target:'http://127.0.0.1:8089', |
| | | changeOrigin:true, |
| | | pathRewrite:{ |
| | | '/':'' |