kongdeqiang
2 天以前 83a157e76455731451659f07599db58925133236
feat: 修改
1个文件已添加
4个文件已修改
130 ■■■■ 已修改文件
src/components/page/dPlayerTest.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/state.js 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/page/dPlayerTest.vue
New file
@@ -0,0 +1,69 @@
<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>
src/main.js
@@ -76,8 +76,8 @@
// 配置文件
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
src/router/index.js
@@ -210,6 +210,11 @@
            component: resolve => require(['../components/page/MonthFeePay.vue'], resolve),
            meta: { title: '月租车缴费' }
        },
        {
            path: '/dplayer',
            component: resolve => require(['../components/page/dPlayerTest.vue'], resolve),
            meta: { title: 'dPlayerTest' }
        },
    ]
})
src/store/state.js
@@ -61,18 +61,18 @@
                    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: '白名单管理',
@@ -163,18 +163,18 @@
                    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: '手动抬杆记录',
vue.config.js
@@ -16,8 +16,8 @@
        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:{
                    '/':''