@tarojs/components 3.4.7 → 3.4.8
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/cjs/index-47a1959e.js +34 -0
- package/dist/{esm/index-3c78bcaf.js → cjs/index-dffbd352.js} +12 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-navigator-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-view-column-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +1 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +2 -2
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +2 -2
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/cjs/taro-text-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-video-control_3.cjs.entry.js +27858 -220
- package/dist/cjs/taro-view-core.cjs.entry.js +1 -1
- package/dist/collection/components/video/utils.js +96 -109
- package/dist/collection/components/video/video-control.js +6 -6
- package/dist/collection/components/video/video.js +48 -7
- package/dist/collection/utils/index.js +16 -16
- package/dist/esm/index-cad8203e.js +31 -0
- package/dist/{cjs/index-b9715722.js → esm/index-cd1a2d33.js} +6 -2
- package/dist/esm/taro-button-core.entry.js +1 -1
- package/dist/esm/taro-cover-view-core.entry.js +1 -1
- package/dist/esm/taro-icon-core.entry.js +1 -1
- package/dist/esm/taro-image-core.entry.js +1 -1
- package/dist/esm/taro-navigator-core.entry.js +1 -1
- package/dist/esm/taro-picker-core_2.entry.js +1 -1
- package/dist/esm/taro-picker-view-column-core.entry.js +1 -1
- package/dist/esm/taro-picker-view-core.entry.js +1 -1
- package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm/taro-scroll-view-core.entry.js +2 -2
- package/dist/esm/taro-swiper-core_2.entry.js +2 -2
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm/taro-text-core.entry.js +1 -1
- package/dist/esm/taro-video-control_3.entry.js +27857 -219
- package/dist/esm/taro-view-core.entry.js +1 -1
- package/dist/esm-es5/index-cad8203e.js +1 -0
- package/dist/esm-es5/index-cd1a2d33.js +7 -0
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-icon-core.entry.js +1 -1
- package/dist/esm-es5/taro-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-column-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +365 -1
- package/dist/esm-es5/taro-view-core.entry.js +1 -1
- package/dist/taro-components/p-00089605.entry.js +365 -0
- package/dist/taro-components/{p-d91ab597.system.entry.js → p-03eb37e5.system.entry.js} +1 -1
- package/dist/taro-components/{p-4039bcb5.entry.js → p-26bdffd7.entry.js} +1 -1
- package/dist/taro-components/{p-fc4939c6.system.entry.js → p-288b38f9.system.entry.js} +1 -1
- package/dist/taro-components/{p-1c625d7d.entry.js → p-2d066d28.entry.js} +1 -1
- package/dist/taro-components/{p-2d2f8064.entry.js → p-33c5efb5.entry.js} +1 -1
- package/dist/taro-components/p-33ee636a.system.js +1 -1
- package/dist/taro-components/{p-c5a86c19.system.entry.js → p-3593c5f1.system.entry.js} +1 -1
- package/dist/taro-components/{p-34188530.system.entry.js → p-3aad572a.system.entry.js} +1 -1
- package/dist/taro-components/{p-da8edf69.system.entry.js → p-3fa99b92.system.entry.js} +1 -1
- package/dist/taro-components/{p-74540410.entry.js → p-42eb4f16.entry.js} +1 -1
- package/dist/taro-components/{p-758fb1ba.entry.js → p-431080b8.entry.js} +1 -1
- package/dist/taro-components/{p-17039974.system.entry.js → p-50be38a1.system.entry.js} +1 -1
- package/dist/taro-components/p-51401bdc.entry.js +1 -0
- package/dist/taro-components/p-5746d7ce.js +1 -0
- package/dist/taro-components/p-5f4d0d5b.system.js +7 -0
- package/dist/taro-components/{p-e35230e0.entry.js → p-61c0caae.entry.js} +1 -1
- package/dist/taro-components/p-663d1bb9.system.js +1 -0
- package/dist/taro-components/{p-865c21b5.entry.js → p-668a6262.entry.js} +1 -1
- package/dist/taro-components/{p-93fe9ea6.system.entry.js → p-6c211370.system.entry.js} +1 -1
- package/dist/taro-components/p-7e5d2d7a.js +7 -0
- package/dist/taro-components/{p-99ed3ed2.system.entry.js → p-8bea1c4d.system.entry.js} +1 -1
- package/dist/taro-components/{p-d2be4eb3.entry.js → p-aae3e479.entry.js} +1 -1
- package/dist/taro-components/{p-9086b901.system.entry.js → p-b0bd2cf1.system.entry.js} +1 -1
- package/dist/taro-components/{p-1b48afb1.entry.js → p-b93ca09d.entry.js} +1 -1
- package/dist/taro-components/{p-15b51e54.system.entry.js → p-bc97b854.system.entry.js} +1 -1
- package/dist/taro-components/{p-4cd044c4.system.entry.js → p-c06f1610.system.entry.js} +1 -1
- package/dist/taro-components/{p-f05cac3f.entry.js → p-cd2af8b4.entry.js} +1 -1
- package/dist/taro-components/{p-e12cb218.entry.js → p-d19aeb27.entry.js} +1 -1
- package/dist/taro-components/{p-d8862a47.entry.js → p-e3c9421d.entry.js} +1 -1
- package/dist/taro-components/{p-092d81b8.system.entry.js → p-e61d2113.system.entry.js} +1 -1
- package/dist/taro-components/{p-98b47fc9.system.entry.js → p-ed3bf934.system.entry.js} +1 -1
- package/dist/taro-components/{p-5d5baadf.entry.js → p-edcb9726.entry.js} +1 -1
- package/dist/taro-components/{p-4aa4de0f.system.entry.js → p-fbd45c24.system.entry.js} +1 -1
- package/dist/taro-components/p-ff032a23.system.entry.js +365 -0
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/picker-view/picker-view-column.d.ts +1 -1
- package/dist/types/components/scroll-view/scroll-view.d.ts +1 -1
- package/dist/types/components/swiper/swiper.d.ts +2 -2
- package/dist/types/components/video/utils.d.ts +8 -0
- package/dist/types/components/video/video-control.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/package.json +4 -3
- package/types/Video.d.ts +1 -1
- package/types/index.vue3.d.ts +1 -1
- package/dist/cjs/index-bf151ad6.js +0 -13
- package/dist/esm/index-c58e5e14.js +0 -11
- package/dist/esm-es5/index-3c78bcaf.js +0 -7
- package/dist/esm-es5/index-c58e5e14.js +0 -1
- package/dist/taro-components/p-11932905.entry.js +0 -1
- package/dist/taro-components/p-2c05106f.system.entry.js +0 -1
- package/dist/taro-components/p-37cfdd8f.js +0 -7
- package/dist/taro-components/p-724abeb7.js +0 -1
- package/dist/taro-components/p-94c20f60.system.js +0 -7
- package/dist/taro-components/p-b246a0d1.entry.js +0 -1
- package/dist/taro-components/p-f885783f.system.js +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-dd4b7ba3.js');
|
|
6
|
-
const index$1 = require('./index-
|
|
6
|
+
const index$1 = require('./index-dffbd352.js');
|
|
7
7
|
|
|
8
8
|
const indexCss = "body,html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-view-core{display:block}";
|
|
9
9
|
|
|
@@ -1,109 +1,96 @@
|
|
|
1
|
-
export const formatTime = time => {
|
|
2
|
-
if (time
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const calcDist = (x, y) => {
|
|
9
|
-
return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (!ret[fnMap[0][0]]) {
|
|
98
|
-
// when there is no any APIs be set.
|
|
99
|
-
|
|
100
|
-
// In IOS, there is no 'webkitEnterFullscreen' property `in document` but video can use it for fullscreen.
|
|
101
|
-
// ref: https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1633500-webkitenterfullscreen
|
|
102
|
-
for (i = 0; i < defaultIOSMap.length; i++) {
|
|
103
|
-
ret[fnMap[0][i]] = defaultIOSMap[i]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// If it doesn't find any of them, this whole function returns {}
|
|
107
|
-
// and the fn variable is set to this returned value.
|
|
108
|
-
return ret
|
|
109
|
-
})()
|
|
1
|
+
export const formatTime = (time) => {
|
|
2
|
+
if (!time)
|
|
3
|
+
return '';
|
|
4
|
+
const sec = Math.round(time % 60);
|
|
5
|
+
const min = Math.round((time - sec) / 60);
|
|
6
|
+
return `${min < 10 ? `0${min}` : min}:${sec < 10 ? `0${sec}` : sec}`;
|
|
7
|
+
};
|
|
8
|
+
export const calcDist = (x, y) => {
|
|
9
|
+
return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
|
10
|
+
};
|
|
11
|
+
export const normalizeNumber = (number) => {
|
|
12
|
+
return Math.max(-1, Math.min(number, 1));
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @returns: {requestFullscreen: 'requestFullscreen', exitFullscreen: 'exitFullscreen', ...}
|
|
16
|
+
*/
|
|
17
|
+
export const screenFn = (function () {
|
|
18
|
+
let val;
|
|
19
|
+
const fnMap = [
|
|
20
|
+
[
|
|
21
|
+
'requestFullscreen',
|
|
22
|
+
'exitFullscreen',
|
|
23
|
+
'fullscreenElement',
|
|
24
|
+
'fullscreenEnabled',
|
|
25
|
+
'fullscreenchange',
|
|
26
|
+
'fullscreenerror'
|
|
27
|
+
],
|
|
28
|
+
// New WebKit
|
|
29
|
+
[
|
|
30
|
+
'webkitRequestFullscreen',
|
|
31
|
+
'webkitExitFullscreen',
|
|
32
|
+
'webkitFullscreenElement',
|
|
33
|
+
'webkitFullscreenEnabled',
|
|
34
|
+
'webkitfullscreenchange',
|
|
35
|
+
'webkitfullscreenerror'
|
|
36
|
+
],
|
|
37
|
+
// Old WebKit
|
|
38
|
+
[
|
|
39
|
+
'webkitRequestFullScreen',
|
|
40
|
+
'webkitCancelFullScreen',
|
|
41
|
+
'webkitCurrentFullScreenElement',
|
|
42
|
+
'webkitCancelFullScreen',
|
|
43
|
+
'webkitfullscreenchange',
|
|
44
|
+
'webkitfullscreenerror'
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
'mozRequestFullScreen',
|
|
48
|
+
'mozCancelFullScreen',
|
|
49
|
+
'mozFullScreenElement',
|
|
50
|
+
'mozFullScreenEnabled',
|
|
51
|
+
'mozfullscreenchange',
|
|
52
|
+
'mozfullscreenerror'
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
'msRequestFullscreen',
|
|
56
|
+
'msExitFullscreen',
|
|
57
|
+
'msFullscreenElement',
|
|
58
|
+
'msFullscreenEnabled',
|
|
59
|
+
'MSFullscreenChange',
|
|
60
|
+
'MSFullscreenError'
|
|
61
|
+
]
|
|
62
|
+
];
|
|
63
|
+
var defaultIOSMap = [
|
|
64
|
+
'webkitEnterFullscreen',
|
|
65
|
+
'webkitExitFullscreen',
|
|
66
|
+
'webkitFullscreenElement',
|
|
67
|
+
'webkitFullscreenEnabled',
|
|
68
|
+
'webkitfullscreenchange',
|
|
69
|
+
'webkitfullscreenerror'
|
|
70
|
+
];
|
|
71
|
+
let i = 0;
|
|
72
|
+
const l = fnMap.length;
|
|
73
|
+
const ret = {};
|
|
74
|
+
// This for loop essentially checks the current document object for the property/methods above.
|
|
75
|
+
for (; i < l; i++) {
|
|
76
|
+
val = fnMap[i];
|
|
77
|
+
if (val && val[1] in document) {
|
|
78
|
+
for (i = 0; i < val.length; i++) {
|
|
79
|
+
ret[fnMap[0][i]] = val[i];
|
|
80
|
+
}
|
|
81
|
+
return ret;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!ret[fnMap[0][0]]) {
|
|
85
|
+
// when there is no any APIs be set.
|
|
86
|
+
// In IOS, there is no 'webkitEnterFullscreen' property `in document` but video can use it for fullscreen.
|
|
87
|
+
// ref: https://developer.apple.com/documentation/webkitjs/htmlvideoelement/1633500-webkitenterfullscreen
|
|
88
|
+
for (i = 0; i < defaultIOSMap.length; i++) {
|
|
89
|
+
ret[fnMap[0][i]] = defaultIOSMap[i];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// If it doesn't find any of them, this whole function returns {}
|
|
93
|
+
// and the fn variable is set to this returned value.
|
|
94
|
+
return ret;
|
|
95
|
+
})();
|
|
96
|
+
export const isHls = url => /\.(m3u8)($|\?)/i.test(url);
|
|
@@ -15,15 +15,15 @@ export class VideoControl {
|
|
|
15
15
|
this.visible = false;
|
|
16
16
|
this.isDraggingProgressBall = false;
|
|
17
17
|
this.percentage = 0;
|
|
18
|
-
this.
|
|
18
|
+
this.progressDimensions = {
|
|
19
19
|
left: 0,
|
|
20
20
|
width: 0
|
|
21
21
|
};
|
|
22
22
|
this.calcPercentage = (pageX) => {
|
|
23
|
-
let pos = pageX - this.
|
|
23
|
+
let pos = pageX - this.progressDimensions.left;
|
|
24
24
|
pos = Math.max(pos, 0);
|
|
25
|
-
pos = Math.min(pos, this.
|
|
26
|
-
return pos / this.
|
|
25
|
+
pos = Math.min(pos, this.progressDimensions.width);
|
|
26
|
+
return pos / this.progressDimensions.width;
|
|
27
27
|
};
|
|
28
28
|
this.onDragProgressBallStart = () => {
|
|
29
29
|
this.isDraggingProgressBall = true;
|
|
@@ -108,8 +108,8 @@ export class VideoControl {
|
|
|
108
108
|
if (!ref)
|
|
109
109
|
return;
|
|
110
110
|
const rect = ref.getBoundingClientRect();
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
111
|
+
this.progressDimensions.left = rect.left;
|
|
112
|
+
this.progressDimensions.width = rect.width;
|
|
113
113
|
} },
|
|
114
114
|
h("div", { class: 'taro-video-progress-buffered', style: { width: '100%' } }),
|
|
115
115
|
h("div", { class: 'taro-video-ball', ref: dom => (this.progressBallRef = dom), onTouchStart: this.onDragProgressBallStart, style: {
|
|
@@ -10,7 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
11
|
import { Component, h, Prop, State, Event, Host, Watch, Listen, Element, Method } from '@stencil/core';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
-
import
|
|
13
|
+
import Hls from 'hls.js';
|
|
14
|
+
import { throttle } from '../../utils';
|
|
15
|
+
import { formatTime, calcDist, normalizeNumber, screenFn, isHls } from './utils';
|
|
14
16
|
export class Video {
|
|
15
17
|
constructor() {
|
|
16
18
|
this.currentTime = 0;
|
|
@@ -91,7 +93,7 @@ export class Video {
|
|
|
91
93
|
this.isFullScreen = false;
|
|
92
94
|
this.fullScreenTimestamp = new Date().getTime();
|
|
93
95
|
this.isMute = false;
|
|
94
|
-
this.
|
|
96
|
+
this.analyzeGesture = (e) => {
|
|
95
97
|
var _a;
|
|
96
98
|
const obj = {
|
|
97
99
|
type: 'none'
|
|
@@ -133,6 +135,37 @@ export class Video {
|
|
|
133
135
|
obj.dataY = normalizeNumber(distY / 200);
|
|
134
136
|
return obj;
|
|
135
137
|
};
|
|
138
|
+
this.loadNativePlayer = () => {
|
|
139
|
+
if (this.videoRef) {
|
|
140
|
+
this.videoRef.src = this.src;
|
|
141
|
+
this.videoRef.load();
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
this.init = () => {
|
|
145
|
+
const { src, videoRef } = this;
|
|
146
|
+
if (isHls(src)) {
|
|
147
|
+
if (Hls.isSupported()) {
|
|
148
|
+
if (this.hls) {
|
|
149
|
+
this.hls.destroy();
|
|
150
|
+
}
|
|
151
|
+
this.hls = new Hls();
|
|
152
|
+
this.hls.loadSource(src);
|
|
153
|
+
this.hls.attachMedia(videoRef);
|
|
154
|
+
this.hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
155
|
+
this.autoplay && this.play();
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
else if (videoRef.canPlayType('application/vnd.apple.mpegurl')) {
|
|
159
|
+
this.loadNativePlayer();
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
console.error('该浏览器不支持 HLS 播放');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
this.loadNativePlayer();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
136
169
|
this.handlePlay = () => {
|
|
137
170
|
this.isPlaying = true;
|
|
138
171
|
this.isFirst = false;
|
|
@@ -258,6 +291,7 @@ export class Video {
|
|
|
258
291
|
this._enableDanmu = this.enableDanmu;
|
|
259
292
|
}
|
|
260
293
|
componentDidLoad() {
|
|
294
|
+
this.init();
|
|
261
295
|
if (this.initialTime) {
|
|
262
296
|
this.videoRef.currentTime = this.initialTime;
|
|
263
297
|
}
|
|
@@ -277,13 +311,16 @@ export class Video {
|
|
|
277
311
|
watchEnableDanmu(newVal) {
|
|
278
312
|
this._enableDanmu = newVal;
|
|
279
313
|
}
|
|
314
|
+
watchSrc() {
|
|
315
|
+
this.init();
|
|
316
|
+
}
|
|
280
317
|
onDocumentTouchMove(e) {
|
|
281
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
282
319
|
if (this.lastTouchScreenX === undefined || this.lastTouchScreenY === undefined)
|
|
283
320
|
return;
|
|
284
321
|
if (yield this.controlsRef.getIsDraggingProgressBall())
|
|
285
322
|
return;
|
|
286
|
-
const gestureObj = this.
|
|
323
|
+
const gestureObj = this.analyzeGesture(e);
|
|
287
324
|
if (gestureObj.type === 'adjustVolume') {
|
|
288
325
|
this.toastVolumeRef.style.visibility = 'visible';
|
|
289
326
|
const nextVolume = Math.max(Math.min(this.lastVolume - gestureObj.dataY, 1), 0);
|
|
@@ -356,8 +393,9 @@ export class Video {
|
|
|
356
393
|
});
|
|
357
394
|
}
|
|
358
395
|
render() {
|
|
359
|
-
const {
|
|
360
|
-
const
|
|
396
|
+
const { controls, autoplay, loop, muted, poster, objectFit, isFirst, isMute, isFullScreen, showCenterPlayBtn, isPlaying, _enableDanmu, showMuteBtn, danmuBtn, showFullscreenBtn, nativeProps } = this;
|
|
397
|
+
const duration = this.duration || this._duration;
|
|
398
|
+
const durationTime = formatTime(duration);
|
|
361
399
|
return (h(Host, { class: classNames('taro-video-container', {
|
|
362
400
|
'taro-video-type-fullscreen': isFullScreen
|
|
363
401
|
}), onTouchStart: this.onTouchStartContainer, onClick: this.onClickContainer },
|
|
@@ -367,7 +405,7 @@ export class Video {
|
|
|
367
405
|
if (dom) {
|
|
368
406
|
this.videoRef = dom;
|
|
369
407
|
}
|
|
370
|
-
},
|
|
408
|
+
}, autoplay: autoplay, loop: loop, muted: muted, poster: controls ? poster : undefined, playsinline: true, "webkit-playsinline": true, onPlay: this.handlePlay, onPause: this.handlePause, onEnded: this.handleEnded, onTimeUpdate: this.handleTimeUpdate, onError: this.handleError, onDurationChange: this.handleDurationChange, onProgress: this.handleProgress, onLoadedMetaData: this.handleLoadedMetaData }, nativeProps), "\u6682\u65F6\u4E0D\u652F\u6301\u64AD\u653E\u8BE5\u89C6\u9891"),
|
|
371
409
|
h("taro-video-danmu", { ref: dom => {
|
|
372
410
|
if (dom) {
|
|
373
411
|
this.danmuRef = dom;
|
|
@@ -380,7 +418,7 @@ export class Video {
|
|
|
380
418
|
if (dom) {
|
|
381
419
|
this.controlsRef = dom;
|
|
382
420
|
}
|
|
383
|
-
}, controls: controls, currentTime: this.currentTime, duration:
|
|
421
|
+
}, controls: controls, currentTime: this.currentTime, duration: duration, isPlaying: this.isPlaying, pauseFunc: this._pause, playFunc: this._play, seekFunc: this._seek, showPlayBtn: this.showPlayBtn, showProgress: this.showProgress },
|
|
384
422
|
showMuteBtn && (h("div", { class: classNames('taro-video-mute', {
|
|
385
423
|
'taro-video-type-mute': isMute
|
|
386
424
|
}), onClick: this.toggleMute })),
|
|
@@ -1047,6 +1085,9 @@ export class Video {
|
|
|
1047
1085
|
static get watchers() { return [{
|
|
1048
1086
|
"propName": "enableDanmu",
|
|
1049
1087
|
"methodName": "watchEnableDanmu"
|
|
1088
|
+
}, {
|
|
1089
|
+
"propName": "src",
|
|
1090
|
+
"methodName": "watchSrc"
|
|
1050
1091
|
}]; }
|
|
1051
1092
|
static get listeners() { return [{
|
|
1052
1093
|
"name": "touchmove",
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export function throttle(fn,
|
|
2
|
-
let
|
|
3
|
-
|
|
1
|
+
export function throttle(fn, threshold = 250, scope) {
|
|
2
|
+
let lastTime = 0;
|
|
3
|
+
let deferTimer;
|
|
4
|
+
return function (...args) {
|
|
4
5
|
const context = scope || this;
|
|
5
|
-
const now =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const now = Date.now();
|
|
7
|
+
if (now - lastTime > threshold) {
|
|
8
|
+
fn.apply(this, args);
|
|
9
|
+
lastTime = now;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
9
12
|
clearTimeout(deferTimer);
|
|
10
13
|
deferTimer = setTimeout(() => {
|
|
11
|
-
|
|
14
|
+
lastTime = now;
|
|
12
15
|
fn.apply(context, args);
|
|
13
|
-
},
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
last = now;
|
|
17
|
-
fn.apply(context, args);
|
|
16
|
+
}, threshold);
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
export function debounce(fn, ms = 250) {
|
|
20
|
+
export function debounce(fn, ms = 250, scope) {
|
|
22
21
|
let timer;
|
|
23
|
-
return function (...
|
|
22
|
+
return function (...args) {
|
|
23
|
+
const context = scope || this;
|
|
24
24
|
clearTimeout(timer);
|
|
25
25
|
timer = setTimeout(function () {
|
|
26
|
-
fn(
|
|
26
|
+
fn.apply(context, args);
|
|
27
27
|
}, ms);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function throttle(fn, threshold = 250, scope) {
|
|
2
|
+
let lastTime = 0;
|
|
3
|
+
let deferTimer;
|
|
4
|
+
return function (...args) {
|
|
5
|
+
const context = scope || this;
|
|
6
|
+
const now = Date.now();
|
|
7
|
+
if (now - lastTime > threshold) {
|
|
8
|
+
fn.apply(this, args);
|
|
9
|
+
lastTime = now;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
clearTimeout(deferTimer);
|
|
13
|
+
deferTimer = setTimeout(() => {
|
|
14
|
+
lastTime = now;
|
|
15
|
+
fn.apply(context, args);
|
|
16
|
+
}, threshold);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function debounce(fn, ms = 250, scope) {
|
|
21
|
+
let timer;
|
|
22
|
+
return function (...args) {
|
|
23
|
+
const context = scope || this;
|
|
24
|
+
clearTimeout(timer);
|
|
25
|
+
timer = setTimeout(function () {
|
|
26
|
+
fn.apply(context, args);
|
|
27
|
+
}, ms);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { debounce as d, throttle as t };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
'
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
2
6
|
|
|
3
7
|
function createCommonjsModule(fn, basedir, module) {
|
|
4
8
|
return module = {
|
|
@@ -69,4 +73,4 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
69
73
|
}());
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
export { createCommonjsModule as a, commonjsGlobal as b, classnames as c, getDefaultExportFromCjs as g };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
const indexCss = "taro-button-core{display:block;overflow:hidden;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;border-width:0;border-radius:5px;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;background-color:#f8f8f8;line-height:2.55555556;text-decoration:none;text-align:center;font-size:18px;color:#000;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-button-core:focus{outline:0}taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core::after{position:absolute;left:0;top:0;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid rgba(0, 0, 0, 0.2);border-radius:10px;width:200%;height:200%;content:\" \";-webkit-transform:scale(0.5);transform:scale(0.5);-webkit-transform-origin:0 0;transform-origin:0 0}taro-button-core+taro-button-core{margin-top:15px}taro-button-core[type=default]{background-color:#f8f8f8;color:#000}taro-button-core[type=default]:not([disabled]):visited{color:#000}taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core[size=mini]{display:inline-block;padding:0 1.32em;width:auto;line-height:2.3;font-size:13px}taro-button-core[plain],taro-button-core[plain][type=default],taro-button-core[plain][type=primary]{border-width:1px;background-color:transparent}taro-button-core[disabled]{color:rgba(255, 255, 255, 0.6)}taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[disabled][type=primary]{background-color:#9ed99d}taro-button-core[disabled][type=warn]{background-color:#ec8b89}taro-button-core[loading] .weui-loading{margin:-0.2em 0.34em 0 0}taro-button-core[loading][type=primary],taro-button-core[loading][type=warn]{color:rgba(255, 255, 255, 0.6)}taro-button-core[loading][type=primary]{background-color:#179b16}taro-button-core[loading][type=warn]{background-color:#ce3c39}taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}taro-button-core[plain][type=primary]:not([disabled]):active{border-color:rgba(26, 173, 25, 0.6);background-color:transparent;color:rgba(26, 173, 25, 0.6)}taro-button-core[plain][type=primary]::after{border-width:0}taro-button-core[plain],taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}taro-button-core[plain]:not([disabled]):active,taro-button-core[plain][type=default]:not([disabled]):active{border-color:rgba(53, 53, 53, 0.6);background-color:transparent;color:rgba(53, 53, 53, 0.6)}taro-button-core[plain]::after,taro-button-core[plain][type=default]::after{border-width:0}taro-button-core[type=primary]{background-color:#1aad19;color:#fff}taro-button-core[type=primary]:not([disabled]):visited{color:#fff}taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:rgba(255, 255, 255, 0.6)}taro-button-core[type=warn]{background-color:#e64340;color:#fff}taro-button-core[type=warn]:not([disabled]):visited{color:#fff}taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:rgba(255, 255, 255, 0.6)}taro-button-core[plain][disabled]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[plain][disabled][type=primary]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
const coverViewCss = "taro-cover-view-core{display:block}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
const indexCss = "img[src=\"\"]{opacity:0}taro-image-core{display:inline-block;overflow:hidden;position:relative;width:auto;height:auto;font-size:0}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%}.taro-img__mode-aspectfill{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-heightfix{height:100%}.taro-img__mode-top{width:100%}.taro-img__mode-bottom{position:absolute;bottom:0;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{position:absolute;right:0;height:100%}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;right:0;bottom:0}";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-5bd7cbab.js';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
|
-
import { c as classnames } from './index-
|
|
3
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
4
4
|
|
|
5
5
|
const indexCss = ".navigator-hover{background:#efefef}";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
function getTimeRange(begin, end) {
|
|
5
5
|
const range = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-5bd7cbab.js';
|
|
2
|
-
import { d as debounce } from './index-
|
|
2
|
+
import { d as debounce } from './index-cad8203e.js';
|
|
3
3
|
|
|
4
4
|
const columnCss = ".taro-picker-view-column-container{display:-ms-flexbox;display:flex;overflow:scroll;overflow-x:hidden;position:relative;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;text-align:center}.taro-picker-view-column-container::-webkit-scrollbar{display:none}";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
function convertStyle(style) {
|
|
5
5
|
if (style) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
|
-
import { c as classnames } from './index-
|
|
3
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
4
4
|
|
|
5
5
|
const indexCss = ".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{overflow:hidden;min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
3
|
-
import { d as debounce } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
|
+
import { d as debounce } from './index-cad8203e.js';
|
|
4
4
|
|
|
5
5
|
const indexCss = "taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
3
|
-
import { d as debounce } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
|
+
import { d as debounce } from './index-cad8203e.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SSR Window 3.0.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-5bd7cbab.js';
|
|
2
2
|
import Taro from '@tarojs/taro';
|
|
3
|
-
import { c as classnames } from './index-
|
|
3
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
4
4
|
|
|
5
5
|
const splitUrl = _url => {
|
|
6
6
|
let url = _url || '';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-5bd7cbab.js';
|
|
2
|
-
import { c as classnames } from './index-
|
|
2
|
+
import { c as classnames } from './index-cd1a2d33.js';
|
|
3
3
|
|
|
4
4
|
const indexCss = "taro-text-core{display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:pre-wrap}.taro-text__selectable{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}";
|
|
5
5
|
|