From c5429ae0329540429bb88f58a9d93d5202edca1a Mon Sep 17 00:00:00 2001 From: zhouliujun <1096432931@qq.com> Date: Mon, 12 Oct 2020 13:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++++++++++-- examples/main.js | 5 ++++- package.json | 4 ++-- packages/AliplayerV2/index.vue | 9 ++------- packages/index.js | 6 ++++-- 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7a0046c..3c45f2c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ yarn add vue-aliplayer-v2 import VueAliplayerV2 from 'vue-aliplayer-v2'; Vue.use(VueAliplayerV2); + +//可选全局配置 +//Vue.use(VueAliplayerV2,{ + // cssLink: 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css', + // scriptSrc: 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js' +//}); ``` #### 局部注册 App.vue @@ -200,12 +206,12 @@ props:{ cssLink:{ //css版本源 required: false, type: [String], - default: `https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css` + default: `https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css` }, scriptSrc:{ //js版本源 required: false, type: [String], - default: `https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js` + default: `https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js` } } ``` @@ -406,6 +412,8 @@ See [Configuration Reference](https://cli.vuejs.org/config/). ## 更新日志 +> v1.2.5 更换默认的播放器SDK版本2.8.2 => 2.9.0,2.8.2的版本存在多个播放器同时播放直播流异常的bug,增加了全局SDK版本配置,可以在Vue.use()的时候进行配置. + > v1.2.4 修复多个播放器加载,只初始化一个播放器的bug.文档部分更新,增加了问题栏. 感谢"沙洲ad"的反馈与建议. > v1.2.3 优化播放器的初始化代码,调整包内结构,优化局部组件的注册方式,也兼容老版本的引用方式.文档部分更新,增加了问题栏. 感谢"liangzhiyuan2015"和"fancheur"两位网友的反馈与建议. diff --git a/examples/main.js b/examples/main.js index 068e4f8..2baf567 100644 --- a/examples/main.js +++ b/examples/main.js @@ -1,7 +1,10 @@ import Vue from 'vue'; import App from './App.vue'; import VueAliplayerV2 from '../packages'; -Vue.use(VueAliplayerV2); +Vue.use(VueAliplayerV2,{ + // cssLink: 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css', + // scriptSrc: 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js' +}); Vue.config.productionTip = false; new Vue({ render: h => h(App), diff --git a/package.json b/package.json index 3778e4b..0730177 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "vue-aliplayer-v2", - "version": "1.2.4", + "version": "1.2.5", "author": "yxs", - "description": "感谢每一位开源的开发者. 这是一个基于Alipayer 开发并封装成vue组件的集成播放器.", + "description": "感谢每一位支持开源的朋友. 这是一个基于Alipayer 开发并封装成vue组件的集成播放器.可播放rtmp,m3u8,mp4....视频.除支持直播流与点播的基础功能外,也支持视频的加密播放、清晰度切换、直播时移等业务场景", "main":"lib/vue-aliplayer-v2.umd.min.js", "private": false, "license": "MIT", diff --git a/packages/AliplayerV2/index.vue b/packages/AliplayerV2/index.vue index 1e40d81..7694eff 100644 --- a/packages/AliplayerV2/index.vue +++ b/packages/AliplayerV2/index.vue @@ -15,20 +15,15 @@ export default { type: [String], default: null }, - // id:{ - // required: false, - // type: [String], - // default: null - // }, cssLink:{ //css版本源 required: false, type: [String], - default: `https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css` + default: `https://g.alicdn.com/de/prismplayer/2.9.0/skins/default/aliplayer-min.css` }, scriptSrc:{ //js版本源 required: false, type: [String], - default: `https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js` + default: `https://g.alicdn.com/de/prismplayer/2.9.0/aliplayer-min.js` } }, data () { diff --git a/packages/index.js b/packages/index.js index bc2db76..ef91c76 100644 --- a/packages/index.js +++ b/packages/index.js @@ -2,8 +2,10 @@ // 导入单个组件 import VueAliplayerV2 from './AliplayerV2'; // 定义 install 方法 -VueAliplayerV2.install = (Vue) =>{ - Vue.component(VueAliplayerV2.name, VueAliplayerV2) +VueAliplayerV2.install = (Vue, options) =>{ + if(options && options.cssLink) VueAliplayerV2.props.cssLink.default = options.cssLink; + if(options && options.scriptSrc) VueAliplayerV2.props.scriptSrc.default = options.scriptSrc; + Vue.component(VueAliplayerV2.name, VueAliplayerV2); }; VueAliplayerV2.Player = VueAliplayerV2; export default VueAliplayerV2;