zwplayer-vue2x 1.0.10 → 1.0.11

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.
package/lib/demo.html ADDED
@@ -0,0 +1 @@
1
+ <!doctype html><meta charset="utf-8"><title>zwplayervue2 demo</title><script src="./zwplayervue2.umd.js"></script><link rel="stylesheet" href="./zwplayervue2.css"><script>console.log(zwplayervue2)</script>
@@ -0,0 +1,648 @@
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 709:
5
+ /***/ (function(module) {
6
+
7
+ // zwplayer tools
8
+
9
+ const zwplayer_loadjs = function (id, url, cb) {
10
+ let headNode = document.getElementsByTagName("head");
11
+ if (headNode.length == 0) {
12
+ headNode = document.createElement("head");
13
+ let body = document.getElementsByTagName("body");
14
+ if (body.length > 0) {
15
+ body = body[0];
16
+ document.insertBefore(headNode, body);
17
+ } else {
18
+ alert('Invalid html document: no HEAD tag');
19
+ return false;
20
+ }
21
+ } else {
22
+ headNode = headNode[0];
23
+ const nodes = headNode.childNodes;
24
+ for (let i = 0; i < nodes.length; i++) {
25
+ const node = nodes[i];
26
+ if (node.nodeName.toUpperCase() === 'SCRIPT') {
27
+ if (node.id && node.id == id) {
28
+ if (node.getAttribute('loadstate') != 'true') {
29
+ const checkLoad = function () {
30
+ if (node.getAttribute('loadstate') != 'true') {
31
+ setTimeout(checkLoad, 50);
32
+ } else {
33
+ if (typeof cb == 'function') cb(id);
34
+ }
35
+ };
36
+ setTimeout(checkLoad, 50);
37
+ return false;
38
+ }
39
+ if (typeof cb == 'function') cb(id);
40
+ return true;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ const script = document.createElement("script");
46
+ script.type = "text/javascript";
47
+ if (script.readyState) {
48
+ // IE
49
+ script.onreadystatechange = function () {
50
+ if (script.readyState == "loaded" || script.readyState == "complete") {
51
+ script.onreadystatechange = null;
52
+ script.setAttribute('loadstate', 'true');
53
+ if (typeof cb == 'function') cb(id);
54
+ }
55
+ };
56
+ } else {
57
+ script.onload = function () {
58
+ script.setAttribute('loadstate', 'true');
59
+ script.setAttribute('charset', 'utf-8');
60
+ if (typeof cb == 'function') cb(id);
61
+ };
62
+ }
63
+ script.id = id;
64
+ script.src = url;
65
+ headNode.appendChild(script);
66
+ return false;
67
+ };
68
+ module.exports.l = zwplayer_loadjs;
69
+
70
+ /***/ })
71
+
72
+ /******/ });
73
+ /************************************************************************/
74
+ /******/ // The module cache
75
+ /******/ var __webpack_module_cache__ = {};
76
+ /******/
77
+ /******/ // The require function
78
+ /******/ function __webpack_require__(moduleId) {
79
+ /******/ // Check if module is in cache
80
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
81
+ /******/ if (cachedModule !== undefined) {
82
+ /******/ return cachedModule.exports;
83
+ /******/ }
84
+ /******/ // Create a new module (and put it into the cache)
85
+ /******/ var module = __webpack_module_cache__[moduleId] = {
86
+ /******/ // no module.id needed
87
+ /******/ // no module.loaded needed
88
+ /******/ exports: {}
89
+ /******/ };
90
+ /******/
91
+ /******/ // Execute the module function
92
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
93
+ /******/
94
+ /******/ // Return the exports of the module
95
+ /******/ return module.exports;
96
+ /******/ }
97
+ /******/
98
+ /************************************************************************/
99
+ /******/ /* webpack/runtime/define property getters */
100
+ /******/ !function() {
101
+ /******/ // define getter functions for harmony exports
102
+ /******/ __webpack_require__.d = function(exports, definition) {
103
+ /******/ for(var key in definition) {
104
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
105
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
106
+ /******/ }
107
+ /******/ }
108
+ /******/ };
109
+ /******/ }();
110
+ /******/
111
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
112
+ /******/ !function() {
113
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
114
+ /******/ }();
115
+ /******/
116
+ /******/ /* webpack/runtime/make namespace object */
117
+ /******/ !function() {
118
+ /******/ // define __esModule on exports
119
+ /******/ __webpack_require__.r = function(exports) {
120
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
121
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
122
+ /******/ }
123
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
124
+ /******/ };
125
+ /******/ }();
126
+ /******/
127
+ /******/ /* webpack/runtime/publicPath */
128
+ /******/ !function() {
129
+ /******/ __webpack_require__.p = "";
130
+ /******/ }();
131
+ /******/
132
+ /************************************************************************/
133
+ var __webpack_exports__ = {};
134
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
135
+ !function() {
136
+ "use strict";
137
+ // ESM COMPAT FLAG
138
+ __webpack_require__.r(__webpack_exports__);
139
+
140
+ // EXPORTS
141
+ __webpack_require__.d(__webpack_exports__, {
142
+ "default": function() { return /* binding */ entry_lib; },
143
+ zwplayer: function() { return /* reexport */ vueplayer; }
144
+ });
145
+
146
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
147
+ /* eslint-disable no-var */
148
+ // This file is imported into lib/wc client bundles.
149
+
150
+ if (typeof window !== 'undefined') {
151
+ var currentScript = window.document.currentScript
152
+ if (false) { var getCurrentScript; }
153
+
154
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
155
+ if (src) {
156
+ __webpack_require__.p = src[1] // eslint-disable-line
157
+ }
158
+ }
159
+
160
+ // Indicate to webpack that this file can be concatenated
161
+ /* harmony default export */ var setPublicPath = (null);
162
+
163
+ // EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
164
+ var loadjs = __webpack_require__(709);
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
166
+ // import { h } from 'vue'
167
+
168
+ const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
169
+ const availabe_props = {
170
+ isLive: 'boolean',
171
+ useOldFlv: 'boolean',
172
+ useFlv: 'boolean',
173
+ streamtype: 'string',
174
+ hasAudio: 'boolean',
175
+ hasVideo: 'boolean',
176
+ xmc_url: 'string',
177
+ fixedControlbar: 'boolean',
178
+ nativecontrols: 'boolean',
179
+ infoButton: 'boolean',
180
+ speedButton: 'boolean',
181
+ optionButton: 'boolean',
182
+ snapshotButton: 'boolean',
183
+ chapterButton: 'boolean',
184
+ enableDanmu: 'boolean',
185
+ useProgressTooltip: 'boolean',
186
+ hidePlayBtn: 'boolean',
187
+ disablePlayBtn: 'boolean',
188
+ disableSeek: 'boolean',
189
+ disableFullscreenWin: 'boolean',
190
+ disablePicInPic: 'boolean',
191
+ disableVolumeControl: 'boolean',
192
+ lostFocusPause: 'boolean',
193
+ autoSmallWindow: 'boolean',
194
+ thumbnails: 'object',
195
+ sendDanmu: 'function',
196
+ danmuBarId: 'string',
197
+ fluid: 'boolean'
198
+ };
199
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
200
+ name: 'ZwPlayer',
201
+ data() {
202
+ return {
203
+ zwplayer: null,
204
+ nodename: 'ZwPlayer'
205
+ };
206
+ },
207
+ props: {
208
+ zwplayerlib: String,
209
+ murl: String,
210
+ nodeid: String,
211
+ muted: Boolean,
212
+ autoplay: {
213
+ type: Boolean,
214
+ default: true
215
+ },
216
+ videoprop: Object,
217
+ videostyle: String,
218
+ reconnect: {
219
+ type: Boolean,
220
+ default: true
221
+ },
222
+ controlbar: {
223
+ type: Boolean,
224
+ default: true
225
+ },
226
+ useProgressTooltip: {
227
+ type: Boolean,
228
+ default: true
229
+ }
230
+ },
231
+ emits: ['oneterror', 'onmediaevent', 'onready'],
232
+ methods: {
233
+ play(url, isLive, useOldFlv) {
234
+ let vm = this;
235
+ if (!url) url = this.murl;
236
+ if (!vm.zwplayer) return;
237
+ vm.zwplayer.play(url, isLive, useOldFlv);
238
+ },
239
+ stop() {
240
+ let vm = this;
241
+ if (vm.zwplayer) {
242
+ vm.zwplayer.stop();
243
+ }
244
+ },
245
+ pause() {
246
+ let vm = this;
247
+ if (vm.zwplayer) {
248
+ vm.zwplayer.pause();
249
+ }
250
+ },
251
+ resume() {
252
+ let vm = this;
253
+ if (vm.zwplayer) {
254
+ vm.zwplayer.resume();
255
+ }
256
+ },
257
+ getDuration() {
258
+ let vm = this;
259
+ if (vm.zwplayer) {
260
+ return vm.zwplayer.getDuration();
261
+ }
262
+ return undefined;
263
+ },
264
+ getCurrentTime() {
265
+ let vm = this;
266
+ if (vm.zwplayer) {
267
+ return vm.zwplayer.CurrentTime;
268
+ }
269
+ return undefined;
270
+ },
271
+ seekTime(time) {
272
+ let vm = this;
273
+ if (vm.zwplayer) {
274
+ vm.zwplayer.seekTime(time);
275
+ }
276
+ },
277
+ destroy() {
278
+ let vm = this;
279
+ if (vm.zwplayer) {
280
+ vm.zwplayer.destroy();
281
+ }
282
+ },
283
+ setplaystate(bPlaying) {
284
+ let vm = this;
285
+ if (vm.zwplayer) {
286
+ vm.zwplayer.setplaystate(bPlaying);
287
+ }
288
+ },
289
+ setEnableDanmu(bEnable) {
290
+ let vm = this;
291
+ if (vm.zwplayer) {
292
+ vm.zwplayer.setEnableDanmu(bEnable);
293
+ }
294
+ },
295
+ appendDanmu(msgObj, setting) {
296
+ let vm = this;
297
+ if (vm.zwplayer) {
298
+ vm.zwplayer.appendDanmu(msgObj, setting);
299
+ }
300
+ },
301
+ setChapters(chapters) {
302
+ let vm = this;
303
+ if (vm.zwplayer) {
304
+ vm.zwplayer.setChapters(chapters);
305
+ }
306
+ },
307
+ addSubtitle(subtitleUrl, pos, title) {
308
+ let vm = this;
309
+ if (vm.zwplayer) {
310
+ vm.zwplayer.addSubtitle(subtitleUrl, pos, title);
311
+ }
312
+ },
313
+ removeSubtitle() {
314
+ let vm = this;
315
+ if (vm.zwplayer) {
316
+ vm.zwplayer.removeSubtitle();
317
+ }
318
+ },
319
+ buildDanmuControlbar(parentId, className) {
320
+ let vm = this;
321
+ if (vm.zwplayer) {
322
+ vm.zwplayer.buildDanmuControlbar(parentId, className);
323
+ }
324
+ },
325
+ notifyResize(width, height) {
326
+ let vm = this;
327
+ if (vm.zwplayer) {
328
+ vm.zwplayer.notifyResize(width, height);
329
+ }
330
+ },
331
+ setMute(bMute) {
332
+ let vm = this;
333
+ if (vm.zwplayer) {
334
+ vm.zwplayer.setMuted(bMute);
335
+ }
336
+ },
337
+ setullscr(bFullScr) {
338
+ let vm = this;
339
+ if (vm.zwplayer) {
340
+ vm.is_fullscr = bFullScr;
341
+ vm.zwplayer.setFullscreen(bFullScr);
342
+ }
343
+ }
344
+ },
345
+ computed: {
346
+ CurrentTime: function () {
347
+ let vm = this;
348
+ if (vm.zwplayer) {
349
+ return vm.zwplayer.CurrentTime;
350
+ }
351
+ return -1;
352
+ }
353
+ },
354
+ render(createElement) {
355
+ let playerid;
356
+
357
+ // console.log('render');
358
+ if (this.nodeid) {
359
+ playerid = this.nodeid;
360
+ } else {
361
+ let now = new Date().getTime();
362
+ if (!window.nextZWPlayerId) {
363
+ window.nextZWPlayerId = 1000;
364
+ } else {
365
+ window.nextZWPlayerId++;
366
+ }
367
+ playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
368
+ }
369
+ let playerWrap = createElement('div', {
370
+ class: {
371
+ 'zwplayer-vue': true
372
+ },
373
+ attrs: {
374
+ id: playerid
375
+ }
376
+ }, []);
377
+ if (playerWrap) {
378
+ let vm = this;
379
+ vm.playerid = playerid;
380
+ }
381
+ if (this.zwplayer && this.murl !== this.old_murl) {
382
+ this.zwplayer.play(this.murl); // change movie url
383
+ this.old_murl = this.murl;
384
+ }
385
+ return playerWrap;
386
+ },
387
+ mounted() {
388
+ let vm = this;
389
+ // console.log('mounted');
390
+ let zwplayer_js;
391
+ if (vm.zwplayerlib) zwplayer_js = vm.zwplayerlib;else zwplayer_js = zwplayer_js_def;
392
+ vm.rootElm = document.getElementById(vm.playerid);
393
+ if (vm.rootElm) {
394
+ vm.rootElm.style.width = '100%';
395
+ vm.rootElm.style.height = '100%';
396
+ vm.rootElm.style.margin = '0';
397
+ vm.rootElm.style.padding = '0';
398
+ }
399
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', zwplayer_js, function (jsid) {
400
+ let url = '';
401
+ if (!jsid) {
402
+ console.log('zwplayer_loadjs failed!');
403
+ }
404
+ if (vm.murl) url = vm.murl;else if (vm.videoprop && typeof vm.videoprop.url !== 'undefined') url = vm.videoprop.url;
405
+ let videostyle = "width:100%;height:100%;";
406
+ if (vm.videoprop && typeof vm.videoprop.videostyle !== 'undefined') videostyle = vm.videoprop.videostyle;
407
+ let params = {
408
+ url: url,
409
+ playerElm: vm.rootElm,
410
+ videostyle: videostyle,
411
+ reconnect: vm.reconnect,
412
+ autoplay: vm.autoplay,
413
+ muted: vm.muted,
414
+ controlbar: vm.controlbar,
415
+ useProgressTooltip: vm.useProgressTooltip,
416
+ onready: function () {
417
+ vm.$emit('onready', this);
418
+ },
419
+ onnetclose: function () {
420
+ vm.$emit('onnetclose', this);
421
+ return true;
422
+ },
423
+ onneterror: function () {
424
+ vm.$emit('onneterror', this);
425
+ },
426
+ onmediaevent: function (event) {
427
+ vm.$emit('onmediaevent', event, this);
428
+ }
429
+ };
430
+ let props_list = availabe_props;
431
+ for (let prop in vm.$attrs) {
432
+ if (prop in props_list && typeof vm.$attrs[prop] === props_list[prop]) {
433
+ if (typeof vm.$attrs[prop] === 'object') params[prop] = JSON.parse(JSON.stringify(vm.$attrs[prop]));else params[prop] = vm.$attrs[prop];
434
+ }
435
+ }
436
+ vm.zwplayer = new window.ZWPlayer(params);
437
+ if (params.danmuBarId) {
438
+ vm.zwplayer.buildDanmuControlbar(params.danmuBarId, 'vue-zwp-danmubar');
439
+ }
440
+ vm.old_murl = url;
441
+ });
442
+ },
443
+ beforeDestroy() {
444
+ // vue3.x beforeUnmount
445
+ let vm = this;
446
+ // console.log('beforeUnmount');
447
+ if (vm.zwplayer) {
448
+ vm.zwplayer.stop();
449
+ }
450
+ },
451
+ destroyed() {
452
+ // vue3.x unmounted
453
+ let vm = this;
454
+ // console.log('unmounted');
455
+ if (vm.zwplayer) {
456
+ vm.zwplayer.destroy();
457
+ delete vm.zwplayer;
458
+ }
459
+ }
460
+ });
461
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue?vue&type=script&lang=js
462
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
463
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
464
+ /* globals __VUE_SSR_CONTEXT__ */
465
+
466
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
467
+ // This module is a runtime utility for cleaner component module output and will
468
+ // be included in the final webpack user bundle.
469
+
470
+ function normalizeComponent(
471
+ scriptExports,
472
+ render,
473
+ staticRenderFns,
474
+ functionalTemplate,
475
+ injectStyles,
476
+ scopeId,
477
+ moduleIdentifier /* server only */,
478
+ shadowMode /* vue-cli only */
479
+ ) {
480
+ // Vue.extend constructor export interop
481
+ var options =
482
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
483
+
484
+ // render functions
485
+ if (render) {
486
+ options.render = render
487
+ options.staticRenderFns = staticRenderFns
488
+ options._compiled = true
489
+ }
490
+
491
+ // functional template
492
+ if (functionalTemplate) {
493
+ options.functional = true
494
+ }
495
+
496
+ // scopedId
497
+ if (scopeId) {
498
+ options._scopeId = 'data-v-' + scopeId
499
+ }
500
+
501
+ var hook
502
+ if (moduleIdentifier) {
503
+ // server build
504
+ hook = function (context) {
505
+ // 2.3 injection
506
+ context =
507
+ context || // cached call
508
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
509
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
510
+ // 2.2 with runInNewContext: true
511
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
512
+ context = __VUE_SSR_CONTEXT__
513
+ }
514
+ // inject component styles
515
+ if (injectStyles) {
516
+ injectStyles.call(this, context)
517
+ }
518
+ // register component module identifier for async chunk inferrence
519
+ if (context && context._registeredComponents) {
520
+ context._registeredComponents.add(moduleIdentifier)
521
+ }
522
+ }
523
+ // used by ssr in case component is cached and beforeCreate
524
+ // never gets called
525
+ options._ssrRegister = hook
526
+ } else if (injectStyles) {
527
+ hook = shadowMode
528
+ ? function () {
529
+ injectStyles.call(
530
+ this,
531
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
532
+ )
533
+ }
534
+ : injectStyles
535
+ }
536
+
537
+ if (hook) {
538
+ if (options.functional) {
539
+ // for template-only hot-reload because in that case the render fn doesn't
540
+ // go through the normalizer
541
+ options._injectStyles = hook
542
+ // register for functional component in vue file
543
+ var originalRender = options.render
544
+ options.render = function renderWithStyleInjection(h, context) {
545
+ hook.call(context)
546
+ return originalRender(h, context)
547
+ }
548
+ } else {
549
+ // inject component registration as beforeCreate hook
550
+ var existing = options.beforeCreate
551
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
552
+ }
553
+ }
554
+
555
+ return {
556
+ exports: scriptExports,
557
+ options: options
558
+ }
559
+ }
560
+
561
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue
562
+ var render, staticRenderFns
563
+ ;
564
+
565
+
566
+
567
+ /* normalize component */
568
+ ;
569
+ var component = normalizeComponent(
570
+ src_mainvue_type_script_lang_js,
571
+ render,
572
+ staticRenderFns,
573
+ false,
574
+ null,
575
+ null,
576
+ null
577
+
578
+ )
579
+
580
+ /* harmony default export */ var main = (component.exports);
581
+ ;// CONCATENATED MODULE: ./sources/vueplayer/index.js
582
+ //export defines
583
+
584
+
585
+ /* istanbul ignore next */
586
+ main.install = function (Vue) {
587
+ Vue.component(main.name, main); //
588
+ Vue.component('zero-web-player', main);
589
+ Vue.component('zero-player', main);
590
+ Vue.component('ZPlayer', main);
591
+ };
592
+ /* harmony default export */ var vueplayer = (main);
593
+ ;// CONCATENATED MODULE: ./sources/index.js
594
+ // 引入该目录下所有的组件
595
+
596
+ // import { zwplayer_loadjs } from "./vueplayer/src/loadjs.js"
597
+
598
+ const components = [vueplayer];
599
+ const ZwModule = {};
600
+ ZwModule.install = Vue => {
601
+ components.forEach(component => {
602
+ component.install(Vue);
603
+ });
604
+ };
605
+ if (typeof window !== 'undefined' && window.Vue) {
606
+ ZwModule.install(window.Vue);
607
+ }
608
+
609
+ // const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
610
+ /*
611
+ let Player;
612
+
613
+ if (typeof window.ZWPlayer === 'undefined') {
614
+ const loadTask = new Promise(function(resolve, reject) {
615
+ zwplayer_loadjs('zwplayer-core', zwplayer_js_def, function(jsid) {
616
+ if (jsid) {
617
+ resolve(window.ZWPlayer);
618
+ }
619
+ else {
620
+ reject('Load zwplayer library failed.');
621
+ }
622
+ });
623
+ });
624
+
625
+ try {
626
+ Player = await loadTask;
627
+ }
628
+ catch(e) {
629
+ alert(e.msg);
630
+ }
631
+ }
632
+ else {
633
+ Player = window.ZWPlayer;
634
+ }
635
+ */
636
+
637
+ /* harmony default export */ var sources = (ZwModule);
638
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
639
+
640
+
641
+ /* harmony default export */ var entry_lib = (sources);
642
+
643
+
644
+ }();
645
+ module.exports = __webpack_exports__;
646
+ /******/ })()
647
+ ;
648
+ //# sourceMappingURL=zwplayervue2.common.js.map
@@ -0,0 +1,659 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory();
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else if(typeof exports === 'object')
7
+ exports["zwplayervue2"] = factory();
8
+ else
9
+ root["zwplayervue2"] = factory();
10
+ })((typeof self !== 'undefined' ? self : this), function() {
11
+ return /******/ (function() { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 15:
15
+ /***/ (function(module) {
16
+
17
+ // zwplayer tools
18
+
19
+ const zwplayer_loadjs = function (id, url, cb) {
20
+ let headNode = document.getElementsByTagName("head");
21
+ if (headNode.length == 0) {
22
+ headNode = document.createElement("head");
23
+ let body = document.getElementsByTagName("body");
24
+ if (body.length > 0) {
25
+ body = body[0];
26
+ document.insertBefore(headNode, body);
27
+ } else {
28
+ alert('Invalid html document: no HEAD tag');
29
+ return false;
30
+ }
31
+ } else {
32
+ headNode = headNode[0];
33
+ const nodes = headNode.childNodes;
34
+ for (let i = 0; i < nodes.length; i++) {
35
+ const node = nodes[i];
36
+ if (node.nodeName.toUpperCase() === 'SCRIPT') {
37
+ if (node.id && node.id == id) {
38
+ if (node.getAttribute('loadstate') != 'true') {
39
+ const checkLoad = function () {
40
+ if (node.getAttribute('loadstate') != 'true') {
41
+ setTimeout(checkLoad, 50);
42
+ } else {
43
+ if (typeof cb == 'function') cb(id);
44
+ }
45
+ };
46
+ setTimeout(checkLoad, 50);
47
+ return false;
48
+ }
49
+ if (typeof cb == 'function') cb(id);
50
+ return true;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ const script = document.createElement("script");
56
+ script.type = "text/javascript";
57
+ if (script.readyState) {
58
+ // IE
59
+ script.onreadystatechange = function () {
60
+ if (script.readyState == "loaded" || script.readyState == "complete") {
61
+ script.onreadystatechange = null;
62
+ script.setAttribute('loadstate', 'true');
63
+ if (typeof cb == 'function') cb(id);
64
+ }
65
+ };
66
+ } else {
67
+ script.onload = function () {
68
+ script.setAttribute('loadstate', 'true');
69
+ script.setAttribute('charset', 'utf-8');
70
+ if (typeof cb == 'function') cb(id);
71
+ };
72
+ }
73
+ script.id = id;
74
+ script.src = url;
75
+ headNode.appendChild(script);
76
+ return false;
77
+ };
78
+ module.exports.l = zwplayer_loadjs;
79
+
80
+ /***/ })
81
+
82
+ /******/ });
83
+ /************************************************************************/
84
+ /******/ // The module cache
85
+ /******/ var __webpack_module_cache__ = {};
86
+ /******/
87
+ /******/ // The require function
88
+ /******/ function __webpack_require__(moduleId) {
89
+ /******/ // Check if module is in cache
90
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
91
+ /******/ if (cachedModule !== undefined) {
92
+ /******/ return cachedModule.exports;
93
+ /******/ }
94
+ /******/ // Create a new module (and put it into the cache)
95
+ /******/ var module = __webpack_module_cache__[moduleId] = {
96
+ /******/ // no module.id needed
97
+ /******/ // no module.loaded needed
98
+ /******/ exports: {}
99
+ /******/ };
100
+ /******/
101
+ /******/ // Execute the module function
102
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
103
+ /******/
104
+ /******/ // Return the exports of the module
105
+ /******/ return module.exports;
106
+ /******/ }
107
+ /******/
108
+ /************************************************************************/
109
+ /******/ /* webpack/runtime/define property getters */
110
+ /******/ !function() {
111
+ /******/ // define getter functions for harmony exports
112
+ /******/ __webpack_require__.d = function(exports, definition) {
113
+ /******/ for(var key in definition) {
114
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
115
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
116
+ /******/ }
117
+ /******/ }
118
+ /******/ };
119
+ /******/ }();
120
+ /******/
121
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
122
+ /******/ !function() {
123
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
124
+ /******/ }();
125
+ /******/
126
+ /******/ /* webpack/runtime/make namespace object */
127
+ /******/ !function() {
128
+ /******/ // define __esModule on exports
129
+ /******/ __webpack_require__.r = function(exports) {
130
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
131
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
132
+ /******/ }
133
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
134
+ /******/ };
135
+ /******/ }();
136
+ /******/
137
+ /******/ /* webpack/runtime/publicPath */
138
+ /******/ !function() {
139
+ /******/ __webpack_require__.p = "";
140
+ /******/ }();
141
+ /******/
142
+ /************************************************************************/
143
+ var __webpack_exports__ = {};
144
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
145
+ !function() {
146
+ "use strict";
147
+ // ESM COMPAT FLAG
148
+ __webpack_require__.r(__webpack_exports__);
149
+
150
+ // EXPORTS
151
+ __webpack_require__.d(__webpack_exports__, {
152
+ "default": function() { return /* binding */ entry_lib; },
153
+ zwplayer: function() { return /* reexport */ vueplayer; }
154
+ });
155
+
156
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
157
+ /* eslint-disable no-var */
158
+ // This file is imported into lib/wc client bundles.
159
+
160
+ if (typeof window !== 'undefined') {
161
+ var currentScript = window.document.currentScript
162
+ if (false) { var getCurrentScript; }
163
+
164
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
165
+ if (src) {
166
+ __webpack_require__.p = src[1] // eslint-disable-line
167
+ }
168
+ }
169
+
170
+ // Indicate to webpack that this file can be concatenated
171
+ /* harmony default export */ var setPublicPath = (null);
172
+
173
+ // EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
174
+ var loadjs = __webpack_require__(15);
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
176
+ // import { h } from 'vue'
177
+
178
+ const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
179
+ const availabe_props = {
180
+ isLive: 'boolean',
181
+ useOldFlv: 'boolean',
182
+ useFlv: 'boolean',
183
+ streamtype: 'string',
184
+ hasAudio: 'boolean',
185
+ hasVideo: 'boolean',
186
+ xmc_url: 'string',
187
+ fixedControlbar: 'boolean',
188
+ nativecontrols: 'boolean',
189
+ infoButton: 'boolean',
190
+ speedButton: 'boolean',
191
+ optionButton: 'boolean',
192
+ snapshotButton: 'boolean',
193
+ chapterButton: 'boolean',
194
+ enableDanmu: 'boolean',
195
+ useProgressTooltip: 'boolean',
196
+ hidePlayBtn: 'boolean',
197
+ disablePlayBtn: 'boolean',
198
+ disableSeek: 'boolean',
199
+ disableFullscreenWin: 'boolean',
200
+ disablePicInPic: 'boolean',
201
+ disableVolumeControl: 'boolean',
202
+ lostFocusPause: 'boolean',
203
+ autoSmallWindow: 'boolean',
204
+ thumbnails: 'object',
205
+ sendDanmu: 'function',
206
+ danmuBarId: 'string',
207
+ fluid: 'boolean'
208
+ };
209
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
210
+ name: 'ZwPlayer',
211
+ data() {
212
+ return {
213
+ zwplayer: null,
214
+ nodename: 'ZwPlayer'
215
+ };
216
+ },
217
+ props: {
218
+ zwplayerlib: String,
219
+ murl: String,
220
+ nodeid: String,
221
+ muted: Boolean,
222
+ autoplay: {
223
+ type: Boolean,
224
+ default: true
225
+ },
226
+ videoprop: Object,
227
+ videostyle: String,
228
+ reconnect: {
229
+ type: Boolean,
230
+ default: true
231
+ },
232
+ controlbar: {
233
+ type: Boolean,
234
+ default: true
235
+ },
236
+ useProgressTooltip: {
237
+ type: Boolean,
238
+ default: true
239
+ }
240
+ },
241
+ emits: ['oneterror', 'onmediaevent', 'onready'],
242
+ methods: {
243
+ play(url, isLive, useOldFlv) {
244
+ let vm = this;
245
+ if (!url) url = this.murl;
246
+ if (!vm.zwplayer) return;
247
+ vm.zwplayer.play(url, isLive, useOldFlv);
248
+ },
249
+ stop() {
250
+ let vm = this;
251
+ if (vm.zwplayer) {
252
+ vm.zwplayer.stop();
253
+ }
254
+ },
255
+ pause() {
256
+ let vm = this;
257
+ if (vm.zwplayer) {
258
+ vm.zwplayer.pause();
259
+ }
260
+ },
261
+ resume() {
262
+ let vm = this;
263
+ if (vm.zwplayer) {
264
+ vm.zwplayer.resume();
265
+ }
266
+ },
267
+ getDuration() {
268
+ let vm = this;
269
+ if (vm.zwplayer) {
270
+ return vm.zwplayer.getDuration();
271
+ }
272
+ return undefined;
273
+ },
274
+ getCurrentTime() {
275
+ let vm = this;
276
+ if (vm.zwplayer) {
277
+ return vm.zwplayer.CurrentTime;
278
+ }
279
+ return undefined;
280
+ },
281
+ seekTime(time) {
282
+ let vm = this;
283
+ if (vm.zwplayer) {
284
+ vm.zwplayer.seekTime(time);
285
+ }
286
+ },
287
+ destroy() {
288
+ let vm = this;
289
+ if (vm.zwplayer) {
290
+ vm.zwplayer.destroy();
291
+ }
292
+ },
293
+ setplaystate(bPlaying) {
294
+ let vm = this;
295
+ if (vm.zwplayer) {
296
+ vm.zwplayer.setplaystate(bPlaying);
297
+ }
298
+ },
299
+ setEnableDanmu(bEnable) {
300
+ let vm = this;
301
+ if (vm.zwplayer) {
302
+ vm.zwplayer.setEnableDanmu(bEnable);
303
+ }
304
+ },
305
+ appendDanmu(msgObj, setting) {
306
+ let vm = this;
307
+ if (vm.zwplayer) {
308
+ vm.zwplayer.appendDanmu(msgObj, setting);
309
+ }
310
+ },
311
+ setChapters(chapters) {
312
+ let vm = this;
313
+ if (vm.zwplayer) {
314
+ vm.zwplayer.setChapters(chapters);
315
+ }
316
+ },
317
+ addSubtitle(subtitleUrl, pos, title) {
318
+ let vm = this;
319
+ if (vm.zwplayer) {
320
+ vm.zwplayer.addSubtitle(subtitleUrl, pos, title);
321
+ }
322
+ },
323
+ removeSubtitle() {
324
+ let vm = this;
325
+ if (vm.zwplayer) {
326
+ vm.zwplayer.removeSubtitle();
327
+ }
328
+ },
329
+ buildDanmuControlbar(parentId, className) {
330
+ let vm = this;
331
+ if (vm.zwplayer) {
332
+ vm.zwplayer.buildDanmuControlbar(parentId, className);
333
+ }
334
+ },
335
+ notifyResize(width, height) {
336
+ let vm = this;
337
+ if (vm.zwplayer) {
338
+ vm.zwplayer.notifyResize(width, height);
339
+ }
340
+ },
341
+ setMute(bMute) {
342
+ let vm = this;
343
+ if (vm.zwplayer) {
344
+ vm.zwplayer.setMuted(bMute);
345
+ }
346
+ },
347
+ setullscr(bFullScr) {
348
+ let vm = this;
349
+ if (vm.zwplayer) {
350
+ vm.is_fullscr = bFullScr;
351
+ vm.zwplayer.setFullscreen(bFullScr);
352
+ }
353
+ }
354
+ },
355
+ computed: {
356
+ CurrentTime: function () {
357
+ let vm = this;
358
+ if (vm.zwplayer) {
359
+ return vm.zwplayer.CurrentTime;
360
+ }
361
+ return -1;
362
+ }
363
+ },
364
+ render(createElement) {
365
+ let playerid;
366
+
367
+ // console.log('render');
368
+ if (this.nodeid) {
369
+ playerid = this.nodeid;
370
+ } else {
371
+ let now = new Date().getTime();
372
+ if (!window.nextZWPlayerId) {
373
+ window.nextZWPlayerId = 1000;
374
+ } else {
375
+ window.nextZWPlayerId++;
376
+ }
377
+ playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
378
+ }
379
+ let playerWrap = createElement('div', {
380
+ class: {
381
+ 'zwplayer-vue': true
382
+ },
383
+ attrs: {
384
+ id: playerid
385
+ }
386
+ }, []);
387
+ if (playerWrap) {
388
+ let vm = this;
389
+ vm.playerid = playerid;
390
+ }
391
+ if (this.zwplayer && this.murl !== this.old_murl) {
392
+ this.zwplayer.play(this.murl); // change movie url
393
+ this.old_murl = this.murl;
394
+ }
395
+ return playerWrap;
396
+ },
397
+ mounted() {
398
+ let vm = this;
399
+ // console.log('mounted');
400
+ let zwplayer_js;
401
+ if (vm.zwplayerlib) zwplayer_js = vm.zwplayerlib;else zwplayer_js = zwplayer_js_def;
402
+ vm.rootElm = document.getElementById(vm.playerid);
403
+ if (vm.rootElm) {
404
+ vm.rootElm.style.width = '100%';
405
+ vm.rootElm.style.height = '100%';
406
+ vm.rootElm.style.margin = '0';
407
+ vm.rootElm.style.padding = '0';
408
+ }
409
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', zwplayer_js, function (jsid) {
410
+ let url = '';
411
+ if (!jsid) {
412
+ console.log('zwplayer_loadjs failed!');
413
+ }
414
+ if (vm.murl) url = vm.murl;else if (vm.videoprop && typeof vm.videoprop.url !== 'undefined') url = vm.videoprop.url;
415
+ let videostyle = "width:100%;height:100%;";
416
+ if (vm.videoprop && typeof vm.videoprop.videostyle !== 'undefined') videostyle = vm.videoprop.videostyle;
417
+ let params = {
418
+ url: url,
419
+ playerElm: vm.rootElm,
420
+ videostyle: videostyle,
421
+ reconnect: vm.reconnect,
422
+ autoplay: vm.autoplay,
423
+ muted: vm.muted,
424
+ controlbar: vm.controlbar,
425
+ useProgressTooltip: vm.useProgressTooltip,
426
+ onready: function () {
427
+ vm.$emit('onready', this);
428
+ },
429
+ onnetclose: function () {
430
+ vm.$emit('onnetclose', this);
431
+ return true;
432
+ },
433
+ onneterror: function () {
434
+ vm.$emit('onneterror', this);
435
+ },
436
+ onmediaevent: function (event) {
437
+ vm.$emit('onmediaevent', event, this);
438
+ }
439
+ };
440
+ let props_list = availabe_props;
441
+ for (let prop in vm.$attrs) {
442
+ if (prop in props_list && typeof vm.$attrs[prop] === props_list[prop]) {
443
+ if (typeof vm.$attrs[prop] === 'object') params[prop] = JSON.parse(JSON.stringify(vm.$attrs[prop]));else params[prop] = vm.$attrs[prop];
444
+ }
445
+ }
446
+ vm.zwplayer = new window.ZWPlayer(params);
447
+ if (params.danmuBarId) {
448
+ vm.zwplayer.buildDanmuControlbar(params.danmuBarId, 'vue-zwp-danmubar');
449
+ }
450
+ vm.old_murl = url;
451
+ });
452
+ },
453
+ beforeDestroy() {
454
+ // vue3.x beforeUnmount
455
+ let vm = this;
456
+ // console.log('beforeUnmount');
457
+ if (vm.zwplayer) {
458
+ vm.zwplayer.stop();
459
+ }
460
+ },
461
+ destroyed() {
462
+ // vue3.x unmounted
463
+ let vm = this;
464
+ // console.log('unmounted');
465
+ if (vm.zwplayer) {
466
+ vm.zwplayer.destroy();
467
+ delete vm.zwplayer;
468
+ }
469
+ }
470
+ });
471
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue?vue&type=script&lang=js
472
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
473
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
474
+ /* globals __VUE_SSR_CONTEXT__ */
475
+
476
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
477
+ // This module is a runtime utility for cleaner component module output and will
478
+ // be included in the final webpack user bundle.
479
+
480
+ function normalizeComponent(
481
+ scriptExports,
482
+ render,
483
+ staticRenderFns,
484
+ functionalTemplate,
485
+ injectStyles,
486
+ scopeId,
487
+ moduleIdentifier /* server only */,
488
+ shadowMode /* vue-cli only */
489
+ ) {
490
+ // Vue.extend constructor export interop
491
+ var options =
492
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
493
+
494
+ // render functions
495
+ if (render) {
496
+ options.render = render
497
+ options.staticRenderFns = staticRenderFns
498
+ options._compiled = true
499
+ }
500
+
501
+ // functional template
502
+ if (functionalTemplate) {
503
+ options.functional = true
504
+ }
505
+
506
+ // scopedId
507
+ if (scopeId) {
508
+ options._scopeId = 'data-v-' + scopeId
509
+ }
510
+
511
+ var hook
512
+ if (moduleIdentifier) {
513
+ // server build
514
+ hook = function (context) {
515
+ // 2.3 injection
516
+ context =
517
+ context || // cached call
518
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
519
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
520
+ // 2.2 with runInNewContext: true
521
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
522
+ context = __VUE_SSR_CONTEXT__
523
+ }
524
+ // inject component styles
525
+ if (injectStyles) {
526
+ injectStyles.call(this, context)
527
+ }
528
+ // register component module identifier for async chunk inferrence
529
+ if (context && context._registeredComponents) {
530
+ context._registeredComponents.add(moduleIdentifier)
531
+ }
532
+ }
533
+ // used by ssr in case component is cached and beforeCreate
534
+ // never gets called
535
+ options._ssrRegister = hook
536
+ } else if (injectStyles) {
537
+ hook = shadowMode
538
+ ? function () {
539
+ injectStyles.call(
540
+ this,
541
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
542
+ )
543
+ }
544
+ : injectStyles
545
+ }
546
+
547
+ if (hook) {
548
+ if (options.functional) {
549
+ // for template-only hot-reload because in that case the render fn doesn't
550
+ // go through the normalizer
551
+ options._injectStyles = hook
552
+ // register for functional component in vue file
553
+ var originalRender = options.render
554
+ options.render = function renderWithStyleInjection(h, context) {
555
+ hook.call(context)
556
+ return originalRender(h, context)
557
+ }
558
+ } else {
559
+ // inject component registration as beforeCreate hook
560
+ var existing = options.beforeCreate
561
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
562
+ }
563
+ }
564
+
565
+ return {
566
+ exports: scriptExports,
567
+ options: options
568
+ }
569
+ }
570
+
571
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue
572
+ var render, staticRenderFns
573
+ ;
574
+
575
+
576
+
577
+ /* normalize component */
578
+ ;
579
+ var component = normalizeComponent(
580
+ src_mainvue_type_script_lang_js,
581
+ render,
582
+ staticRenderFns,
583
+ false,
584
+ null,
585
+ null,
586
+ null
587
+
588
+ )
589
+
590
+ /* harmony default export */ var main = (component.exports);
591
+ ;// CONCATENATED MODULE: ./sources/vueplayer/index.js
592
+ //export defines
593
+
594
+
595
+ /* istanbul ignore next */
596
+ main.install = function (Vue) {
597
+ Vue.component(main.name, main); //
598
+ Vue.component('zero-web-player', main);
599
+ Vue.component('zero-player', main);
600
+ Vue.component('ZPlayer', main);
601
+ };
602
+ /* harmony default export */ var vueplayer = (main);
603
+ ;// CONCATENATED MODULE: ./sources/index.js
604
+ // 引入该目录下所有的组件
605
+
606
+ // import { zwplayer_loadjs } from "./vueplayer/src/loadjs.js"
607
+
608
+ const components = [vueplayer];
609
+ const ZwModule = {};
610
+ ZwModule.install = Vue => {
611
+ components.forEach(component => {
612
+ component.install(Vue);
613
+ });
614
+ };
615
+ if (typeof window !== 'undefined' && window.Vue) {
616
+ ZwModule.install(window.Vue);
617
+ }
618
+
619
+ // const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
620
+ /*
621
+ let Player;
622
+
623
+ if (typeof window.ZWPlayer === 'undefined') {
624
+ const loadTask = new Promise(function(resolve, reject) {
625
+ zwplayer_loadjs('zwplayer-core', zwplayer_js_def, function(jsid) {
626
+ if (jsid) {
627
+ resolve(window.ZWPlayer);
628
+ }
629
+ else {
630
+ reject('Load zwplayer library failed.');
631
+ }
632
+ });
633
+ });
634
+
635
+ try {
636
+ Player = await loadTask;
637
+ }
638
+ catch(e) {
639
+ alert(e.msg);
640
+ }
641
+ }
642
+ else {
643
+ Player = window.ZWPlayer;
644
+ }
645
+ */
646
+
647
+ /* harmony default export */ var sources = (ZwModule);
648
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
649
+
650
+
651
+ /* harmony default export */ var entry_lib = (sources);
652
+
653
+
654
+ }();
655
+ /******/ return __webpack_exports__;
656
+ /******/ })()
657
+ ;
658
+ });
659
+ //# sourceMappingURL=zwplayervue2.umd.js.map
@@ -0,0 +1,2 @@
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.6",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",fluid:"boolean"};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()},getCurrentTime(){let e=this;if(e.zwplayer)return e.zwplayer.CurrentTime},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))}},computed:{CurrentTime:function(){let e=this;return e.zwplayer?e.zwplayer.CurrentTime:-1}},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
+ //# sourceMappingURL=zwplayervue2.umd.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zwplayer-vue2x",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A fully functional and lightweight free open-source web player",
5
5
  "main": "lib/zwplayervue2.umd.min.js",
6
6
  "keyword": "zwplayervue2, zwplayer-vue2x, zero-web-player",
package/sources/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // 引入该目录下所有的组件
2
2
  import zwplayer from "./vueplayer/index.js";
3
- import { zwplayer_loadjs } from "./vueplayer/src/loadjs.js"
3
+ // import { zwplayer_loadjs } from "./vueplayer/src/loadjs.js"
4
4
 
5
5
  const components = [
6
6
  zwplayer
@@ -17,7 +17,7 @@ if (typeof window !== 'undefined' && window.Vue) {
17
17
  ZwModule.install(window.Vue)
18
18
  }
19
19
 
20
- const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
20
+ // const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
21
21
  /*
22
22
  let Player;
23
23