@tarojs/components 3.5.7 → 3.5.9
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/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +5 -0
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-movable-area-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-movable-view-core.cjs.entry.js +18 -43
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +5 -0
- package/dist/cjs/taro-video-control_3.cjs.entry.js +98 -181
- package/dist/collection/components/button/button.js +11 -0
- package/dist/collection/components/movable-area/area.css +2 -2
- package/dist/collection/components/movable-area/movable-view.js +18 -33
- package/dist/collection/components/swiper/swiper.js +23 -0
- package/dist/collection/components/video/video-control.js +22 -39
- package/dist/collection/components/video/video-danmu.js +39 -52
- package/dist/collection/components/video/video.js +37 -60
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +5 -0
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-movable-area-core.entry.js +1 -1
- package/dist/esm/taro-movable-view-core.entry.js +18 -43
- package/dist/esm/taro-swiper-core_2.entry.js +5 -0
- package/dist/esm/taro-video-control_3.entry.js +98 -181
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-movable-area-core.entry.js +1 -1
- package/dist/esm-es5/taro-movable-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +55 -55
- package/dist/taro-components/p-0380841f.system.js +1 -1
- package/dist/taro-components/{p-a94524c9.system.entry.js → p-06b9d39c.system.entry.js} +1 -1
- package/dist/taro-components/{p-63a0c6b0.entry.js → p-34178401.entry.js} +1 -1
- package/dist/taro-components/p-3549b6d2.entry.js +1 -0
- package/dist/taro-components/p-4262d1b6.entry.js +1 -0
- package/dist/taro-components/{p-f8b9c4b0.entry.js → p-42630f45.entry.js} +1 -1
- package/dist/taro-components/{p-f81a74bb.system.entry.js → p-4c1a7cae.system.entry.js} +81 -81
- package/dist/taro-components/{p-3744e978.entry.js → p-99d17a1a.entry.js} +52 -52
- package/dist/taro-components/{p-13f0b11f.system.entry.js → p-a5496bf5.system.entry.js} +1 -1
- package/dist/taro-components/p-f40e1218.system.entry.js +1 -0
- package/dist/taro-components/{p-1c775a11.system.entry.js → p-f5f1c3b7.system.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/swiper/swiper.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +15 -12
- package/types/Ad.d.ts +21 -22
- package/types/AnimationVideo.d.ts +62 -0
- package/types/AnimationView.d.ts +45 -0
- package/types/ArCamera.d.ts +50 -0
- package/types/Audio.d.ts +6 -6
- package/types/AwemeData.d.ts +43 -0
- package/types/Button.d.ts +68 -71
- package/types/Camera.d.ts +16 -17
- package/types/Canvas.d.ts +23 -28
- package/types/Checkbox.d.ts +8 -8
- package/types/CheckboxGroup.d.ts +1 -1
- package/types/CommentDetail.d.ts +72 -0
- package/types/CommentList.d.ts +128 -0
- package/types/ContactButton.d.ts +53 -0
- package/types/CoverImage.d.ts +16 -16
- package/types/CoverView.d.ts +105 -7
- package/types/CustomWrapper.d.ts +1 -1
- package/types/FollowSwan.d.ts +28 -0
- package/types/Form.d.ts +11 -11
- package/types/Icon.d.ts +1 -1
- package/types/Image.d.ts +21 -21
- package/types/InlinePaymentPanel.d.ts +58 -0
- package/types/Input.d.ts +93 -28
- package/types/Lifestyle.d.ts +26 -0
- package/types/Like.d.ts +107 -0
- package/types/LivePlayer.d.ts +32 -26
- package/types/LivePusher.d.ts +6 -6
- package/types/Login.d.ts +45 -0
- package/types/Lottie.d.ts +113 -0
- package/types/Map.d.ts +67 -72
- package/types/MatchMedia.d.ts +1 -1
- package/types/MovableArea.d.ts +2 -2
- package/types/MovableView.d.ts +20 -29
- package/types/NativeSlot.d.ts +32 -0
- package/types/Navigator.d.ts +11 -11
- package/types/OpenData.d.ts +6 -6
- package/types/PageContainer.d.ts +31 -24
- package/types/PageMeta.d.ts +15 -15
- package/types/Picker.d.ts +2 -6
- package/types/PickerView.d.ts +12 -22
- package/types/Progress.d.ts +6 -6
- package/types/Radio.d.ts +1 -1
- package/types/RadioGroup.d.ts +6 -6
- package/types/RichText.d.ts +17 -17
- package/types/RootPortal.d.ts +11 -2
- package/types/RtcRoom.d.ts +104 -0
- package/types/RtcRoomItem.d.ts +26 -0
- package/types/ScrollView.d.ts +47 -31
- package/types/ShareElement.d.ts +20 -10
- package/types/Slider.d.ts +11 -11
- package/types/Slot.d.ts +1 -1
- package/types/Swiper.d.ts +32 -20
- package/types/SwiperItem.d.ts +3 -2
- package/types/Switch.d.ts +6 -6
- package/types/TabItem.d.ts +35 -0
- package/types/Tabs.d.ts +58 -0
- package/types/Text.d.ts +1 -1
- package/types/Textarea.d.ts +39 -33
- package/types/Video.d.ts +123 -108
- package/types/View.d.ts +21 -14
- package/types/VoipRoom.d.ts +5 -5
- package/types/WebView.d.ts +12 -6
- package/types/index.vue3.d.ts +268 -259
- package/dist/taro-components/p-6800ac6f.entry.js +0 -1
- package/dist/taro-components/p-7f93fa08.entry.js +0 -1
- package/dist/taro-components/p-9e1572c5.system.entry.js +0 -1
|
@@ -102,25 +102,6 @@ const screenFn = (function () {
|
|
|
102
102
|
})();
|
|
103
103
|
const isHls = url => /\.(m3u8)($|\?)/i.test(url);
|
|
104
104
|
|
|
105
|
-
var __awaiter$2 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
106
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
107
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
108
|
-
function fulfilled(value) { try {
|
|
109
|
-
step(generator.next(value));
|
|
110
|
-
}
|
|
111
|
-
catch (e) {
|
|
112
|
-
reject(e);
|
|
113
|
-
} }
|
|
114
|
-
function rejected(value) { try {
|
|
115
|
-
step(generator["throw"](value));
|
|
116
|
-
}
|
|
117
|
-
catch (e) {
|
|
118
|
-
reject(e);
|
|
119
|
-
} }
|
|
120
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
121
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
105
|
let VideoControl = class {
|
|
125
106
|
constructor(hostRef) {
|
|
126
107
|
index.registerInstance(this, hostRef);
|
|
@@ -163,40 +144,32 @@ let VideoControl = class {
|
|
|
163
144
|
this.seekFunc(this.percentage * this.duration);
|
|
164
145
|
this.toggleVisibility(true);
|
|
165
146
|
}
|
|
166
|
-
setProgressBall(percentage) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
});
|
|
147
|
+
async setProgressBall(percentage) {
|
|
148
|
+
if (this.progressBallRef) {
|
|
149
|
+
this.progressBallRef.style.left = `${percentage * 100}%`;
|
|
150
|
+
}
|
|
172
151
|
}
|
|
173
|
-
toggleVisibility(nextVisible) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.
|
|
180
|
-
|
|
181
|
-
}, 2000);
|
|
182
|
-
}
|
|
183
|
-
this.el.style.visibility = 'visible';
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
this.el.style.visibility = 'hidden';
|
|
152
|
+
async toggleVisibility(nextVisible) {
|
|
153
|
+
const visible = nextVisible === undefined ? !this.visible : nextVisible;
|
|
154
|
+
if (visible) {
|
|
155
|
+
this.hideControlsTimer && clearTimeout(this.hideControlsTimer);
|
|
156
|
+
if (this.isPlaying) {
|
|
157
|
+
this.hideControlsTimer = setTimeout(() => {
|
|
158
|
+
this.toggleVisibility(false);
|
|
159
|
+
}, 2000);
|
|
187
160
|
}
|
|
188
|
-
this.
|
|
189
|
-
}
|
|
161
|
+
this.el.style.visibility = 'visible';
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.el.style.visibility = 'hidden';
|
|
165
|
+
}
|
|
166
|
+
this.visible = !!visible;
|
|
190
167
|
}
|
|
191
|
-
getIsDraggingProgressBall() {
|
|
192
|
-
return
|
|
193
|
-
return this.isDraggingProgressBall;
|
|
194
|
-
});
|
|
168
|
+
async getIsDraggingProgressBall() {
|
|
169
|
+
return this.isDraggingProgressBall;
|
|
195
170
|
}
|
|
196
|
-
setCurrentTime(time) {
|
|
197
|
-
|
|
198
|
-
this.currentTimeRef.innerHTML = formatTime(time);
|
|
199
|
-
});
|
|
171
|
+
async setCurrentTime(time) {
|
|
172
|
+
this.currentTimeRef.innerHTML = formatTime(time);
|
|
200
173
|
}
|
|
201
174
|
render() {
|
|
202
175
|
const { controls, currentTime, duration, isPlaying, pauseFunc, playFunc, showPlayBtn, showProgress } = this;
|
|
@@ -27839,25 +27812,6 @@ const Hls = /*@__PURE__*/index$1.getDefaultExportFromCjs(hls);
|
|
|
27839
27812
|
|
|
27840
27813
|
const indexCss = ".taro-video{display:inline-block;overflow:hidden;position:relative;width:100%;height:225px;line-height:0}.taro-video[hidden]{display:none}.taro-video-container{display:inline-block;position:absolute;left:0;top:0;width:100%;height:100%;background-color:#000;-o-object-position:inherit;object-position:inherit}.taro-video-container.taro-video-type-fullscreen{position:fixed;left:0;right:0;top:0;bottom:0;z-index:999}.taro-video-container.taro-video-type-fullscreen.taro-video-type-rotate-left{-webkit-transform:translate(-50%, -50%) rotate(-90deg);transform:translate(-50%, -50%) rotate(-90deg)}.taro-video-container.taro-video-type-fullscreen.taro-video-type-rotate-right{-webkit-transform:translate(-50%, -50%) rotate(90deg);transform:translate(-50%, -50%) rotate(90deg)}.taro-video-video{width:100%;height:100%;-o-object-position:inherit;object-position:inherit}.taro-video-cover{display:-ms-flexbox;display:flex;position:absolute;left:0;top:0;bottom:0;z-index:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;width:100%;background-color:rgba(1, 1, 1, 0.5);-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:center;-webkit-box-align:center}.taro-video-cover-play-button{width:40px;height:40px;background-repeat:no-repeat;background-position:50% 50%;background-size:50%}.taro-video-cover-duration{margin-top:10px;line-height:1;font-size:16px;color:#fff}.taro-video-bar{display:-ms-flexbox;display:flex;visibility:hidden;overflow:hidden;position:absolute;right:0;bottom:0;z-index:1;-ms-flex-align:center;align-items:center;padding:0 10px;height:44px;background-color:rgba(0, 0, 0, 0.5);-webkit-box-align:center}.taro-video-bar.taro-video-bar-full{left:0}.taro-video-controls{display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;margin:0 8.5px}.taro-video-control-button{-webkit-box-sizing:content-box;box-sizing:content-box;margin-left:-8.5px;padding:14.5px 12.5px;width:13px;height:15px}.taro-video-control-button::after{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50% 50%;background-size:100%;content:\"\"}.taro-video-control-button.taro-video-control-button-play::after,.taro-video-cover-play-button{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAeCAYAAAAy2w7YAAAAAXNSR0IArs4c6QAAAWhJREFUSA1j+P///0cgBoHjQGzCQCsAtgJB/AMy5wCxGNXtQ9iBwvoA5BUCMQvVLEQxHpNzDSjkRhXLMM3GKrIeKKpEkYVYjcUu+AMo3ALE3GRZiN1MvKKPgbIRJFuG10j8koeA0gZEW4jfLIKyf4EqpgOxMEELCRpFnIJ3QGU5QMyM00LizCFa1SWgSkeslhFtBGkKVwGVy6FYSJp+klR/A6quB2JOkIWMIK0oNlOf8xBoZDE9LAI7nYn6HsBq4l96WHQEaLUpAyiOaASeAM2NgvuPBpaACt82IEYtfKls0UagecpwXyAzqGTRdaA57sjmYrAptAjUsCkGYlYMg9EFyLQI1IiZB8Ti6Obh5JNh0QmgHlOcBuKSIMGi50C18UDMiMssvOJEWPQLqKYbiHnxGkRIkoBF24DyaoTMIEoeh0W3geI+RBlArCI0iz4D+RVAzEasfqLVAQ19AcSg5LoYiKWI1kiiQgCMBLnEEcfDSgAAAABJRU5ErkJggg==\")}.taro-video-control-button.taro-video-control-button-pause::after{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAAAXNSR0IArs4c6QAAAFlJREFUSA3tksEKACAIQ7X//5zq98wOgQayum8QaGweHhMzG/6OujzKAymn+0LMqivu1XznWmX8/echTIyMyAgTwA72iIwwAexgj8gIE8CO3aMRbDPMaEy5BRGaKcZv8YxRAAAAAElFTkSuQmCC\")}.taro-video-current-time,.taro-video-duration{margin-top:15px;margin-bottom:14.5px;height:14.5px;line-height:14.5px;font-size:12px;color:#cbcbcb}.taro-video-progress-container{position:relative;-ms-flex-positive:2;flex-grow:2;-webkit-box-flex:2}.taro-video-progress{position:relative;margin:21px 12px;height:2px;background-color:rgba(255, 255, 255, 0.4)}.taro-video-progress-buffered{position:absolute;left:0;top:0;width:0;height:100%;background-color:rgba(255, 255, 255, 0.8);-webkit-transition:width 0.1s;transition:width 0.1s}.taro-video-ball{position:absolute;left:0;top:-21px;-webkit-box-sizing:content-box;box-sizing:content-box;margin-left:-22px;padding:14px;width:16px;height:16px}.taro-video-inner{border-radius:50%;width:100%;height:100%;background-color:#fff}.taro-video-danmu-button{margin:0 8.5px;padding:2px 10px;border:1px solid #fff;border-radius:5px;line-height:1;font-size:13px;color:#fff;white-space:nowrap}.taro-video-danmu-button.taro-video-danmu-button-active{border-color:#48c23d;color:#48c23d}.taro-video-fullscreen,.taro-video-mute{-webkit-box-sizing:content-box;box-sizing:content-box;padding:8.5px;width:17px;height:17px;background-repeat:no-repeat;background-position:50% 50%;background-size:50%}.taro-video-fullscreen{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAhUlEQVRYR+2WSwrAMAhEnZO3PfmULLooGEFTiIXJ2s/kRY2wzQeb85sE9CRA8jSzY1YfAFzhJBnU1AVgxH2dSiArCnD9QgGzRNnOech48SRABHoSyFb5in3PSbhyo6yvCPQkEM3u7BsPe/0FIvBfAh/vhKmVbO9SWun1qk/PSVi9TcVPBG6R1YIhgWwNpQAAAABJRU5ErkJggg==\")}.taro-video-fullscreen.taro-video-type-fullscreen{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABPUlEQVRYR+2Xu0pDURBF1/ZLxNcHKNiIlfhA7C0UBSEE8RNEBNFPUEQEEbGxFiSSSrCwEHsf5E/ccsSUuWfUhKQ40947+y42Z8+ZK/pcinzf9hhwD1xJ2q/qsb0JHAOzkl5y+lGAGnCWICQtZgAS6DxQk3TeLYA6cAo0JSXxjmW7CcwBdUkJurKiDhSA4kBvHbA9CqwBQx2O7BSw8ssU3ALPFRF4knT3nQLbr8B4LjLBOdAAFgJaLUkjbYC9n+zm+i4kXWbmwCqwnRMCHiXthuZAQOzPrxSA4kBxYDAcsH0EzATCfCLpJjOINoCtgFZabg7bk7AFDAeaGpKWgitZTu5N0kQbYBmYrujo9mX0CVxL+gidAdu9vY5zXhWA4sAgOND3X7NJ4AHYCaxkB8B62gslvecSFpoDOZH/PP8Cnt7hIaM5xCEAAAAASUVORK5CYII=\")}.taro-video-mute{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAGAGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmU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ZWvXvQmNFCwE3gCXA2dY0Az4GrRzHONA9cU/vAbERsllEOyh31e8USV2mrMPdG9uyn+rDom2/BHHCm5puWKiKmgdtAnz+rvaxO5mNygEvHaZ5BfADuARvAaWBpP4DGFBHfgBngFzClTrUKkCDeA+9S837rAEnbqb7VFcCpVJ/oCmCw959aB1AfAROpudYqgDoOLKRmPyLelAF8bcD4pPoMeAtcB34AT4uDBqXXwFG8XXUU/72MIuK1OgE8Bs6l7mEvo8up7lN1Ge0n9aK6VHMFZvJTr9S3CiALaCQhqZOSvegMIAvu2UVSWpigLC1fbQ0gm6in7qpfLCQbhwGIYcyPQ53/G3YO8BtUtd35bvKcVwAAAABJRU5ErkJggg==\")}.taro-video-mute.taro-video-type-mute{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAgCAYAAAB3j6rJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGAGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0ia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eh8jYlA9ANwE3kTEp3bO6vE03qOONzR1r/q4RGrquaFFxFxE3ALOA9+6jExpdb180y55AhirhaRTatq0GXEzL8+ZIuI9cBJ4WKiartJf9nWV/mty7UfUafW7erpqRGI9EBuprffvu9n6C1KOmsqwI5A1AAAAAElFTkSuQmCC\")}.taro-video-danmu{overflow:visible;position:absolute;left:0;top:0;bottom:0;margin-top:14px;margin-bottom:44px;width:100%;line-height:14px;font-size:14px}.taro-video-danmu-item{position:absolute;left:100%;line-height:1;color:#fff;white-space:nowrap;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition-property:left, -webkit-transform;transition-property:left, -webkit-transform;transition-property:left, transform;transition-property:left, transform, -webkit-transform;-webkit-transition-duration:3s;transition-duration:3s;-webkit-transition-timing-function:linear;transition-timing-function:linear}.taro-video-toast{display:block;visibility:hidden;position:absolute;left:50%;top:50%;border-radius:5px;background-color:rgba(255, 255, 255, 0.8);pointer-events:none;color:#000;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.taro-video-toast.taro-video-toast-volume{display:block;width:100px;height:100px}.taro-video-toast-volume .taro-video-toast-title{display:block;margin-top:10px;width:100%;line-height:16px;text-align:center;font-size:12px}.taro-video-toast-volume .taro-video-toast-icon{display:block;margin-left:25%;width:50%;height:50%;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAFhklEQVR4Xu2aeaxfQxTHP1VBES0NIQitWtpaaxeCUkQtaYVa0tiClAq1ExIiQTVppaWxt8RWSa2tWkJQRGgtQaSIpUKEpG0ssbbk28yV2+mZO/e9e3vvu/e98897mZnfzPl+75mZs0wvurn06ub46SGgxwLqZaA3sB/wO/A+8G/V6tS5BU4BJgJbO9DvAMOB36okoQ4CNgAeBEYbQK8Bbm4zAdsBc4EdAyA/APZoKwHHAA8DG2UA/AnYrG0ErAVcD1yXA9gfQJ8c40obsqbPgH7AY8CROTVuFQFD3X7fJid4DWsNAWOAGZ0w58YTsDZ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PAHqO44vpKPkFhH3cWWBVV6ogJVYZUgz/tXtIYelzI3Ct0fExIGx6j7iKWBUUveyYBehv1RIjIEsfqziq8Xp4pSBJOYTVJFQcVY3wCFeKUjVGyYfQWB00+5bEVBECrNS+qsOKBpVHNCVWHs+LS7H5PV5pOu9v0+OKEOAXR39w1e1C7wM6AkJ1eLmkRcrpRQiQrqobXO5S3vL3/4kBKMsCknV0k+iasVLUMV3UX5SAPGtED8EOT+L9YENnCasUIXNO2goChFWHqAIRyxXN4qI1BCQg9dJESYq8LnbrCBAR8t50Lig6i0krCRBoVWhVlt45wkBrCRBuRZyPuAguxIPe9lXqhpd9DcZMXOvdkPF0Xu/8dohNUmZ/1QQkuitXr+d4fryuFx3jywQYm6suAqSX8vLTXKJDt4QqO6rtLYspXWZ/nQQkOJTAUJZGIav19q9MvKvN1RUIWKMAY5P3EBBjqO393d4C/gMVHwRQlpx21QAAAABJRU5ErkJggg==\");background-repeat:no-repeat;background-position:50% 50%;background-size:50%;fill:#000}.taro-video-toast-volume .taro-video-toast-value{margin-left:10px;margin-top:5px;width:80px;height:5px}.taro-video-toast-volume .taro-video-toast-value>.taro-video-toast-value-content{overflow:hidden}.taro-video-toast-volume-grids{width:80px;height:5px}.taro-video-toast-volume-grids-item{float:left;width:7.1px;height:5px;background-color:#000}.taro-video-toast-volume-grids-item:not(:first-child){margin-left:1px}.taro-video-toast.taro-video-toast-progress{padding:6px;background-color:rgba(0, 0, 0, 0.8);line-height:18px;font-size:14px;color:#fff}";
|
|
27841
27814
|
|
|
27842
|
-
var __awaiter$1 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27843
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27844
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
27845
|
-
function fulfilled(value) { try {
|
|
27846
|
-
step(generator.next(value));
|
|
27847
|
-
}
|
|
27848
|
-
catch (e) {
|
|
27849
|
-
reject(e);
|
|
27850
|
-
} }
|
|
27851
|
-
function rejected(value) { try {
|
|
27852
|
-
step(generator["throw"](value));
|
|
27853
|
-
}
|
|
27854
|
-
catch (e) {
|
|
27855
|
-
reject(e);
|
|
27856
|
-
} }
|
|
27857
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
27858
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
27859
|
-
});
|
|
27860
|
-
};
|
|
27861
27815
|
let Video = class {
|
|
27862
27816
|
constructor(hostRef) {
|
|
27863
27817
|
index.registerInstance(this, hostRef);
|
|
@@ -28040,11 +27994,11 @@ let Video = class {
|
|
|
28040
27994
|
this.controlsRef.toggleVisibility();
|
|
28041
27995
|
this.onEnded.emit();
|
|
28042
27996
|
};
|
|
28043
|
-
this.handleTimeUpdate = index$2.throttle((e) =>
|
|
27997
|
+
this.handleTimeUpdate = index$2.throttle(async (e) => {
|
|
28044
27998
|
var _a, _b;
|
|
28045
27999
|
this.currentTime = this.videoRef.currentTime;
|
|
28046
28000
|
const duration = this.duration || this._duration;
|
|
28047
|
-
const isControlDragging =
|
|
28001
|
+
const isControlDragging = await this.controlsRef.getIsDraggingProgressBall();
|
|
28048
28002
|
if (this.controls && this.showProgress) {
|
|
28049
28003
|
if (!isControlDragging && !this.isDraggingProgress) {
|
|
28050
28004
|
this.controlsRef.setProgressBall(this.currentTime / duration);
|
|
@@ -28062,7 +28016,7 @@ let Video = class {
|
|
|
28062
28016
|
this.handleEnded();
|
|
28063
28017
|
}
|
|
28064
28018
|
}
|
|
28065
|
-
}
|
|
28019
|
+
}, 250);
|
|
28066
28020
|
this.handleError = e => {
|
|
28067
28021
|
var _a, _b;
|
|
28068
28022
|
if (this.hls) {
|
|
@@ -28193,31 +28147,29 @@ let Video = class {
|
|
|
28193
28147
|
watchSrc() {
|
|
28194
28148
|
this.init();
|
|
28195
28149
|
}
|
|
28196
|
-
onDocumentTouchMove(e) {
|
|
28197
|
-
|
|
28198
|
-
|
|
28199
|
-
|
|
28200
|
-
|
|
28201
|
-
|
|
28202
|
-
|
|
28203
|
-
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
|
|
28207
|
-
|
|
28208
|
-
|
|
28209
|
-
|
|
28210
|
-
|
|
28211
|
-
|
|
28212
|
-
|
|
28213
|
-
|
|
28214
|
-
this.controlsRef.toggleVisibility(true);
|
|
28215
|
-
}
|
|
28216
|
-
const duration = this.duration || this._duration;
|
|
28217
|
-
this.toastProgressTitleRef.innerHTML = `${formatTime(this.nextPercentage * duration)} / ${formatTime(duration)}`;
|
|
28218
|
-
this.toastProgressRef.style.visibility = 'visible';
|
|
28150
|
+
async onDocumentTouchMove(e) {
|
|
28151
|
+
if (this.lastTouchScreenX === undefined || this.lastTouchScreenY === undefined)
|
|
28152
|
+
return;
|
|
28153
|
+
if (await this.controlsRef.getIsDraggingProgressBall())
|
|
28154
|
+
return;
|
|
28155
|
+
const gestureObj = this.analyzeGesture(e);
|
|
28156
|
+
if (gestureObj.type === 'adjustVolume') {
|
|
28157
|
+
this.toastVolumeRef.style.visibility = 'visible';
|
|
28158
|
+
const nextVolume = Math.max(Math.min(this.lastVolume - gestureObj.dataY, 1), 0);
|
|
28159
|
+
this.videoRef.volume = nextVolume;
|
|
28160
|
+
this.toastVolumeBarRef.style.width = `${nextVolume * 100}%`;
|
|
28161
|
+
}
|
|
28162
|
+
else if (gestureObj.type === 'adjustProgress') {
|
|
28163
|
+
this.isDraggingProgress = true;
|
|
28164
|
+
this.nextPercentage = Math.max(Math.min(this.lastPercentage + gestureObj.dataX, 1), 0);
|
|
28165
|
+
if (this.controls && this.showProgress) {
|
|
28166
|
+
this.controlsRef.setProgressBall(this.nextPercentage);
|
|
28167
|
+
this.controlsRef.toggleVisibility(true);
|
|
28219
28168
|
}
|
|
28220
|
-
|
|
28169
|
+
const duration = this.duration || this._duration;
|
|
28170
|
+
this.toastProgressTitleRef.innerHTML = `${formatTime(this.nextPercentage * duration)} / ${formatTime(duration)}`;
|
|
28171
|
+
this.toastProgressRef.style.visibility = 'visible';
|
|
28172
|
+
}
|
|
28221
28173
|
}
|
|
28222
28174
|
onDocumentTouchEnd() {
|
|
28223
28175
|
var _a;
|
|
@@ -28236,40 +28188,28 @@ let Video = class {
|
|
|
28236
28188
|
this.lastTouchScreenY = undefined;
|
|
28237
28189
|
}
|
|
28238
28190
|
/** 播放视频 */
|
|
28239
|
-
play() {
|
|
28240
|
-
|
|
28241
|
-
this._play();
|
|
28242
|
-
});
|
|
28191
|
+
async play() {
|
|
28192
|
+
this._play();
|
|
28243
28193
|
}
|
|
28244
28194
|
/** 暂停视频 */
|
|
28245
|
-
pause() {
|
|
28246
|
-
|
|
28247
|
-
this._pause();
|
|
28248
|
-
});
|
|
28195
|
+
async pause() {
|
|
28196
|
+
this._pause();
|
|
28249
28197
|
}
|
|
28250
28198
|
/** 停止视频 */
|
|
28251
|
-
stop() {
|
|
28252
|
-
|
|
28253
|
-
this._stop();
|
|
28254
|
-
});
|
|
28199
|
+
async stop() {
|
|
28200
|
+
this._stop();
|
|
28255
28201
|
}
|
|
28256
28202
|
/** 跳转到指定位置 */
|
|
28257
|
-
seek(position) {
|
|
28258
|
-
|
|
28259
|
-
this._seek(position);
|
|
28260
|
-
});
|
|
28203
|
+
async seek(position) {
|
|
28204
|
+
this._seek(position);
|
|
28261
28205
|
}
|
|
28262
28206
|
/** 进入全屏。若有自定义内容需在全屏时展示,需将内容节点放置到 video 节点内。 */
|
|
28263
|
-
requestFullScreen() {
|
|
28264
|
-
|
|
28265
|
-
this.toggleFullScreen(true);
|
|
28266
|
-
});
|
|
28207
|
+
async requestFullScreen() {
|
|
28208
|
+
this.toggleFullScreen(true);
|
|
28267
28209
|
}
|
|
28268
28210
|
/** 退出全屏 */
|
|
28269
|
-
exitFullScreen() {
|
|
28270
|
-
|
|
28271
|
-
this.toggleFullScreen(false);
|
|
28272
|
-
});
|
|
28211
|
+
async exitFullScreen() {
|
|
28212
|
+
this.toggleFullScreen(false);
|
|
28273
28213
|
}
|
|
28274
28214
|
render() {
|
|
28275
28215
|
const { controls, autoplay, loop, muted, poster, objectFit, isFirst, isMute, isFullScreen, showCenterPlayBtn, isPlaying, _enableDanmu, showMuteBtn, danmuBtn, showFullscreenBtn, nativeProps } = this;
|
|
@@ -28323,25 +28263,6 @@ let Video = class {
|
|
|
28323
28263
|
};
|
|
28324
28264
|
Video.style = indexCss;
|
|
28325
28265
|
|
|
28326
|
-
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
28327
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28328
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28329
|
-
function fulfilled(value) { try {
|
|
28330
|
-
step(generator.next(value));
|
|
28331
|
-
}
|
|
28332
|
-
catch (e) {
|
|
28333
|
-
reject(e);
|
|
28334
|
-
} }
|
|
28335
|
-
function rejected(value) { try {
|
|
28336
|
-
step(generator["throw"](value));
|
|
28337
|
-
}
|
|
28338
|
-
catch (e) {
|
|
28339
|
-
reject(e);
|
|
28340
|
-
} }
|
|
28341
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
28342
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
28343
|
-
});
|
|
28344
|
-
};
|
|
28345
28266
|
let VideoDanmu = class {
|
|
28346
28267
|
constructor(hostRef) {
|
|
28347
28268
|
index.registerInstance(this, hostRef);
|
|
@@ -28360,51 +28281,47 @@ let VideoDanmu = class {
|
|
|
28360
28281
|
clonedDanmu.bottom = `${Math.random() * 90 + 5}%`;
|
|
28361
28282
|
return clonedDanmu;
|
|
28362
28283
|
}
|
|
28363
|
-
sendDanmu(danmuList = []) {
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
this.list
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
this.list
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
}
|
|
28378
|
-
});
|
|
28284
|
+
async sendDanmu(danmuList = []) {
|
|
28285
|
+
if (Array.isArray(danmuList)) {
|
|
28286
|
+
this.list = [
|
|
28287
|
+
...this.list,
|
|
28288
|
+
...danmuList.map(danmu => this.ensureProperties(danmu))
|
|
28289
|
+
];
|
|
28290
|
+
}
|
|
28291
|
+
else {
|
|
28292
|
+
const danmu = danmuList;
|
|
28293
|
+
this.list = [
|
|
28294
|
+
...this.list,
|
|
28295
|
+
Object.assign({}, this.ensureProperties(danmu))
|
|
28296
|
+
];
|
|
28297
|
+
}
|
|
28379
28298
|
}
|
|
28380
|
-
tick(currentTime) {
|
|
28381
|
-
|
|
28382
|
-
|
|
28383
|
-
|
|
28384
|
-
|
|
28385
|
-
|
|
28386
|
-
|
|
28387
|
-
|
|
28388
|
-
|
|
28389
|
-
|
|
28390
|
-
return currentTime - time < 4 && currentTime > time;
|
|
28391
|
-
});
|
|
28392
|
-
let shouldUpdate = false;
|
|
28393
|
-
const oldDanmuList = this.danmuList;
|
|
28394
|
-
if (newDanmuList.length !== oldDanmuList.length) {
|
|
28395
|
-
shouldUpdate = true;
|
|
28396
|
-
}
|
|
28397
|
-
else {
|
|
28398
|
-
shouldUpdate = newDanmuList.some(({ key }) => {
|
|
28399
|
-
return oldDanmuList.every((danmu) => {
|
|
28400
|
-
return key !== danmu.key;
|
|
28401
|
-
});
|
|
28402
|
-
});
|
|
28403
|
-
}
|
|
28404
|
-
if (shouldUpdate) {
|
|
28405
|
-
this.danmuList = newDanmuList;
|
|
28406
|
-
}
|
|
28299
|
+
async tick(currentTime) {
|
|
28300
|
+
this.currentTime = currentTime;
|
|
28301
|
+
if (!this.enable)
|
|
28302
|
+
return;
|
|
28303
|
+
const danmuList = this.list;
|
|
28304
|
+
/**
|
|
28305
|
+
* @todo 这个判断对拖拽进度的处理不严谨
|
|
28306
|
+
*/
|
|
28307
|
+
const newDanmuList = danmuList.filter(({ time }) => {
|
|
28308
|
+
return currentTime - time < 4 && currentTime > time;
|
|
28407
28309
|
});
|
|
28310
|
+
let shouldUpdate = false;
|
|
28311
|
+
const oldDanmuList = this.danmuList;
|
|
28312
|
+
if (newDanmuList.length !== oldDanmuList.length) {
|
|
28313
|
+
shouldUpdate = true;
|
|
28314
|
+
}
|
|
28315
|
+
else {
|
|
28316
|
+
shouldUpdate = newDanmuList.some(({ key }) => {
|
|
28317
|
+
return oldDanmuList.every((danmu) => {
|
|
28318
|
+
return key !== danmu.key;
|
|
28319
|
+
});
|
|
28320
|
+
});
|
|
28321
|
+
}
|
|
28322
|
+
if (shouldUpdate) {
|
|
28323
|
+
this.danmuList = newDanmuList;
|
|
28324
|
+
}
|
|
28408
28325
|
}
|
|
28409
28326
|
componentDidUpdate() {
|
|
28410
28327
|
requestAnimationFrame(() => {
|
|
@@ -12,6 +12,11 @@ export class Button {
|
|
|
12
12
|
this.hover = false;
|
|
13
13
|
this.touch = false;
|
|
14
14
|
}
|
|
15
|
+
onClick(e) {
|
|
16
|
+
if (this.disabled) {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
15
20
|
onTouchStart() {
|
|
16
21
|
if (this.disabled) {
|
|
17
22
|
return;
|
|
@@ -258,6 +263,12 @@ export class Button {
|
|
|
258
263
|
}]; }
|
|
259
264
|
static get elementRef() { return "el"; }
|
|
260
265
|
static get listeners() { return [{
|
|
266
|
+
"name": "click",
|
|
267
|
+
"method": "onClick",
|
|
268
|
+
"target": undefined,
|
|
269
|
+
"capture": false,
|
|
270
|
+
"passive": false
|
|
271
|
+
}, {
|
|
261
272
|
"name": "touchstart",
|
|
262
273
|
"method": "onTouchStart",
|
|
263
274
|
"target": undefined,
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
2
|
import { Component, h, Host, Prop, Event, Element, Watch, Method } from '@stencil/core';
|
|
12
3
|
export class MovableView {
|
|
@@ -273,38 +264,32 @@ export class MovableView {
|
|
|
273
264
|
/**
|
|
274
265
|
* 设置父节点
|
|
275
266
|
*/
|
|
276
|
-
setParent({ element, area }) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.setOriginScale(scale);
|
|
286
|
-
});
|
|
267
|
+
async setParent({ element, area }) {
|
|
268
|
+
const scale = this.scale ? this.scaleValue : 1;
|
|
269
|
+
this.area = area;
|
|
270
|
+
this.parent = element;
|
|
271
|
+
this.updateOffset();
|
|
272
|
+
this.updateScaleOffset(scale);
|
|
273
|
+
this.updateBoundary();
|
|
274
|
+
this.setTransform(Number(this.x) + this.scaleOffset.x, Number(this.y) + this.scaleOffset.y, scale, "", true);
|
|
275
|
+
this.setOriginScale(scale);
|
|
287
276
|
}
|
|
288
277
|
/**
|
|
289
278
|
* 结束缩放
|
|
290
279
|
*/
|
|
291
|
-
endScale() {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.setOriginScale(this.currentScale);
|
|
295
|
-
});
|
|
280
|
+
async endScale() {
|
|
281
|
+
this.scaling = false;
|
|
282
|
+
this.setOriginScale(this.currentScale);
|
|
296
283
|
}
|
|
297
284
|
/**
|
|
298
285
|
* 更新缩放
|
|
299
286
|
*/
|
|
300
|
-
setScale(scale) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
this.updateScale(scale * this.originScale);
|
|
307
|
-
});
|
|
287
|
+
async setScale(scale) {
|
|
288
|
+
if (!this.scale) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
this.scaling = true;
|
|
292
|
+
this.updateScale(scale * this.originScale);
|
|
308
293
|
}
|
|
309
294
|
connectedCallback() {
|
|
310
295
|
this.observer = new MutationObserver((mutations) => {
|
|
@@ -60,6 +60,10 @@ export class Swiper {
|
|
|
60
60
|
* 给 previewImage API 使用,全屏显示 swiper
|
|
61
61
|
*/
|
|
62
62
|
this.full = false;
|
|
63
|
+
/**
|
|
64
|
+
* 给 previewImage API 使用,缩放支持
|
|
65
|
+
*/
|
|
66
|
+
this.zoom = false;
|
|
63
67
|
this.handleSwiperLoopListen = () => {
|
|
64
68
|
var _a, _b;
|
|
65
69
|
((_a = this.observerFirst) === null || _a === void 0 ? void 0 : _a.disconnect) && this.observerFirst.disconnect();
|
|
@@ -209,6 +213,7 @@ export class Swiper {
|
|
|
209
213
|
speed: duration,
|
|
210
214
|
observer: true,
|
|
211
215
|
observeParents: true,
|
|
216
|
+
zoom: this.zoom,
|
|
212
217
|
on: {
|
|
213
218
|
slideTo() {
|
|
214
219
|
that.current = this.realIndex;
|
|
@@ -532,6 +537,24 @@ export class Swiper {
|
|
|
532
537
|
"attribute": "full",
|
|
533
538
|
"reflect": false,
|
|
534
539
|
"defaultValue": "false"
|
|
540
|
+
},
|
|
541
|
+
"zoom": {
|
|
542
|
+
"type": "boolean",
|
|
543
|
+
"mutable": false,
|
|
544
|
+
"complexType": {
|
|
545
|
+
"original": "boolean",
|
|
546
|
+
"resolved": "boolean",
|
|
547
|
+
"references": {}
|
|
548
|
+
},
|
|
549
|
+
"required": false,
|
|
550
|
+
"optional": false,
|
|
551
|
+
"docs": {
|
|
552
|
+
"tags": [],
|
|
553
|
+
"text": "\u7ED9 previewImage API \u4F7F\u7528\uFF0C\u7F29\u653E\u652F\u6301"
|
|
554
|
+
},
|
|
555
|
+
"attribute": "zoom",
|
|
556
|
+
"reflect": false,
|
|
557
|
+
"defaultValue": "false"
|
|
535
558
|
}
|
|
536
559
|
}; }
|
|
537
560
|
static get states() { return {
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11
2
|
import { Component, h, Prop, Host, Element, Listen, Method } from '@stencil/core';
|
|
12
3
|
import { formatTime } from './utils';
|
|
@@ -51,40 +42,32 @@ export class VideoControl {
|
|
|
51
42
|
this.seekFunc(this.percentage * this.duration);
|
|
52
43
|
this.toggleVisibility(true);
|
|
53
44
|
}
|
|
54
|
-
setProgressBall(percentage) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
});
|
|
45
|
+
async setProgressBall(percentage) {
|
|
46
|
+
if (this.progressBallRef) {
|
|
47
|
+
this.progressBallRef.style.left = `${percentage * 100}%`;
|
|
48
|
+
}
|
|
60
49
|
}
|
|
61
|
-
toggleVisibility(nextVisible) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
}, 2000);
|
|
70
|
-
}
|
|
71
|
-
this.el.style.visibility = 'visible';
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.el.style.visibility = 'hidden';
|
|
50
|
+
async toggleVisibility(nextVisible) {
|
|
51
|
+
const visible = nextVisible === undefined ? !this.visible : nextVisible;
|
|
52
|
+
if (visible) {
|
|
53
|
+
this.hideControlsTimer && clearTimeout(this.hideControlsTimer);
|
|
54
|
+
if (this.isPlaying) {
|
|
55
|
+
this.hideControlsTimer = setTimeout(() => {
|
|
56
|
+
this.toggleVisibility(false);
|
|
57
|
+
}, 2000);
|
|
75
58
|
}
|
|
76
|
-
this.
|
|
77
|
-
}
|
|
59
|
+
this.el.style.visibility = 'visible';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.el.style.visibility = 'hidden';
|
|
63
|
+
}
|
|
64
|
+
this.visible = !!visible;
|
|
78
65
|
}
|
|
79
|
-
getIsDraggingProgressBall() {
|
|
80
|
-
return
|
|
81
|
-
return this.isDraggingProgressBall;
|
|
82
|
-
});
|
|
66
|
+
async getIsDraggingProgressBall() {
|
|
67
|
+
return this.isDraggingProgressBall;
|
|
83
68
|
}
|
|
84
|
-
setCurrentTime(time) {
|
|
85
|
-
|
|
86
|
-
this.currentTimeRef.innerHTML = formatTime(time);
|
|
87
|
-
});
|
|
69
|
+
async setCurrentTime(time) {
|
|
70
|
+
this.currentTimeRef.innerHTML = formatTime(time);
|
|
88
71
|
}
|
|
89
72
|
render() {
|
|
90
73
|
const { controls, currentTime, duration, isPlaying, pauseFunc, playFunc, showPlayBtn, showProgress } = this;
|