zwplayer-vue2x 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -160,12 +160,10 @@ if (typeof window !== 'undefined') {
|
|
|
160
160
|
// Indicate to webpack that this file can be concatenated
|
|
161
161
|
/* harmony default export */ var setPublicPath = (null);
|
|
162
162
|
|
|
163
|
-
;// CONCATENATED MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
164
|
-
var external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
|
|
165
163
|
// EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
|
|
166
164
|
var loadjs = __webpack_require__(709);
|
|
167
165
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./sources/vueplayer/src/main.vue?vue&type=script&lang=js
|
|
168
|
-
|
|
166
|
+
// import { h } from 'vue'
|
|
169
167
|
|
|
170
168
|
const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.2';
|
|
171
169
|
const availabe_props = {
|
|
@@ -336,7 +334,7 @@ const availabe_props = {
|
|
|
336
334
|
}
|
|
337
335
|
}
|
|
338
336
|
},
|
|
339
|
-
render() {
|
|
337
|
+
render(createElement) {
|
|
340
338
|
let playerid;
|
|
341
339
|
|
|
342
340
|
// console.log('render');
|
|
@@ -351,11 +349,13 @@ const availabe_props = {
|
|
|
351
349
|
}
|
|
352
350
|
playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
|
|
353
351
|
}
|
|
354
|
-
let playerWrap = (
|
|
352
|
+
let playerWrap = createElement('div', {
|
|
355
353
|
class: {
|
|
356
354
|
'zwplayer-vue': true
|
|
357
355
|
},
|
|
358
|
-
|
|
356
|
+
attrs: {
|
|
357
|
+
id: playerid
|
|
358
|
+
}
|
|
359
359
|
}, []);
|
|
360
360
|
if (playerWrap) {
|
|
361
361
|
let vm = this;
|
|
@@ -423,14 +423,16 @@ const availabe_props = {
|
|
|
423
423
|
vm.old_murl = url;
|
|
424
424
|
});
|
|
425
425
|
},
|
|
426
|
-
|
|
426
|
+
beforeDestroy() {
|
|
427
|
+
// vue3.x beforeUnmount
|
|
427
428
|
let vm = this;
|
|
428
429
|
// console.log('beforeUnmount');
|
|
429
430
|
if (vm.zwplayer) {
|
|
430
431
|
vm.zwplayer.stop();
|
|
431
432
|
}
|
|
432
433
|
},
|
|
433
|
-
|
|
434
|
+
destroyed() {
|
|
435
|
+
// vue3.x unmounted
|
|
434
436
|
let vm = this;
|
|
435
437
|
// console.log('unmounted');
|
|
436
438
|
if (vm.zwplayer) {
|
package/lib/zwplayervue2.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
2
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory(
|
|
3
|
+
module.exports = factory();
|
|
4
4
|
else if(typeof define === 'function' && define.amd)
|
|
5
5
|
define([], factory);
|
|
6
6
|
else if(typeof exports === 'object')
|
|
7
|
-
exports["zwplayervue2"] = factory(
|
|
7
|
+
exports["zwplayervue2"] = factory();
|
|
8
8
|
else
|
|
9
|
-
root["zwplayervue2"] = factory(
|
|
10
|
-
})((typeof self !== 'undefined' ? self : this), function(
|
|
9
|
+
root["zwplayervue2"] = factory();
|
|
10
|
+
})((typeof self !== 'undefined' ? self : this), function() {
|
|
11
11
|
return /******/ (function() { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
@@ -77,14 +77,6 @@ const zwplayer_loadjs = function (id, url, cb) {
|
|
|
77
77
|
};
|
|
78
78
|
module.exports.l = zwplayer_loadjs;
|
|
79
79
|
|
|
80
|
-
/***/ }),
|
|
81
|
-
|
|
82
|
-
/***/ 274:
|
|
83
|
-
/***/ (function(module) {
|
|
84
|
-
|
|
85
|
-
"use strict";
|
|
86
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__274__;
|
|
87
|
-
|
|
88
80
|
/***/ })
|
|
89
81
|
|
|
90
82
|
/******/ });
|
|
@@ -178,12 +170,10 @@ if (typeof window !== 'undefined') {
|
|
|
178
170
|
// Indicate to webpack that this file can be concatenated
|
|
179
171
|
/* harmony default export */ var setPublicPath = (null);
|
|
180
172
|
|
|
181
|
-
// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"}
|
|
182
|
-
var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__(274);
|
|
183
173
|
// EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
|
|
184
174
|
var loadjs = __webpack_require__(15);
|
|
185
175
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./sources/vueplayer/src/main.vue?vue&type=script&lang=js
|
|
186
|
-
|
|
176
|
+
// import { h } from 'vue'
|
|
187
177
|
|
|
188
178
|
const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.2';
|
|
189
179
|
const availabe_props = {
|
|
@@ -354,7 +344,7 @@ const availabe_props = {
|
|
|
354
344
|
}
|
|
355
345
|
}
|
|
356
346
|
},
|
|
357
|
-
render() {
|
|
347
|
+
render(createElement) {
|
|
358
348
|
let playerid;
|
|
359
349
|
|
|
360
350
|
// console.log('render');
|
|
@@ -369,11 +359,13 @@ const availabe_props = {
|
|
|
369
359
|
}
|
|
370
360
|
playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
|
|
371
361
|
}
|
|
372
|
-
let playerWrap = (
|
|
362
|
+
let playerWrap = createElement('div', {
|
|
373
363
|
class: {
|
|
374
364
|
'zwplayer-vue': true
|
|
375
365
|
},
|
|
376
|
-
|
|
366
|
+
attrs: {
|
|
367
|
+
id: playerid
|
|
368
|
+
}
|
|
377
369
|
}, []);
|
|
378
370
|
if (playerWrap) {
|
|
379
371
|
let vm = this;
|
|
@@ -441,14 +433,16 @@ const availabe_props = {
|
|
|
441
433
|
vm.old_murl = url;
|
|
442
434
|
});
|
|
443
435
|
},
|
|
444
|
-
|
|
436
|
+
beforeDestroy() {
|
|
437
|
+
// vue3.x beforeUnmount
|
|
445
438
|
let vm = this;
|
|
446
439
|
// console.log('beforeUnmount');
|
|
447
440
|
if (vm.zwplayer) {
|
|
448
441
|
vm.zwplayer.stop();
|
|
449
442
|
}
|
|
450
443
|
},
|
|
451
|
-
|
|
444
|
+
destroyed() {
|
|
445
|
+
// vue3.x unmounted
|
|
452
446
|
let vm = this;
|
|
453
447
|
// console.log('unmounted');
|
|
454
448
|
if (vm.zwplayer) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["zwplayervue2"]=t():e["zwplayervue2"]=t()})("undefined"!==typeof self?self:this,(function(){return function(){var e={234:function(e){const t=function(e,t,o){let n=document.getElementsByTagName("head");if(0==n.length){n=document.createElement("head");let e=document.getElementsByTagName("body");if(!(e.length>0))return alert("Invalid html document: no HEAD tag"),!1;e=e[0],document.insertBefore(n,e)}else{n=n[0];const t=n.childNodes;for(let n=0;n<t.length;n++){const r=t[n];if("SCRIPT"===r.nodeName.toUpperCase()&&r.id&&r.id==e){if("true"!=r.getAttribute("loadstate")){const t=function(){"true"!=r.getAttribute("loadstate")?setTimeout(t,50):"function"==typeof o&&o(e)};return setTimeout(t,50),!1}return"function"==typeof o&&o(e),!0}}}const r=document.createElement("script");return r.type="text/javascript",r.readyState?r.onreadystatechange=function(){"loaded"!=r.readyState&&"complete"!=r.readyState||(r.onreadystatechange=null,r.setAttribute("loadstate","true"),"function"==typeof o&&o(e))}:r.onload=function(){r.setAttribute("loadstate","true"),r.setAttribute("charset","utf-8"),"function"==typeof o&&o(e)},r.id=e,r.src=t,n.appendChild(r),!1};e.exports.l=t}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var l=t[n]={exports:{}};return e[n](l,l.exports,o),l.exports}!function(){o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){o.p=""}();var n={};return function(){"use strict";if(o.r(n),o.d(n,{default:function(){return b},zwplayer:function(){return f}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(o.p=t[1])}var r=o(234);const l="zwplayer/zwplayer.js?v=3.2",a={isLive:"boolean",useOldFlv:"boolean",useFlv:"boolean",streamtype:"string",hasAudio:"boolean",hasVideo:"boolean",xmc_url:"string",fixedControlbar:"boolean",nativecontrols:"boolean",infoButton:"boolean",speedButton:"boolean",optionButton:"boolean",snapshotButton:"boolean",chapterButton:"boolean",enableDanmu:"boolean",useProgressTooltip:"boolean",hidePlayBtn:"boolean",disablePlayBtn:"boolean",disableSeek:"boolean",disableFullscreenWin:"boolean",disablePicInPic:"boolean",disableVolumeControl:"boolean",lostFocusPause:"boolean",autoSmallWindow:"boolean",thumbnails:"object",sendDanmu:"function",danmuBarId:"string"};var i,s,u={name:"ZwPlayer",data(){return{zwplayer:null,nodename:"ZwPlayer"}},props:{zwplayerlib:String,murl:String,nodeid:String,muted:Boolean,autoplay:{type:Boolean,default:!0},videoprop:Object,videostyle:String,reconnect:{type:Boolean,default:!0},controlbar:{type:Boolean,default:!0},useProgressTooltip:{type:Boolean,default:!0}},emits:["oneterror","onmediaevent","onready"],methods:{play(e,t,o){let n=this;e||(e=this.murl),n.zwplayer&&n.zwplayer.play(e,t,o)},stop(){let e=this;e.zwplayer&&e.zwplayer.stop()},pause(){let e=this;e.zwplayer&&e.zwplayer.pause()},resume(){let e=this;e.zwplayer&&e.zwplayer.resume()},getDuration(){let e=this;if(e.zwplayer)return e.zwplayer.getDuration()},seekTime(e){let t=this;t.zwplayer&&t.zwplayer.seekTime(e)},destroy(){let e=this;e.zwplayer&&e.zwplayer.destroy()},setplaystate(e){let t=this;t.zwplayer&&t.zwplayer.setplaystate(e)},setEnableDanmu(e){let t=this;t.zwplayer&&t.zwplayer.setEnableDanmu(e)},appendDanmu(e,t){let o=this;o.zwplayer&&o.zwplayer.appendDanmu(e,t)},setChapters(e){let t=this;t.zwplayer&&t.zwplayer.setChapters(e)},addSubtitle(e,t,o){let n=this;n.zwplayer&&n.zwplayer.addSubtitle(e,t,o)},removeSubtitle(){let e=this;e.zwplayer&&e.zwplayer.removeSubtitle()},buildDanmuControlbar(e,t){let o=this;o.zwplayer&&o.zwplayer.buildDanmuControlbar(e,t)},notifyResize(e,t){let o=this;o.zwplayer&&o.zwplayer.notifyResize(e,t)},setMute(e){let t=this;t.zwplayer&&t.zwplayer.setMuted(e)},setullscr(e){let t=this;t.zwplayer&&(t.is_fullscr=e,t.zwplayer.setFullscreen(e))}},render(e){let t;if(this.nodeid)t=this.nodeid;else{let e=(new Date).getTime();window.nextZWPlayerId?window.nextZWPlayerId++:window.nextZWPlayerId=1e3,t="zwplayer-"+window.nextZWPlayerId+"-"+e}let o=e("div",{class:{"zwplayer-vue":!0},attrs:{id:t}},[]);if(o){let e=this;e.playerid=t}return this.zwplayer&&this.murl!==this.old_murl&&(this.zwplayer.play(this.murl),this.old_murl=this.murl),o},mounted(){let e,t=this;e=t.zwplayerlib?t.zwplayerlib:l,t.rootElm=document.getElementById(t.playerid),t.rootElm&&(t.rootElm.style.width="100%",t.rootElm.style.height="100%",t.rootElm.style.margin="0",t.rootElm.style.padding="0"),(0,r.l)("zwplayer-core",e,(function(e){let o="";e||console.log("zwplayer_loadjs failed!"),t.murl?o=t.murl:t.videoprop&&"undefined"!==typeof t.videoprop.url&&(o=t.videoprop.url);let n="width:100%;height:100%;";t.videoprop&&"undefined"!==typeof t.videoprop.videostyle&&(n=t.videoprop.videostyle);let r={url:o,playerElm:t.rootElm,videostyle:n,reconnect:t.reconnect,autoplay:t.autoplay,muted:t.muted,controlbar:t.controlbar,useProgressTooltip:t.useProgressTooltip,onready:function(){t.$emit("onready",this)},onnetclose:function(){return t.$emit("onnetclose",this),!0},onneterror:function(){t.$emit("onneterror",this)},onmediaevent:function(e){t.$emit("onmediaevent",e,this)}},l=a;for(let a in t.$attrs)a in l&&typeof t.$attrs[a]===l[a]&&("object"===typeof t.$attrs[a]?r[a]=JSON.parse(JSON.stringify(t.$attrs[a])):r[a]=t.$attrs[a]);t.zwplayer=new window.ZWPlayer(r),r.danmuBarId&&t.zwplayer.buildDanmuControlbar(r.danmuBarId,"vue-zwp-danmubar"),t.old_murl=o}))},beforeDestroy(){let e=this;e.zwplayer&&e.zwplayer.stop()},destroyed(){let e=this;e.zwplayer&&(e.zwplayer.destroy(),delete e.zwplayer)}},d=u;function p(e,t,o,n,r,l,a,i){var s,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=o,u._compiled=!0),n&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),a?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=s):r&&(s=i?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var d=u.render;u.render=function(e,t){return s.call(t),d(e,t)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,s):[s]}return{exports:e,options:u}}var y=p(d,i,s,!1,null,null,null),c=y.exports;c.install=function(e){e.component(c.name,c),e.component("zero-web-player",c),e.component("zero-player",c),e.component("ZPlayer",c)};var f=c;const m=[f],w={install:e=>{m.forEach((t=>{t.install(e)}))}};"undefined"!==typeof window&&window.Vue&&w.install(window.Vue);var h=w,b=h}(),n}()}));
|
|
2
2
|
//# sourceMappingURL=zwplayervue2.umd.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- zwplayer for vue -->
|
|
2
2
|
<script>
|
|
3
|
-
import { h } from 'vue'
|
|
3
|
+
// import { h } from 'vue'
|
|
4
4
|
import { zwplayer_loadjs } from "./loadjs.js";
|
|
5
5
|
|
|
6
6
|
const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.2';
|
|
@@ -203,7 +203,7 @@ export default {
|
|
|
203
203
|
},
|
|
204
204
|
},
|
|
205
205
|
|
|
206
|
-
render() {
|
|
206
|
+
render(createElement) {
|
|
207
207
|
let playerid;
|
|
208
208
|
|
|
209
209
|
// console.log('render');
|
|
@@ -222,9 +222,11 @@ export default {
|
|
|
222
222
|
playerid = 'zwplayer-'+ window.nextZWPlayerId + '-' + now;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
let playerWrap =
|
|
225
|
+
let playerWrap = createElement('div', {
|
|
226
226
|
class: {'zwplayer-vue': true},
|
|
227
|
-
|
|
227
|
+
attrs: {
|
|
228
|
+
id: playerid,
|
|
229
|
+
},
|
|
228
230
|
}, []);
|
|
229
231
|
|
|
230
232
|
if (playerWrap) {
|
|
@@ -317,7 +319,7 @@ export default {
|
|
|
317
319
|
})
|
|
318
320
|
},
|
|
319
321
|
|
|
320
|
-
|
|
322
|
+
beforeDestroy() { // vue3.x beforeUnmount
|
|
321
323
|
let vm = this;
|
|
322
324
|
// console.log('beforeUnmount');
|
|
323
325
|
if (vm.zwplayer) {
|
|
@@ -325,14 +327,14 @@ export default {
|
|
|
325
327
|
}
|
|
326
328
|
},
|
|
327
329
|
|
|
328
|
-
|
|
330
|
+
destroyed() { // vue3.x unmounted
|
|
329
331
|
let vm = this;
|
|
330
332
|
// console.log('unmounted');
|
|
331
333
|
if (vm.zwplayer) {
|
|
332
334
|
vm.zwplayer.destroy();
|
|
333
335
|
delete vm.zwplayer;
|
|
334
336
|
}
|
|
335
|
-
}
|
|
337
|
+
}
|
|
336
338
|
}
|
|
337
339
|
</script>
|
|
338
340
|
|