zwplayer-vue2x 1.0.15 → 1.0.16

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,656 @@
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
+ Player: function() { return /* reexport */ Player; },
143
+ "default": function() { return /* binding */ entry_lib; },
144
+ zwplayer: function() { return /* reexport */ vueplayer; }
145
+ });
146
+
147
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
148
+ /* eslint-disable no-var */
149
+ // This file is imported into lib/wc client bundles.
150
+
151
+ if (typeof window !== 'undefined') {
152
+ var currentScript = window.document.currentScript
153
+ if (false) { var getCurrentScript; }
154
+
155
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
156
+ if (src) {
157
+ __webpack_require__.p = src[1] // eslint-disable-line
158
+ }
159
+ }
160
+
161
+ // Indicate to webpack that this file can be concatenated
162
+ /* harmony default export */ var setPublicPath = (null);
163
+
164
+ // EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
165
+ var loadjs = __webpack_require__(709);
166
+ ;// 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
167
+ // import { h } from 'vue'
168
+
169
+ const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
170
+ const availabe_props = {
171
+ isLive: 'boolean',
172
+ useOldFlv: 'boolean',
173
+ useFlv: 'boolean',
174
+ streamtype: 'string',
175
+ hasAudio: 'boolean',
176
+ hasVideo: 'boolean',
177
+ xmc_url: 'string',
178
+ fixedControlbar: 'boolean',
179
+ nativecontrols: 'boolean',
180
+ infoButton: 'boolean',
181
+ speedButton: 'boolean',
182
+ optionButton: 'boolean',
183
+ snapshotButton: 'boolean',
184
+ chapterButton: 'boolean',
185
+ enableDanmu: 'boolean',
186
+ useProgressTooltip: 'boolean',
187
+ hidePlayBtn: 'boolean',
188
+ disablePlayBtn: 'boolean',
189
+ disableSeek: 'boolean',
190
+ disableFullscreenWin: 'boolean',
191
+ disablePicInPic: 'boolean',
192
+ disableVolumeControl: 'boolean',
193
+ lostFocusPause: 'boolean',
194
+ autoSmallWindow: 'boolean',
195
+ thumbnails: 'object',
196
+ sendDanmu: 'function',
197
+ danmuBarId: 'string',
198
+ fluid: 'boolean'
199
+ };
200
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
201
+ name: 'ZwPlayer',
202
+ data() {
203
+ return {
204
+ zwplayer: null,
205
+ nodename: 'ZwPlayer'
206
+ };
207
+ },
208
+ props: {
209
+ zwplayerlib: String,
210
+ murl: String,
211
+ nodeid: String,
212
+ muted: Boolean,
213
+ autoplay: {
214
+ type: Boolean,
215
+ default: true
216
+ },
217
+ videoprop: Object,
218
+ videostyle: String,
219
+ reconnect: {
220
+ type: Boolean,
221
+ default: true
222
+ },
223
+ controlbar: {
224
+ type: Boolean,
225
+ default: true
226
+ },
227
+ useProgressTooltip: {
228
+ type: Boolean,
229
+ default: true
230
+ }
231
+ },
232
+ emits: ['oneterror', 'onmediaevent', 'onready'],
233
+ methods: {
234
+ play(url, isLive, useOldFlv) {
235
+ let vm = this;
236
+ if (!url) url = this.murl;
237
+ if (!vm.zwplayer) return;
238
+ vm.zwplayer.play(url, isLive, useOldFlv);
239
+ },
240
+ stop() {
241
+ let vm = this;
242
+ if (vm.zwplayer) {
243
+ vm.zwplayer.stop();
244
+ }
245
+ },
246
+ pause() {
247
+ let vm = this;
248
+ if (vm.zwplayer) {
249
+ vm.zwplayer.pause();
250
+ }
251
+ },
252
+ resume() {
253
+ let vm = this;
254
+ if (vm.zwplayer) {
255
+ vm.zwplayer.resume();
256
+ }
257
+ },
258
+ getDuration() {
259
+ let vm = this;
260
+ if (vm.zwplayer) {
261
+ return vm.zwplayer.getDuration();
262
+ }
263
+ return undefined;
264
+ },
265
+ getCurrentTime() {
266
+ let vm = this;
267
+ if (vm.zwplayer) {
268
+ return vm.zwplayer.CurrentTime;
269
+ }
270
+ return undefined;
271
+ },
272
+ seekTime(time) {
273
+ let vm = this;
274
+ if (vm.zwplayer) {
275
+ vm.zwplayer.seekTime(time);
276
+ }
277
+ },
278
+ destroy() {
279
+ let vm = this;
280
+ if (vm.zwplayer) {
281
+ vm.zwplayer.destroy();
282
+ }
283
+ },
284
+ setplaystate(bPlaying) {
285
+ let vm = this;
286
+ if (vm.zwplayer) {
287
+ vm.zwplayer.setplaystate(bPlaying);
288
+ }
289
+ },
290
+ setEnableDanmu(bEnable) {
291
+ let vm = this;
292
+ if (vm.zwplayer) {
293
+ vm.zwplayer.setEnableDanmu(bEnable);
294
+ }
295
+ },
296
+ appendDanmu(msgObj, setting) {
297
+ let vm = this;
298
+ if (vm.zwplayer) {
299
+ vm.zwplayer.appendDanmu(msgObj, setting);
300
+ }
301
+ },
302
+ setChapters(chapters) {
303
+ let vm = this;
304
+ if (vm.zwplayer) {
305
+ vm.zwplayer.setChapters(chapters);
306
+ }
307
+ },
308
+ addSubtitle(subtitleUrl, pos, title) {
309
+ let vm = this;
310
+ if (vm.zwplayer) {
311
+ vm.zwplayer.addSubtitle(subtitleUrl, pos, title);
312
+ }
313
+ },
314
+ removeSubtitle() {
315
+ let vm = this;
316
+ if (vm.zwplayer) {
317
+ vm.zwplayer.removeSubtitle();
318
+ }
319
+ },
320
+ buildDanmuControlbar(parentId, className) {
321
+ let vm = this;
322
+ if (vm.zwplayer) {
323
+ vm.zwplayer.buildDanmuControlbar(parentId, className);
324
+ }
325
+ },
326
+ notifyResize(width, height) {
327
+ let vm = this;
328
+ if (vm.zwplayer) {
329
+ vm.zwplayer.notifyResize(width, height);
330
+ }
331
+ },
332
+ setMute(bMute) {
333
+ let vm = this;
334
+ if (vm.zwplayer) {
335
+ vm.zwplayer.setMuted(bMute);
336
+ }
337
+ },
338
+ setullscr(bFullScr) {
339
+ let vm = this;
340
+ if (vm.zwplayer) {
341
+ vm.is_fullscr = bFullScr;
342
+ vm.zwplayer.setFullscreen(bFullScr);
343
+ }
344
+ }
345
+ },
346
+ computed: {
347
+ CurrentTime: function () {
348
+ let vm = this;
349
+ if (vm.zwplayer) {
350
+ return vm.zwplayer.CurrentTime;
351
+ }
352
+ return -1;
353
+ }
354
+ },
355
+ render(createElement) {
356
+ let playerid;
357
+
358
+ // console.log('render');
359
+ if (this.nodeid) {
360
+ playerid = this.nodeid;
361
+ } else {
362
+ let now = new Date().getTime();
363
+ if (!window.nextZWPlayerId) {
364
+ window.nextZWPlayerId = 1000;
365
+ } else {
366
+ window.nextZWPlayerId++;
367
+ }
368
+ playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
369
+ }
370
+ let playerWrap = createElement('div', {
371
+ class: {
372
+ 'zwplayer-vue': true
373
+ },
374
+ attrs: {
375
+ id: playerid
376
+ }
377
+ }, []);
378
+ if (playerWrap) {
379
+ let vm = this;
380
+ vm.playerid = playerid;
381
+ }
382
+ if (this.zwplayer && this.murl !== this.old_murl) {
383
+ this.zwplayer.play(this.murl); // change movie url
384
+ this.old_murl = this.murl;
385
+ }
386
+ return playerWrap;
387
+ },
388
+ mounted() {
389
+ let vm = this;
390
+ // console.log('mounted');
391
+ let zwplayer_js;
392
+ if (vm.zwplayerlib) zwplayer_js = vm.zwplayerlib;else zwplayer_js = zwplayer_js_def;
393
+ vm.rootElm = document.getElementById(vm.playerid);
394
+ if (vm.rootElm) {
395
+ vm.rootElm.style.width = '100%';
396
+ vm.rootElm.style.height = '100%';
397
+ vm.rootElm.style.margin = '0';
398
+ vm.rootElm.style.padding = '0';
399
+ }
400
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', zwplayer_js, function (jsid) {
401
+ let url = '';
402
+ if (!jsid) {
403
+ console.log('zwplayer_loadjs failed!');
404
+ }
405
+ if (vm.murl) url = vm.murl;else if (vm.videoprop && typeof vm.videoprop.url !== 'undefined') url = vm.videoprop.url;
406
+ let videostyle = "width:100%;height:100%;";
407
+ if (vm.videoprop && typeof vm.videoprop.videostyle !== 'undefined') videostyle = vm.videoprop.videostyle;
408
+ let params = {
409
+ url: url,
410
+ playerElm: vm.rootElm,
411
+ videostyle: videostyle,
412
+ reconnect: vm.reconnect,
413
+ autoplay: vm.autoplay,
414
+ muted: vm.muted,
415
+ controlbar: vm.controlbar,
416
+ useProgressTooltip: vm.useProgressTooltip,
417
+ onready: function () {
418
+ vm.$emit('onready', this);
419
+ },
420
+ onnetclose: function () {
421
+ vm.$emit('onnetclose', this);
422
+ return true;
423
+ },
424
+ onneterror: function () {
425
+ vm.$emit('onneterror', this);
426
+ },
427
+ onmediaevent: function (event) {
428
+ vm.$emit('onmediaevent', event, this);
429
+ }
430
+ };
431
+ let props_list = availabe_props;
432
+ for (let prop in vm.$attrs) {
433
+ if (prop in props_list && typeof vm.$attrs[prop] === props_list[prop]) {
434
+ if (typeof vm.$attrs[prop] === 'object') params[prop] = JSON.parse(JSON.stringify(vm.$attrs[prop]));else params[prop] = vm.$attrs[prop];
435
+ }
436
+ }
437
+ vm.zwplayer = new window.ZWPlayer(params);
438
+ if (params.danmuBarId) {
439
+ vm.zwplayer.buildDanmuControlbar(params.danmuBarId, 'vue-zwp-danmubar');
440
+ }
441
+ vm.old_murl = url;
442
+ });
443
+ },
444
+ beforeDestroy() {
445
+ // vue3.x beforeUnmount
446
+ let vm = this;
447
+ // console.log('beforeUnmount');
448
+ if (vm.zwplayer) {
449
+ vm.zwplayer.stop();
450
+ }
451
+ },
452
+ destroyed() {
453
+ // vue3.x unmounted
454
+ let vm = this;
455
+ // console.log('unmounted');
456
+ if (vm.zwplayer) {
457
+ vm.zwplayer.destroy();
458
+ delete vm.zwplayer;
459
+ }
460
+ }
461
+ });
462
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue?vue&type=script&lang=js
463
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
464
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
465
+ /* globals __VUE_SSR_CONTEXT__ */
466
+
467
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
468
+ // This module is a runtime utility for cleaner component module output and will
469
+ // be included in the final webpack user bundle.
470
+
471
+ function normalizeComponent(
472
+ scriptExports,
473
+ render,
474
+ staticRenderFns,
475
+ functionalTemplate,
476
+ injectStyles,
477
+ scopeId,
478
+ moduleIdentifier /* server only */,
479
+ shadowMode /* vue-cli only */
480
+ ) {
481
+ // Vue.extend constructor export interop
482
+ var options =
483
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
484
+
485
+ // render functions
486
+ if (render) {
487
+ options.render = render
488
+ options.staticRenderFns = staticRenderFns
489
+ options._compiled = true
490
+ }
491
+
492
+ // functional template
493
+ if (functionalTemplate) {
494
+ options.functional = true
495
+ }
496
+
497
+ // scopedId
498
+ if (scopeId) {
499
+ options._scopeId = 'data-v-' + scopeId
500
+ }
501
+
502
+ var hook
503
+ if (moduleIdentifier) {
504
+ // server build
505
+ hook = function (context) {
506
+ // 2.3 injection
507
+ context =
508
+ context || // cached call
509
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
510
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
511
+ // 2.2 with runInNewContext: true
512
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
513
+ context = __VUE_SSR_CONTEXT__
514
+ }
515
+ // inject component styles
516
+ if (injectStyles) {
517
+ injectStyles.call(this, context)
518
+ }
519
+ // register component module identifier for async chunk inferrence
520
+ if (context && context._registeredComponents) {
521
+ context._registeredComponents.add(moduleIdentifier)
522
+ }
523
+ }
524
+ // used by ssr in case component is cached and beforeCreate
525
+ // never gets called
526
+ options._ssrRegister = hook
527
+ } else if (injectStyles) {
528
+ hook = shadowMode
529
+ ? function () {
530
+ injectStyles.call(
531
+ this,
532
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
533
+ )
534
+ }
535
+ : injectStyles
536
+ }
537
+
538
+ if (hook) {
539
+ if (options.functional) {
540
+ // for template-only hot-reload because in that case the render fn doesn't
541
+ // go through the normalizer
542
+ options._injectStyles = hook
543
+ // register for functional component in vue file
544
+ var originalRender = options.render
545
+ options.render = function renderWithStyleInjection(h, context) {
546
+ hook.call(context)
547
+ return originalRender(h, context)
548
+ }
549
+ } else {
550
+ // inject component registration as beforeCreate hook
551
+ var existing = options.beforeCreate
552
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
553
+ }
554
+ }
555
+
556
+ return {
557
+ exports: scriptExports,
558
+ options: options
559
+ }
560
+ }
561
+
562
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue
563
+ var render, staticRenderFns
564
+ ;
565
+
566
+
567
+
568
+ /* normalize component */
569
+ ;
570
+ var component = normalizeComponent(
571
+ src_mainvue_type_script_lang_js,
572
+ render,
573
+ staticRenderFns,
574
+ false,
575
+ null,
576
+ null,
577
+ null
578
+
579
+ )
580
+
581
+ /* harmony default export */ var main = (component.exports);
582
+ ;// CONCATENATED MODULE: ./sources/vueplayer/index.js
583
+ //export defines
584
+
585
+
586
+ /* istanbul ignore next */
587
+ main.install = function (Vue) {
588
+ Vue.component(main.name, main); //
589
+ Vue.component('zero-web-player', main);
590
+ Vue.component('zero-player', main);
591
+ Vue.component('ZPlayer', main);
592
+ };
593
+ /* harmony default export */ var vueplayer = (main);
594
+ ;// CONCATENATED MODULE: ./sources/index.js
595
+ // 引入该目录下所有的组件
596
+
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
+ const sources_zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
609
+ const Player = function (param) {
610
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', sources_zwplayer_js_def, function (jsid) {
611
+ if (jsid) {
612
+ console.log(typeof param);
613
+ console.log('Player param zwplayer_loadjs:', jsid);
614
+ } else {
615
+ console.log('Load zwplayer library failed.');
616
+ }
617
+ });
618
+ };
619
+ /*
620
+ if (typeof window.ZWPlayer === 'undefined') {
621
+ const loadTask = new Promise(function(resolve, reject) {
622
+ zwplayer_loadjs('zwplayer-core', zwplayer_js_def, function(jsid) {
623
+ if (jsid) {
624
+ resolve(window.ZWPlayer);
625
+ }
626
+ else {
627
+ reject('Load zwplayer library failed.');
628
+ }
629
+ });
630
+ });
631
+
632
+ try {
633
+ Player = await loadTask;
634
+ }
635
+ catch(e) {
636
+ alert(e.msg);
637
+ }
638
+ }
639
+ else {
640
+ Player = window.ZWPlayer;
641
+ }
642
+ */
643
+
644
+
645
+ /* harmony default export */ var sources = (ZwModule);
646
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
647
+
648
+
649
+ /* harmony default export */ var entry_lib = (sources);
650
+
651
+
652
+ }();
653
+ module.exports = __webpack_exports__;
654
+ /******/ })()
655
+ ;
656
+ //# sourceMappingURL=zwplayervue2.common.js.map
@@ -0,0 +1,667 @@
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
+ Player: function() { return /* reexport */ Player; },
153
+ "default": function() { return /* binding */ entry_lib; },
154
+ zwplayer: function() { return /* reexport */ vueplayer; }
155
+ });
156
+
157
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
158
+ /* eslint-disable no-var */
159
+ // This file is imported into lib/wc client bundles.
160
+
161
+ if (typeof window !== 'undefined') {
162
+ var currentScript = window.document.currentScript
163
+ if (false) { var getCurrentScript; }
164
+
165
+ var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
166
+ if (src) {
167
+ __webpack_require__.p = src[1] // eslint-disable-line
168
+ }
169
+ }
170
+
171
+ // Indicate to webpack that this file can be concatenated
172
+ /* harmony default export */ var setPublicPath = (null);
173
+
174
+ // EXTERNAL MODULE: ./sources/vueplayer/src/loadjs.js
175
+ var loadjs = __webpack_require__(15);
176
+ ;// 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
177
+ // import { h } from 'vue'
178
+
179
+ const zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
180
+ const availabe_props = {
181
+ isLive: 'boolean',
182
+ useOldFlv: 'boolean',
183
+ useFlv: 'boolean',
184
+ streamtype: 'string',
185
+ hasAudio: 'boolean',
186
+ hasVideo: 'boolean',
187
+ xmc_url: 'string',
188
+ fixedControlbar: 'boolean',
189
+ nativecontrols: 'boolean',
190
+ infoButton: 'boolean',
191
+ speedButton: 'boolean',
192
+ optionButton: 'boolean',
193
+ snapshotButton: 'boolean',
194
+ chapterButton: 'boolean',
195
+ enableDanmu: 'boolean',
196
+ useProgressTooltip: 'boolean',
197
+ hidePlayBtn: 'boolean',
198
+ disablePlayBtn: 'boolean',
199
+ disableSeek: 'boolean',
200
+ disableFullscreenWin: 'boolean',
201
+ disablePicInPic: 'boolean',
202
+ disableVolumeControl: 'boolean',
203
+ lostFocusPause: 'boolean',
204
+ autoSmallWindow: 'boolean',
205
+ thumbnails: 'object',
206
+ sendDanmu: 'function',
207
+ danmuBarId: 'string',
208
+ fluid: 'boolean'
209
+ };
210
+ /* harmony default export */ var mainvue_type_script_lang_js = ({
211
+ name: 'ZwPlayer',
212
+ data() {
213
+ return {
214
+ zwplayer: null,
215
+ nodename: 'ZwPlayer'
216
+ };
217
+ },
218
+ props: {
219
+ zwplayerlib: String,
220
+ murl: String,
221
+ nodeid: String,
222
+ muted: Boolean,
223
+ autoplay: {
224
+ type: Boolean,
225
+ default: true
226
+ },
227
+ videoprop: Object,
228
+ videostyle: String,
229
+ reconnect: {
230
+ type: Boolean,
231
+ default: true
232
+ },
233
+ controlbar: {
234
+ type: Boolean,
235
+ default: true
236
+ },
237
+ useProgressTooltip: {
238
+ type: Boolean,
239
+ default: true
240
+ }
241
+ },
242
+ emits: ['oneterror', 'onmediaevent', 'onready'],
243
+ methods: {
244
+ play(url, isLive, useOldFlv) {
245
+ let vm = this;
246
+ if (!url) url = this.murl;
247
+ if (!vm.zwplayer) return;
248
+ vm.zwplayer.play(url, isLive, useOldFlv);
249
+ },
250
+ stop() {
251
+ let vm = this;
252
+ if (vm.zwplayer) {
253
+ vm.zwplayer.stop();
254
+ }
255
+ },
256
+ pause() {
257
+ let vm = this;
258
+ if (vm.zwplayer) {
259
+ vm.zwplayer.pause();
260
+ }
261
+ },
262
+ resume() {
263
+ let vm = this;
264
+ if (vm.zwplayer) {
265
+ vm.zwplayer.resume();
266
+ }
267
+ },
268
+ getDuration() {
269
+ let vm = this;
270
+ if (vm.zwplayer) {
271
+ return vm.zwplayer.getDuration();
272
+ }
273
+ return undefined;
274
+ },
275
+ getCurrentTime() {
276
+ let vm = this;
277
+ if (vm.zwplayer) {
278
+ return vm.zwplayer.CurrentTime;
279
+ }
280
+ return undefined;
281
+ },
282
+ seekTime(time) {
283
+ let vm = this;
284
+ if (vm.zwplayer) {
285
+ vm.zwplayer.seekTime(time);
286
+ }
287
+ },
288
+ destroy() {
289
+ let vm = this;
290
+ if (vm.zwplayer) {
291
+ vm.zwplayer.destroy();
292
+ }
293
+ },
294
+ setplaystate(bPlaying) {
295
+ let vm = this;
296
+ if (vm.zwplayer) {
297
+ vm.zwplayer.setplaystate(bPlaying);
298
+ }
299
+ },
300
+ setEnableDanmu(bEnable) {
301
+ let vm = this;
302
+ if (vm.zwplayer) {
303
+ vm.zwplayer.setEnableDanmu(bEnable);
304
+ }
305
+ },
306
+ appendDanmu(msgObj, setting) {
307
+ let vm = this;
308
+ if (vm.zwplayer) {
309
+ vm.zwplayer.appendDanmu(msgObj, setting);
310
+ }
311
+ },
312
+ setChapters(chapters) {
313
+ let vm = this;
314
+ if (vm.zwplayer) {
315
+ vm.zwplayer.setChapters(chapters);
316
+ }
317
+ },
318
+ addSubtitle(subtitleUrl, pos, title) {
319
+ let vm = this;
320
+ if (vm.zwplayer) {
321
+ vm.zwplayer.addSubtitle(subtitleUrl, pos, title);
322
+ }
323
+ },
324
+ removeSubtitle() {
325
+ let vm = this;
326
+ if (vm.zwplayer) {
327
+ vm.zwplayer.removeSubtitle();
328
+ }
329
+ },
330
+ buildDanmuControlbar(parentId, className) {
331
+ let vm = this;
332
+ if (vm.zwplayer) {
333
+ vm.zwplayer.buildDanmuControlbar(parentId, className);
334
+ }
335
+ },
336
+ notifyResize(width, height) {
337
+ let vm = this;
338
+ if (vm.zwplayer) {
339
+ vm.zwplayer.notifyResize(width, height);
340
+ }
341
+ },
342
+ setMute(bMute) {
343
+ let vm = this;
344
+ if (vm.zwplayer) {
345
+ vm.zwplayer.setMuted(bMute);
346
+ }
347
+ },
348
+ setullscr(bFullScr) {
349
+ let vm = this;
350
+ if (vm.zwplayer) {
351
+ vm.is_fullscr = bFullScr;
352
+ vm.zwplayer.setFullscreen(bFullScr);
353
+ }
354
+ }
355
+ },
356
+ computed: {
357
+ CurrentTime: function () {
358
+ let vm = this;
359
+ if (vm.zwplayer) {
360
+ return vm.zwplayer.CurrentTime;
361
+ }
362
+ return -1;
363
+ }
364
+ },
365
+ render(createElement) {
366
+ let playerid;
367
+
368
+ // console.log('render');
369
+ if (this.nodeid) {
370
+ playerid = this.nodeid;
371
+ } else {
372
+ let now = new Date().getTime();
373
+ if (!window.nextZWPlayerId) {
374
+ window.nextZWPlayerId = 1000;
375
+ } else {
376
+ window.nextZWPlayerId++;
377
+ }
378
+ playerid = 'zwplayer-' + window.nextZWPlayerId + '-' + now;
379
+ }
380
+ let playerWrap = createElement('div', {
381
+ class: {
382
+ 'zwplayer-vue': true
383
+ },
384
+ attrs: {
385
+ id: playerid
386
+ }
387
+ }, []);
388
+ if (playerWrap) {
389
+ let vm = this;
390
+ vm.playerid = playerid;
391
+ }
392
+ if (this.zwplayer && this.murl !== this.old_murl) {
393
+ this.zwplayer.play(this.murl); // change movie url
394
+ this.old_murl = this.murl;
395
+ }
396
+ return playerWrap;
397
+ },
398
+ mounted() {
399
+ let vm = this;
400
+ // console.log('mounted');
401
+ let zwplayer_js;
402
+ if (vm.zwplayerlib) zwplayer_js = vm.zwplayerlib;else zwplayer_js = zwplayer_js_def;
403
+ vm.rootElm = document.getElementById(vm.playerid);
404
+ if (vm.rootElm) {
405
+ vm.rootElm.style.width = '100%';
406
+ vm.rootElm.style.height = '100%';
407
+ vm.rootElm.style.margin = '0';
408
+ vm.rootElm.style.padding = '0';
409
+ }
410
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', zwplayer_js, function (jsid) {
411
+ let url = '';
412
+ if (!jsid) {
413
+ console.log('zwplayer_loadjs failed!');
414
+ }
415
+ if (vm.murl) url = vm.murl;else if (vm.videoprop && typeof vm.videoprop.url !== 'undefined') url = vm.videoprop.url;
416
+ let videostyle = "width:100%;height:100%;";
417
+ if (vm.videoprop && typeof vm.videoprop.videostyle !== 'undefined') videostyle = vm.videoprop.videostyle;
418
+ let params = {
419
+ url: url,
420
+ playerElm: vm.rootElm,
421
+ videostyle: videostyle,
422
+ reconnect: vm.reconnect,
423
+ autoplay: vm.autoplay,
424
+ muted: vm.muted,
425
+ controlbar: vm.controlbar,
426
+ useProgressTooltip: vm.useProgressTooltip,
427
+ onready: function () {
428
+ vm.$emit('onready', this);
429
+ },
430
+ onnetclose: function () {
431
+ vm.$emit('onnetclose', this);
432
+ return true;
433
+ },
434
+ onneterror: function () {
435
+ vm.$emit('onneterror', this);
436
+ },
437
+ onmediaevent: function (event) {
438
+ vm.$emit('onmediaevent', event, this);
439
+ }
440
+ };
441
+ let props_list = availabe_props;
442
+ for (let prop in vm.$attrs) {
443
+ if (prop in props_list && typeof vm.$attrs[prop] === props_list[prop]) {
444
+ if (typeof vm.$attrs[prop] === 'object') params[prop] = JSON.parse(JSON.stringify(vm.$attrs[prop]));else params[prop] = vm.$attrs[prop];
445
+ }
446
+ }
447
+ vm.zwplayer = new window.ZWPlayer(params);
448
+ if (params.danmuBarId) {
449
+ vm.zwplayer.buildDanmuControlbar(params.danmuBarId, 'vue-zwp-danmubar');
450
+ }
451
+ vm.old_murl = url;
452
+ });
453
+ },
454
+ beforeDestroy() {
455
+ // vue3.x beforeUnmount
456
+ let vm = this;
457
+ // console.log('beforeUnmount');
458
+ if (vm.zwplayer) {
459
+ vm.zwplayer.stop();
460
+ }
461
+ },
462
+ destroyed() {
463
+ // vue3.x unmounted
464
+ let vm = this;
465
+ // console.log('unmounted');
466
+ if (vm.zwplayer) {
467
+ vm.zwplayer.destroy();
468
+ delete vm.zwplayer;
469
+ }
470
+ }
471
+ });
472
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue?vue&type=script&lang=js
473
+ /* harmony default export */ var src_mainvue_type_script_lang_js = (mainvue_type_script_lang_js);
474
+ ;// CONCATENATED MODULE: ./node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js
475
+ /* globals __VUE_SSR_CONTEXT__ */
476
+
477
+ // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
478
+ // This module is a runtime utility for cleaner component module output and will
479
+ // be included in the final webpack user bundle.
480
+
481
+ function normalizeComponent(
482
+ scriptExports,
483
+ render,
484
+ staticRenderFns,
485
+ functionalTemplate,
486
+ injectStyles,
487
+ scopeId,
488
+ moduleIdentifier /* server only */,
489
+ shadowMode /* vue-cli only */
490
+ ) {
491
+ // Vue.extend constructor export interop
492
+ var options =
493
+ typeof scriptExports === 'function' ? scriptExports.options : scriptExports
494
+
495
+ // render functions
496
+ if (render) {
497
+ options.render = render
498
+ options.staticRenderFns = staticRenderFns
499
+ options._compiled = true
500
+ }
501
+
502
+ // functional template
503
+ if (functionalTemplate) {
504
+ options.functional = true
505
+ }
506
+
507
+ // scopedId
508
+ if (scopeId) {
509
+ options._scopeId = 'data-v-' + scopeId
510
+ }
511
+
512
+ var hook
513
+ if (moduleIdentifier) {
514
+ // server build
515
+ hook = function (context) {
516
+ // 2.3 injection
517
+ context =
518
+ context || // cached call
519
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
520
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
521
+ // 2.2 with runInNewContext: true
522
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
523
+ context = __VUE_SSR_CONTEXT__
524
+ }
525
+ // inject component styles
526
+ if (injectStyles) {
527
+ injectStyles.call(this, context)
528
+ }
529
+ // register component module identifier for async chunk inferrence
530
+ if (context && context._registeredComponents) {
531
+ context._registeredComponents.add(moduleIdentifier)
532
+ }
533
+ }
534
+ // used by ssr in case component is cached and beforeCreate
535
+ // never gets called
536
+ options._ssrRegister = hook
537
+ } else if (injectStyles) {
538
+ hook = shadowMode
539
+ ? function () {
540
+ injectStyles.call(
541
+ this,
542
+ (options.functional ? this.parent : this).$root.$options.shadowRoot
543
+ )
544
+ }
545
+ : injectStyles
546
+ }
547
+
548
+ if (hook) {
549
+ if (options.functional) {
550
+ // for template-only hot-reload because in that case the render fn doesn't
551
+ // go through the normalizer
552
+ options._injectStyles = hook
553
+ // register for functional component in vue file
554
+ var originalRender = options.render
555
+ options.render = function renderWithStyleInjection(h, context) {
556
+ hook.call(context)
557
+ return originalRender(h, context)
558
+ }
559
+ } else {
560
+ // inject component registration as beforeCreate hook
561
+ var existing = options.beforeCreate
562
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
563
+ }
564
+ }
565
+
566
+ return {
567
+ exports: scriptExports,
568
+ options: options
569
+ }
570
+ }
571
+
572
+ ;// CONCATENATED MODULE: ./sources/vueplayer/src/main.vue
573
+ var render, staticRenderFns
574
+ ;
575
+
576
+
577
+
578
+ /* normalize component */
579
+ ;
580
+ var component = normalizeComponent(
581
+ src_mainvue_type_script_lang_js,
582
+ render,
583
+ staticRenderFns,
584
+ false,
585
+ null,
586
+ null,
587
+ null
588
+
589
+ )
590
+
591
+ /* harmony default export */ var main = (component.exports);
592
+ ;// CONCATENATED MODULE: ./sources/vueplayer/index.js
593
+ //export defines
594
+
595
+
596
+ /* istanbul ignore next */
597
+ main.install = function (Vue) {
598
+ Vue.component(main.name, main); //
599
+ Vue.component('zero-web-player', main);
600
+ Vue.component('zero-player', main);
601
+ Vue.component('ZPlayer', main);
602
+ };
603
+ /* harmony default export */ var vueplayer = (main);
604
+ ;// CONCATENATED MODULE: ./sources/index.js
605
+ // 引入该目录下所有的组件
606
+
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
+ const sources_zwplayer_js_def = 'zwplayer/zwplayer.js?v=3.6';
619
+ const Player = function (param) {
620
+ (0,loadjs/* zwplayer_loadjs */.l)('zwplayer-core', sources_zwplayer_js_def, function (jsid) {
621
+ if (jsid) {
622
+ console.log(typeof param);
623
+ console.log('Player param zwplayer_loadjs:', jsid);
624
+ } else {
625
+ console.log('Load zwplayer library failed.');
626
+ }
627
+ });
628
+ };
629
+ /*
630
+ if (typeof window.ZWPlayer === 'undefined') {
631
+ const loadTask = new Promise(function(resolve, reject) {
632
+ zwplayer_loadjs('zwplayer-core', zwplayer_js_def, function(jsid) {
633
+ if (jsid) {
634
+ resolve(window.ZWPlayer);
635
+ }
636
+ else {
637
+ reject('Load zwplayer library failed.');
638
+ }
639
+ });
640
+ });
641
+
642
+ try {
643
+ Player = await loadTask;
644
+ }
645
+ catch(e) {
646
+ alert(e.msg);
647
+ }
648
+ }
649
+ else {
650
+ Player = window.ZWPlayer;
651
+ }
652
+ */
653
+
654
+
655
+ /* harmony default export */ var sources = (ZwModule);
656
+ ;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
657
+
658
+
659
+ /* harmony default export */ var entry_lib = (sources);
660
+
661
+
662
+ }();
663
+ /******/ return __webpack_exports__;
664
+ /******/ })()
665
+ ;
666
+ });
667
+ //# 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,{Player:function(){return b},default:function(){return v},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)}},p=u;function d(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 p=u.render;u.render=function(e,t){return s.call(t),p(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,s):[s]}return{exports:e,options:u}}var y=d(p,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);const h="zwplayer/zwplayer.js?v=3.6",b=function(e){(0,r.l)("zwplayer-core",h,(function(t){t?(console.log(typeof e),console.log("Player param zwplayer_loadjs:",t)):console.log("Load zwplayer library failed.")}))};var z=w,v=z}(),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.15",
3
+ "version": "1.0.16",
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
@@ -23,7 +23,7 @@ const Player = function(param) {
23
23
  zwplayer_loadjs('zwplayer-core', zwplayer_js_def, function(jsid) {
24
24
  if (jsid) {
25
25
  console.log(typeof param);
26
- console.log('Player param zwplayer_loadjs:', jsid);;
26
+ console.log('Player param zwplayer_loadjs:', jsid);
27
27
  }
28
28
  else {
29
29
  console.log('Load zwplayer library failed.');