Merge branch 'dev_v1.2.1'

This commit is contained in:
zhouliujun 2020-07-07 16:55:49 +08:00
commit ee9798cbb1
3 changed files with 34 additions and 24 deletions

View File

@ -142,12 +142,12 @@ if (typeof window !== 'undefined') {
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
var es6_function_name = __webpack_require__("7cfd"); var es6_function_name = __webpack_require__("7cfd");
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./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??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=3211d44f& // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./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??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=f75253da&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.id}})} var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.config.id}})}
var staticRenderFns = [] var staticRenderFns = []
// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=3211d44f& // CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=f75253da&
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js
var web_dom_iterable = __webpack_require__("4634"); var web_dom_iterable = __webpack_require__("4634");
@ -181,7 +181,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
id: { id: {
required: false, required: false,
type: [String], type: [String],
default: "player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()) default: null
}, },
cssLink: { cssLink: {
//css版本源 //css版本源
@ -201,7 +201,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
player: null, player: null,
//播放器实例 //播放器实例
config: { config: {
id: null, id: "player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()),
//播放器的ID //播放器的ID
width: '100%', width: '100%',
autoplay: true // isLive: true, autoplay: true // isLive: true,
@ -354,7 +354,11 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
_this3.initPlayer(); _this3.initPlayer();
}); });
} else { } else {
this.initPlayer(); this.initPlayer(); //这样是为了兼容页面上有多个播放器
scriptTag.addEventListener("load", function () {
_this3.initPlayer();
});
} }
}, },
@ -365,7 +369,6 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
initPlayer: function initPlayer() { initPlayer: function initPlayer() {
var _this4 = this; var _this4 = this;
// console.log(`this.player`,this.player);
if (typeof window.Aliplayer != 'undefined') { if (typeof window.Aliplayer != 'undefined') {
var options = this.options; var options = this.options;
@ -377,7 +380,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
if (this.source) this.config.source = this.source; //播放源 if (this.source) this.config.source = this.source; //播放源
this.config.id = this.id; if (this.id) this.config.id = this.id;
this.player && this.player.dispose(); //防止实例的重复 this.player && this.player.dispose(); //防止实例的重复
this.player = Aliplayer(this.config); this.player = Aliplayer(this.config);
@ -674,6 +677,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
}, },
beforeDestroy: function beforeDestroy() { beforeDestroy: function beforeDestroy() {
//防止重复创建 //防止重复创建
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
var head = document.querySelector('head'); //移除所有的重复创建的标签 var head = document.querySelector('head'); //移除所有的重复创建的标签
var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]'); var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');

View File

@ -151,12 +151,12 @@ if (typeof window !== 'undefined') {
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/es6.function.name.js
var es6_function_name = __webpack_require__("7cfd"); var es6_function_name = __webpack_require__("7cfd");
// CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./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??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=3211d44f& // CONCATENATED MODULE: ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"05d0d90a-vue-loader-template"}!./node_modules/_vue-loader@15.7.2@vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./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??vue-loader-options!./packages/AliplayerV2/src/main.vue?vue&type=template&id=f75253da&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.id}})} var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":_vm.config.id}})}
var staticRenderFns = [] var staticRenderFns = []
// CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=3211d44f& // CONCATENATED MODULE: ./packages/AliplayerV2/src/main.vue?vue&type=template&id=f75253da&
// EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js // EXTERNAL MODULE: ./node_modules/_core-js@2.6.10@core-js/modules/web.dom.iterable.js
var web_dom_iterable = __webpack_require__("4634"); var web_dom_iterable = __webpack_require__("4634");
@ -190,7 +190,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
id: { id: {
required: false, required: false,
type: [String], type: [String],
default: "player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()) default: null
}, },
cssLink: { cssLink: {
//css版本源 //css版本源
@ -210,7 +210,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
player: null, player: null,
//播放器实例 //播放器实例
config: { config: {
id: null, id: "player-".concat(Math.random().toString(36).substr(2).toLocaleUpperCase()),
//播放器的ID //播放器的ID
width: '100%', width: '100%',
autoplay: true // isLive: true, autoplay: true // isLive: true,
@ -363,7 +363,11 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
_this3.initPlayer(); _this3.initPlayer();
}); });
} else { } else {
this.initPlayer(); this.initPlayer(); //这样是为了兼容页面上有多个播放器
scriptTag.addEventListener("load", function () {
_this3.initPlayer();
});
} }
}, },
@ -374,7 +378,6 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
initPlayer: function initPlayer() { initPlayer: function initPlayer() {
var _this4 = this; var _this4 = this;
// console.log(`this.player`,this.player);
if (typeof window.Aliplayer != 'undefined') { if (typeof window.Aliplayer != 'undefined') {
var options = this.options; var options = this.options;
@ -386,7 +389,7 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
if (this.source) this.config.source = this.source; //播放源 if (this.source) this.config.source = this.source; //播放源
this.config.id = this.id; if (this.id) this.config.id = this.id;
this.player && this.player.dispose(); //防止实例的重复 this.player && this.player.dispose(); //防止实例的重复
this.player = Aliplayer(this.config); this.player = Aliplayer(this.config);
@ -683,6 +686,8 @@ var es6_regexp_to_string = __webpack_require__("cc1d");
}, },
beforeDestroy: function beforeDestroy() { beforeDestroy: function beforeDestroy() {
//防止重复创建 //防止重复创建
this.dispose(); //销毁播放器(防止直播播放的情况下,播放器已经销毁,而后台还在继续下载资源造成卡顿的bug)
var head = document.querySelector('head'); //移除所有的重复创建的标签 var head = document.querySelector('head'); //移除所有的重复创建的标签
var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]'); var nodes = document.querySelectorAll('script[src="https://g.alicdn.com/de/prismplayer/2.8.2/hls/aliplayer-hls-min.js"]');

File diff suppressed because one or more lines are too long