diff --git a/README.md b/README.md index 09b7dbd..b81fcb9 100644 --- a/README.md +++ b/README.md @@ -112,10 +112,22 @@ props:{ type: [Object], default: () => null }, + id:{ //播放器的ID 唯一标识符 不传就是默认的 但是有多个的时候不一定是唯一的 required: false, type: [String], default: `player-${Date.parse(new Date())}` + }, + + cssLink:{ //css版本源 + required: false, + type: [String], + default: `https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css` + }, + scriptSrc:{ //js版本源 + required: false, + type: [String], + default: `https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js` } } ``` diff --git a/dist/css/index.06951331.css b/dist/css/index.06951331.css new file mode 100644 index 0000000..3060944 --- /dev/null +++ b/dist/css/index.06951331.css @@ -0,0 +1 @@ +[data-v-9b14a31e]{margin:0;padding:0}.remove-text[data-v-9b14a31e]{text-align:center;padding:20px;font-size:24px}.player-btns[data-v-9b14a31e]{width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.player-btns span[data-v-9b14a31e]{margin:0 auto;display:inline-block;padding:5px 10px;width:150px;height:40px;line-height:40px;border:1px solid #eee;background:#e1e1e1;border-radius:10px;text-align:center;margin:20px auto;cursor:pointer} \ No newline at end of file diff --git a/dist/css/index.150ac33b.css b/dist/css/index.150ac33b.css deleted file mode 100644 index 396692c..0000000 --- a/dist/css/index.150ac33b.css +++ /dev/null @@ -1 +0,0 @@ -[data-v-45a4aaea]{margin:0;padding:0}.player-btns[data-v-45a4aaea]{width:800px;margin:0 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.player-btns span[data-v-45a4aaea]{margin:0 auto;display:inline-block;padding:5px 10px;width:150px;height:40px;line-height:40px;border:1px solid #eee;background:#e1e1e1;border-radius:10px;text-align:center;margin:20px auto;cursor:pointer} \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index efd23c8..7912498 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -vue-aliplayer-v2
\ No newline at end of file +vue-aliplayer-v2
\ No newline at end of file diff --git a/dist/js/index.5dd18869.js b/dist/js/index.5dd18869.js deleted file mode 100644 index b3822f1..0000000 --- a/dist/js/index.5dd18869.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(e){function t(t){for(var r,l,a=t[0],c=t[1],s=t[2],p=0,f=[];p\r\n
\r\n \r\n
\r\n 播放\r\n 暂停\r\n 重播\r\n 播放时刻\r\n
\r\n
\r\n\r\n\r\n\r\n","import mod from \"-!../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../node_modules/_vue-loader@15.7.2@vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../node_modules/_vue-loader@15.7.2@vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=45a4aaea&scoped=true&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&id=45a4aaea&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/_vue-loader@15.7.2@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"45a4aaea\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":_vm.id}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\n\r\n","import mod from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.7.2@vue-loader/lib/index.js??vue-loader-options!./main.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/_thread-loader@2.1.3@thread-loader/dist/cjs.js!../../../node_modules/_babel-loader@8.0.6@babel-loader/lib/index.js!../../../node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/_vue-loader@15.7.2@vue-loader/lib/index.js??vue-loader-options!./main.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./main.vue?vue&type=template&id=2086d122&\"\nimport script from \"./main.vue?vue&type=script&lang=js&\"\nexport * from \"./main.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/_vue-loader@15.7.2@vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","// 导入组件,组件必须声明 name\r\nimport VueAliplayerV2 from './src/main.vue';\r\n// 为组件添加 install 方法,用于按需引入\r\nVueAliplayerV2.install = function (Vue) {\r\n Vue.component(VueAliplayerV2.name, VueAliplayerV2);\r\n}\r\nexport default VueAliplayerV2;\r\n","// packages / index.js\r\n// 导入单个组件\r\nimport VueAliplayerV2 from './AliplayerV2';\r\n\r\n// 以数组的结构保存组件,便于遍历\r\nconst components = [\r\n VueAliplayerV2\r\n];\r\n\r\n// 定义 install 方法\r\nconst install = (Vue) =>{\r\n if (install.installed) return false;\r\n install.installed = true;\r\n // 遍历并注册全局组件\r\n components.map(component => {\r\n return Vue.component(component.name, component)\r\n });\r\n};\r\nif (typeof window !== 'undefined' && window.Vue) {\r\n install(window.Vue);\r\n}\r\nexport default {\r\n // 导出的对象必须具备一个 install 方法\r\n install,\r\n VueAliplayerV2\r\n // 组件列表\r\n};\r\n","import Vue from 'vue';\r\nimport App from './App.vue';\r\nimport VueAliplayerV2 from '../packages';\r\nVue.use(VueAliplayerV2);\r\nVue.config.productionTip = false;\r\nnew Vue({\r\n render: h => h(App),\r\n}).$mount('#app');\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/index.9584040f.js b/dist/js/index.9584040f.js new file mode 100644 index 0000000..54aacfe --- /dev/null +++ b/dist/js/index.9584040f.js @@ -0,0 +1,2 @@ +(function(e){function t(t){for(var r,a,s=t[0],u=t[1],o=t[2],p=0,f=[];p{ - // console.log(`object ${this.events[ev]}`,e); - this.$emit(this.events[ev],e); - }); + if(!this.player){ + // console.log(this.config); + this.player = new Aliplayer(this.config); + for(const ev in this.events){ + this.player.on(this.events[ev],(e)=>{ + // console.log(`object ${this.events[ev]}`,e); + this.$emit(this.events[ev],e); + }); + } + } else { + this.player.replay(); //销毁后重播 + // console.log(`this.player.replay()`,'销毁后重播'); } //通过播放器实例的off方法取消订阅 //player.off('ready',handleReady); diff --git a/t.sh b/t.sh new file mode 100644 index 0000000..6f00973 --- /dev/null +++ b/t.sh @@ -0,0 +1,26 @@ +# 打包 => dist +npm run build; + +# 打包 插件 +npm run lib; + +#推送到npmjs + +npm publish; + +# 更新gh-pages + +git branch -D gh-pages; + +git checkout -b gh-pages; + +git add -f dist; + +git commit -m 'create gh-pages'; + +git push origin -d gh-pages; + +git subtree push --prefix dist origin gh-pages; + +# 推送完成后切换回master +git checkout master; \ No newline at end of file