@quasar/quasar-ui-qmediaplayer 2.0.0-beta.2 → 2.0.0-beta.3
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/dist/icon-set/bootstrap-icons.umd.js +1 -1
- package/dist/icon-set/eva-icons.umd.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.js +1 -1
- package/dist/icon-set/ionicons-v5.umd.js +1 -1
- package/dist/icon-set/line-awesome.umd.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.js +1 -1
- package/dist/icon-set/material-icons-round.umd.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.js +1 -1
- package/dist/icon-set/material-icons.umd.js +1 -1
- package/dist/icon-set/mdi-v3.umd.js +1 -1
- package/dist/icon-set/mdi-v4.umd.js +1 -1
- package/dist/icon-set/mdi-v5.umd.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.js +1 -1
- package/dist/icon-set/svg-mdi-v4.umd.js +1 -1
- package/dist/icon-set/svg-mdi-v5.umd.js +1 -1
- package/dist/icon-set/svg-themify.umd.js +1 -1
- package/dist/icon-set/themify.umd.js +1 -1
- package/dist/index.common.js +69 -47
- package/dist/index.common.min.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.esm.js +69 -47
- package/dist/index.esm.min.js +2 -2
- package/dist/index.min.css +1 -1
- package/dist/index.rtl.css +1 -1
- package/dist/index.rtl.min.css +1 -1
- package/dist/index.umd.js +69 -47
- package/dist/index.umd.min.js +2 -2
- package/dist/lang/ar.umd.js +1 -1
- package/dist/lang/az-Latn.umd.js +1 -1
- package/dist/lang/bg.umd.js +1 -1
- package/dist/lang/bn.umd.js +1 -1
- package/dist/lang/ca.umd.js +1 -1
- package/dist/lang/cs.umd.js +1 -1
- package/dist/lang/da.umd.js +1 -1
- package/dist/lang/de.umd.js +1 -1
- package/dist/lang/el.umd.js +1 -1
- package/dist/lang/en-GB.umd.js +1 -1
- package/dist/lang/en-US.umd.js +1 -1
- package/dist/lang/eo.umd.js +1 -1
- package/dist/lang/es.umd.js +1 -1
- package/dist/lang/et.umd.js +1 -1
- package/dist/lang/fa-IR.umd.js +1 -1
- package/dist/lang/fa.umd.js +1 -1
- package/dist/lang/fi.umd.js +1 -1
- package/dist/lang/fr.umd.js +1 -1
- package/dist/lang/gn.umd.js +1 -1
- package/dist/lang/he.umd.js +1 -1
- package/dist/lang/hr.umd.js +1 -1
- package/dist/lang/hu.umd.js +1 -1
- package/dist/lang/id.umd.js +1 -1
- package/dist/lang/is.umd.js +1 -1
- package/dist/lang/it.umd.js +1 -1
- package/dist/lang/ja.umd.js +1 -1
- package/dist/lang/km.umd.js +1 -1
- package/dist/lang/ko-KR.umd.js +1 -1
- package/dist/lang/kur-CKB.umd.js +1 -1
- package/dist/lang/lt.umd.js +1 -1
- package/dist/lang/lu.umd.js +1 -1
- package/dist/lang/lv.umd.js +1 -1
- package/dist/lang/ml.umd.js +1 -1
- package/dist/lang/ms.umd.js +1 -1
- package/dist/lang/nb-NO.umd.js +1 -1
- package/dist/lang/nl.umd.js +1 -1
- package/dist/lang/pl.umd.js +1 -1
- package/dist/lang/pt-BR.umd.js +1 -1
- package/dist/lang/pt.umd.js +1 -1
- package/dist/lang/ro.umd.js +1 -1
- package/dist/lang/ru.umd.js +1 -1
- package/dist/lang/sk.umd.js +1 -1
- package/dist/lang/sl.umd.js +1 -1
- package/dist/lang/sr-CYR.umd.js +1 -1
- package/dist/lang/sr.umd.js +1 -1
- package/dist/lang/sv.umd.js +1 -1
- package/dist/lang/ta.umd.js +1 -1
- package/dist/lang/th.umd.js +1 -1
- package/dist/lang/tr.umd.js +1 -1
- package/dist/lang/ug.umd.js +1 -1
- package/dist/lang/uk.umd.js +1 -1
- package/dist/lang/vi.umd.js +1 -1
- package/dist/lang/zh-CN.umd.js +1 -1
- package/dist/lang/zh-TW.umd.js +1 -1
- package/package.json +2 -2
- package/src/components/QMediaPlayer.js +67 -45
- package/src/version.js +1 -1
package/dist/index.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @quasar/quasar-ui-qmediaplayer v2.0.0-beta.
|
|
2
|
+
* @quasar/quasar-ui-qmediaplayer v2.0.0-beta.3
|
|
3
3
|
* (c) 2021 Jeff Galbraith <jeff@quasar.dev>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -18,13 +18,6 @@ function hSlot (slot, otherwise) {
|
|
|
18
18
|
: otherwise
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const getMousePosition = function (e, type = 'x') {
|
|
22
|
-
if (type === 'x') {
|
|
23
|
-
return e.pageX
|
|
24
|
-
}
|
|
25
|
-
return e.pageY
|
|
26
|
-
};
|
|
27
|
-
|
|
28
21
|
const padTime = (val) => {
|
|
29
22
|
val = Math.floor(val);
|
|
30
23
|
if (val < 10) {
|
|
@@ -118,7 +111,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
118
111
|
},
|
|
119
112
|
controlsDisplayTime: {
|
|
120
113
|
type: Number,
|
|
121
|
-
default:
|
|
114
|
+
default: 4000
|
|
122
115
|
},
|
|
123
116
|
playbackRates: Array,
|
|
124
117
|
// initial playback rate
|
|
@@ -188,6 +181,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
188
181
|
errorText: null,
|
|
189
182
|
controls: false,
|
|
190
183
|
showControls: true,
|
|
184
|
+
inControls: false,
|
|
191
185
|
volume: 60,
|
|
192
186
|
muted: false,
|
|
193
187
|
currentTime: 0.01,
|
|
@@ -468,12 +462,15 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
468
462
|
}
|
|
469
463
|
});
|
|
470
464
|
|
|
465
|
+
// watch(() => state.inControls, (val) => {
|
|
466
|
+
// console.log('inControls:', val)
|
|
467
|
+
// })
|
|
468
|
+
|
|
471
469
|
vue.onBeforeMount(() => {
|
|
472
470
|
canRender.value = window !== undefined; // SSR
|
|
473
471
|
if (canRender.value === true) {
|
|
474
472
|
__setupLang();
|
|
475
473
|
__setupIcons();
|
|
476
|
-
document.body.addEventListener('mousemove', __mouseMoveAction, false);
|
|
477
474
|
}
|
|
478
475
|
});
|
|
479
476
|
|
|
@@ -485,8 +482,6 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
485
482
|
// make sure noScroll is not left in unintended state
|
|
486
483
|
document.body.classList.remove('no-scroll');
|
|
487
484
|
|
|
488
|
-
document.body.removeEventListener('mousemove', __mouseMoveAction);
|
|
489
|
-
|
|
490
485
|
__removeSourceEventListeners();
|
|
491
486
|
__removeMediaEventListeners();
|
|
492
487
|
|
|
@@ -515,28 +510,37 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
515
510
|
}
|
|
516
511
|
else {
|
|
517
512
|
/* eslint-disable-next-line no-console */
|
|
518
|
-
console.error('QMediaPlayer: loadFileBlob method requires a FileList');
|
|
513
|
+
console.error('[QMediaPlayer]: loadFileBlob method requires a FileList');
|
|
519
514
|
}
|
|
520
515
|
}
|
|
521
516
|
return false
|
|
522
517
|
}
|
|
523
518
|
|
|
524
519
|
function showControls () {
|
|
520
|
+
// no controls - always off
|
|
521
|
+
if (state.noControls) {
|
|
522
|
+
state.showControls = false;
|
|
523
|
+
return
|
|
524
|
+
}
|
|
525
|
+
// bottom controls - always on
|
|
525
526
|
if (state.bottomControls) {
|
|
527
|
+
state.showControls = true;
|
|
526
528
|
return
|
|
527
529
|
}
|
|
530
|
+
// kill timer, if there is one
|
|
528
531
|
if (timer.hideControlsTimer) {
|
|
529
532
|
clearTimeout(timer.hideControlsTimer);
|
|
530
533
|
timer.hideControlsTimer = null;
|
|
531
534
|
}
|
|
532
|
-
|
|
533
|
-
return
|
|
534
|
-
}
|
|
535
|
+
// show controls
|
|
535
536
|
state.showControls = true;
|
|
537
|
+
// check if hide cursor (fullscreen)
|
|
536
538
|
__checkCursor();
|
|
539
|
+
// set the timer
|
|
537
540
|
if (props.controlsDisplayTime !== -1 && !props.mobileMode && __isVideo.value) {
|
|
538
541
|
timer.hideControlsTimer = setTimeout(() => {
|
|
539
|
-
if
|
|
542
|
+
// hide controls, but not if menu is showing
|
|
543
|
+
if (!__showingMenu() && state.inControls !== true) {
|
|
540
544
|
state.showControls = false;
|
|
541
545
|
timer.hideControlsTimer = null;
|
|
542
546
|
__checkCursor();
|
|
@@ -544,14 +548,24 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
544
548
|
else {
|
|
545
549
|
showControls();
|
|
546
550
|
}
|
|
551
|
+
// user configured display time (in ms)
|
|
547
552
|
}, props.controlsDisplayTime);
|
|
548
553
|
}
|
|
549
554
|
}
|
|
550
555
|
|
|
551
556
|
function hideControls () {
|
|
557
|
+
if (state.inControls) return
|
|
558
|
+
// no controls - always off
|
|
559
|
+
if (state.noControls) {
|
|
560
|
+
state.showControls = false;
|
|
561
|
+
return
|
|
562
|
+
}
|
|
563
|
+
// bottom controls - always on
|
|
552
564
|
if (state.bottomControls) {
|
|
565
|
+
state.showControls = true;
|
|
553
566
|
return
|
|
554
567
|
}
|
|
568
|
+
// clear timer if there is one
|
|
555
569
|
if (timer.hideControlsTimer) {
|
|
556
570
|
clearTimeout(timer.hideControlsTimer);
|
|
557
571
|
}
|
|
@@ -800,9 +814,9 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
800
814
|
}
|
|
801
815
|
else {
|
|
802
816
|
/* eslint-disable-next-line no-console */
|
|
803
|
-
console.error(`QMediaPlayer: no language loaded called '${ lang }'`);
|
|
817
|
+
console.error(`[QMediaPlayer]: no language loaded called '${ lang }'`);
|
|
804
818
|
/* eslint-disable-next-line no-console */
|
|
805
|
-
console.error('Be sure to load the UMD version of the language in a script tag before using with UMD');
|
|
819
|
+
console.error('[QMediaPlayer]: Be sure to load the UMD version of the language in a script tag before using with UMD');
|
|
806
820
|
}
|
|
807
821
|
}
|
|
808
822
|
else {
|
|
@@ -811,7 +825,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
811
825
|
}
|
|
812
826
|
catch (e) {
|
|
813
827
|
/* eslint-disable-next-line no-console */
|
|
814
|
-
console.error(`QMediaPlayer: cannot find language file called '${ lang }'`);
|
|
828
|
+
console.error(`[QMediaPlayer]: cannot find language file called '${ lang }'`);
|
|
815
829
|
}
|
|
816
830
|
}
|
|
817
831
|
}
|
|
@@ -840,9 +854,9 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
840
854
|
}
|
|
841
855
|
else {
|
|
842
856
|
/* eslint-disable-next-line no-console */
|
|
843
|
-
console.error(`QMediaPlayer: no icon set loaded called '${ set }'`);
|
|
857
|
+
console.error(`[QMediaPlayer]: no icon set loaded called '${ set }'`);
|
|
844
858
|
/* eslint-disable-next-line no-console */
|
|
845
|
-
console.error('Be sure to load the UMD version of the icon set in a script tag before using with UMD');
|
|
859
|
+
console.error('[QMediaPlayer]:Be sure to load the UMD version of the icon set in a script tag before using with UMD');
|
|
846
860
|
}
|
|
847
861
|
}
|
|
848
862
|
else {
|
|
@@ -851,7 +865,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
851
865
|
}
|
|
852
866
|
catch (e) {
|
|
853
867
|
/* eslint-disable-next-line no-console */
|
|
854
|
-
console.error(`QMediaPlayer: cannot find icon set file called '${ set }'`);
|
|
868
|
+
console.error(`[QMediaPlayer]: cannot find icon set file called '${ set }'`);
|
|
855
869
|
}
|
|
856
870
|
}
|
|
857
871
|
}
|
|
@@ -939,7 +953,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
939
953
|
else if (event.type === 'canplay') {
|
|
940
954
|
state.playReady = true;
|
|
941
955
|
state.displayTime = timeParse($media.value.currentTime);
|
|
942
|
-
|
|
956
|
+
showControls();
|
|
943
957
|
emit('ready');
|
|
944
958
|
}
|
|
945
959
|
else if (event.type === 'canplaythrough') {
|
|
@@ -1075,7 +1089,6 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1075
1089
|
if (props.mobileMode !== true) {
|
|
1076
1090
|
togglePlay();
|
|
1077
1091
|
}
|
|
1078
|
-
toggleControls();
|
|
1079
1092
|
}
|
|
1080
1093
|
|
|
1081
1094
|
function __bigButtonClick (e) {
|
|
@@ -1090,15 +1103,11 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1090
1103
|
settingsMenuVisible.value = val;
|
|
1091
1104
|
}
|
|
1092
1105
|
|
|
1093
|
-
function __mouseEnterVideo (e) {
|
|
1094
|
-
if (!props.bottomControls && !props.mobileMode && !__isAudio.value) {
|
|
1095
|
-
showControls();
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
1106
|
function __mouseLeaveVideo (e) {
|
|
1100
|
-
if (
|
|
1101
|
-
|
|
1107
|
+
if (e.relatedTarget && e.relatedTarget.className === 'q-pa-md') {
|
|
1108
|
+
if (!props.bottomControls && !props.mobileMode && !__isAudio.value && state.inControls !== true) {
|
|
1109
|
+
hideControls();
|
|
1110
|
+
}
|
|
1102
1111
|
}
|
|
1103
1112
|
}
|
|
1104
1113
|
|
|
@@ -1108,21 +1117,25 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1108
1117
|
}
|
|
1109
1118
|
}
|
|
1110
1119
|
|
|
1120
|
+
function __getParentEl (el, className) {
|
|
1121
|
+
if (!el) return null
|
|
1122
|
+
if (el.className.startsWith(className)) {
|
|
1123
|
+
return el
|
|
1124
|
+
}
|
|
1125
|
+
return __getParentEl(el.offsetParent, className)
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1111
1128
|
function __showControlsIfValid (e) {
|
|
1112
|
-
|
|
1129
|
+
const pos = $media.value.getBoundingClientRect();
|
|
1130
|
+
const el = __getParentEl(e.target, 'q-media');
|
|
1131
|
+
if (!el) return
|
|
1132
|
+
var rect = el.getBoundingClientRect();
|
|
1133
|
+
if (!pos || !rect) return false
|
|
1134
|
+
if (rect.left === pos.left && rect.top === pos.top && rect.height === pos.height && rect.width === pos.width) {
|
|
1113
1135
|
showControls();
|
|
1114
1136
|
return true
|
|
1115
1137
|
}
|
|
1116
|
-
|
|
1117
|
-
const y = getMousePosition(e, 'y');
|
|
1118
|
-
const pos = $media.value.getBoundingClientRect();
|
|
1119
|
-
if (!pos) return false
|
|
1120
|
-
if (x > pos.left && x < pos.left + pos.width) {
|
|
1121
|
-
if (y > pos.top + pos.height - (props.dense ? 40 : 80) && y < pos.top + pos.height) {
|
|
1122
|
-
showControls();
|
|
1123
|
-
return true
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1138
|
+
|
|
1126
1139
|
return false
|
|
1127
1140
|
}
|
|
1128
1141
|
|
|
@@ -1306,6 +1319,14 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1306
1319
|
return '50%'
|
|
1307
1320
|
}
|
|
1308
1321
|
|
|
1322
|
+
function __mouseEnterControls () {
|
|
1323
|
+
state.inControls = true;
|
|
1324
|
+
}
|
|
1325
|
+
function __mouseLeaveControls () {
|
|
1326
|
+
state.inControls = false;
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
|
|
1309
1330
|
// Rendering Methods
|
|
1310
1331
|
|
|
1311
1332
|
function __renderVideo () {
|
|
@@ -1460,7 +1481,9 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1460
1481
|
const slot = slots.controls;
|
|
1461
1482
|
|
|
1462
1483
|
const events = {
|
|
1463
|
-
onClick: __stopAndPrevent
|
|
1484
|
+
onClick: __stopAndPrevent,
|
|
1485
|
+
onMouseenter: __mouseEnterControls,
|
|
1486
|
+
onMouseleave: __mouseLeaveControls,
|
|
1464
1487
|
};
|
|
1465
1488
|
|
|
1466
1489
|
if (slot) {
|
|
@@ -1928,7 +1951,6 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1928
1951
|
function __renderMediaPlayer () {
|
|
1929
1952
|
const events = {
|
|
1930
1953
|
onMousemove: __mouseMoveAction,
|
|
1931
|
-
onMouseenter: __mouseEnterVideo,
|
|
1932
1954
|
onMouseleave: __mouseLeaveVideo,
|
|
1933
1955
|
onClick: __videoClick
|
|
1934
1956
|
};
|
|
@@ -1983,7 +2005,7 @@ var QMediaPlayer = vue.defineComponent({
|
|
|
1983
2005
|
}
|
|
1984
2006
|
});
|
|
1985
2007
|
|
|
1986
|
-
const version = '2.0.0-beta.
|
|
2008
|
+
const version = '2.0.0-beta.3';
|
|
1987
2009
|
|
|
1988
2010
|
var Plugin = {
|
|
1989
2011
|
version,
|