@nutui/nutui 4.0.10-beta.1 → 4.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6316 -7237
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +148 -45
- package/dist/styles/themes/jdb.scss +148 -45
- package/dist/styles/themes/jddkh.scss +148 -45
- package/dist/styles/themes/jdt.scss +148 -45
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,44 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { reactive, ref, computed, watch, nextTick, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, createCommentVNode, withDirectives, vShow, normalizeClass, toDisplayString, normalizeStyle, withModifiers } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var I = Object.defineProperty, G = Object.defineProperties;
|
|
2
|
+
var J = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var k = Object.getOwnPropertySymbols;
|
|
4
|
+
var K = Object.prototype.hasOwnProperty, Q = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var B = (o, t, e) => t in o ? I(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e, c = (o, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
K.call(t, e) && B(o, e, t[e]);
|
|
8
|
+
if (k)
|
|
9
|
+
for (var e of k(t))
|
|
10
|
+
Q.call(t, e) && B(o, e, t[e]);
|
|
11
|
+
return o;
|
|
12
|
+
}, C = (o, t) => G(o, J(t));
|
|
13
|
+
import { reactive as U, ref as W, computed as Y, watch as $, nextTick as Z, onMounted as _, toRefs as D, openBlock as f, createElementBlock as y, createElementVNode as r, createCommentVNode as L, withDirectives as E, vShow as g, normalizeClass as X, toDisplayString as v, normalizeStyle as R, withModifiers as h } from "vue";
|
|
14
|
+
import { c as x } from "./component-234624bc.js";
|
|
15
|
+
import { _ as ee } from "./_plugin-vue_export-helper-dad06003.js";
|
|
23
16
|
import "../locale/lang";
|
|
24
|
-
function
|
|
25
|
-
let
|
|
26
|
-
let startTime = Date.now();
|
|
17
|
+
function A(o, t) {
|
|
18
|
+
let e = null, a = Date.now();
|
|
27
19
|
return function() {
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
if (timer)
|
|
31
|
-
clearTimeout(timer);
|
|
32
|
-
if (remaining <= 0) {
|
|
33
|
-
fn.apply(null, arguments);
|
|
34
|
-
startTime = Date.now();
|
|
35
|
-
} else {
|
|
36
|
-
timer = setTimeout(fn, remaining);
|
|
37
|
-
}
|
|
20
|
+
let p = Date.now(), u = t - (p - a);
|
|
21
|
+
e && clearTimeout(e), u <= 0 ? (o.apply(null, arguments), a = Date.now()) : e = setTimeout(o, u);
|
|
38
22
|
};
|
|
39
23
|
}
|
|
40
|
-
const { create, translate } =
|
|
41
|
-
const _sfc_main = create({
|
|
24
|
+
const { create: oe, translate: te } = x("video"), le = oe({
|
|
42
25
|
props: {
|
|
43
26
|
source: {
|
|
44
27
|
type: Object,
|
|
@@ -47,22 +30,22 @@ const _sfc_main = create({
|
|
|
47
30
|
options: {
|
|
48
31
|
type: Object,
|
|
49
32
|
default: {
|
|
50
|
-
autoplay:
|
|
33
|
+
autoplay: !1,
|
|
51
34
|
//是否自动播放
|
|
52
35
|
volume: 0.5,
|
|
53
36
|
poster: "",
|
|
54
|
-
loop:
|
|
55
|
-
controls:
|
|
56
|
-
muted:
|
|
37
|
+
loop: !1,
|
|
38
|
+
controls: !0,
|
|
39
|
+
muted: !1,
|
|
57
40
|
//是否静音
|
|
58
|
-
disabled:
|
|
41
|
+
disabled: !1,
|
|
59
42
|
//禁止操作
|
|
60
|
-
playsinline:
|
|
43
|
+
playsinline: !1,
|
|
61
44
|
//行内展示
|
|
62
|
-
touchPlay:
|
|
45
|
+
touchPlay: !1,
|
|
63
46
|
preload: ""
|
|
64
47
|
},
|
|
65
|
-
required:
|
|
48
|
+
required: !0
|
|
66
49
|
},
|
|
67
50
|
model: {
|
|
68
51
|
type: String,
|
|
@@ -71,12 +54,12 @@ const _sfc_main = create({
|
|
|
71
54
|
},
|
|
72
55
|
components: {},
|
|
73
56
|
emits: ["click", "play", "pause", "playend", "time"],
|
|
74
|
-
setup(
|
|
75
|
-
const
|
|
57
|
+
setup(o, { emit: t }) {
|
|
58
|
+
const e = U({
|
|
76
59
|
videoElm: null,
|
|
77
|
-
initial:
|
|
60
|
+
initial: !0,
|
|
78
61
|
//控制封面的显示
|
|
79
|
-
showToolbox:
|
|
62
|
+
showToolbox: !1,
|
|
80
63
|
//控制控制器和标题的显示
|
|
81
64
|
// 视频容器元素
|
|
82
65
|
player: {
|
|
@@ -105,322 +88,214 @@ const _sfc_main = create({
|
|
|
105
88
|
}
|
|
106
89
|
},
|
|
107
90
|
state: {
|
|
108
|
-
controlShow:
|
|
91
|
+
controlShow: !0,
|
|
109
92
|
vol: 0.5,
|
|
110
93
|
//音量
|
|
111
94
|
currentTime: 0,
|
|
112
95
|
//当前时间
|
|
113
|
-
fullScreen:
|
|
114
|
-
playing:
|
|
96
|
+
fullScreen: !1,
|
|
97
|
+
playing: !1,
|
|
115
98
|
//是否正在播放
|
|
116
|
-
isLoading:
|
|
117
|
-
isEnd:
|
|
118
|
-
isError:
|
|
119
|
-
isMuted:
|
|
99
|
+
isLoading: !1,
|
|
100
|
+
isEnd: !1,
|
|
101
|
+
isError: !1,
|
|
102
|
+
isMuted: !1
|
|
120
103
|
},
|
|
121
|
-
showTouchMask:
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
(newValue) => {
|
|
130
|
-
if (newValue.src) {
|
|
131
|
-
nextTick(() => {
|
|
132
|
-
state.videoElm.load();
|
|
133
|
-
});
|
|
134
|
-
}
|
|
104
|
+
showTouchMask: !1
|
|
105
|
+
}), a = W(null), p = Y(() => o.options.disabled);
|
|
106
|
+
$(
|
|
107
|
+
() => o.source,
|
|
108
|
+
(s) => {
|
|
109
|
+
s.src && Z(() => {
|
|
110
|
+
e.videoElm.load();
|
|
111
|
+
});
|
|
135
112
|
},
|
|
136
|
-
{ immediate:
|
|
137
|
-
)
|
|
138
|
-
|
|
139
|
-
() =>
|
|
140
|
-
|
|
141
|
-
state.state.isMuted = newValue ? newValue.muted : false;
|
|
113
|
+
{ immediate: !0, deep: !0 }
|
|
114
|
+
), $(
|
|
115
|
+
() => o.options,
|
|
116
|
+
(s) => {
|
|
117
|
+
e.state.isMuted = s ? s.muted : !1;
|
|
142
118
|
},
|
|
143
|
-
{ immediate:
|
|
119
|
+
{ immediate: !0 }
|
|
144
120
|
);
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
state.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
volumeHandle();
|
|
162
|
-
if (state.showToolbox) {
|
|
163
|
-
customerInit();
|
|
164
|
-
} else {
|
|
165
|
-
state.videoElm.addEventListener("play", () => {
|
|
166
|
-
state.state.playing = true;
|
|
167
|
-
emit("play", state.videoElm);
|
|
168
|
-
});
|
|
169
|
-
state.videoElm.addEventListener("pause", () => {
|
|
170
|
-
state.state.playing = false;
|
|
171
|
-
emit("pause", state.videoElm);
|
|
172
|
-
});
|
|
173
|
-
state.videoElm.addEventListener("ended", playEnded);
|
|
174
|
-
state.videoElm.addEventListener("timeupdate", throttle(getPlayTime, 1e3));
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
const customerInit = () => {
|
|
178
|
-
const $player = root.value;
|
|
179
|
-
const $progress = root.value.getElementsByClassName("nut-video-controller__progress-value")[0];
|
|
180
|
-
state.player.$player = $player;
|
|
181
|
-
state.progressBar.progressElm = $progress;
|
|
182
|
-
state.progressBar.pos = $progress.getBoundingClientRect();
|
|
183
|
-
state.videoSet.progress.width = Math.round($progress.getBoundingClientRect().width);
|
|
184
|
-
};
|
|
185
|
-
const play = () => {
|
|
186
|
-
if (props.options.autoplay && props.options.disabled) {
|
|
187
|
-
state.state.playing = true;
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
state.state.playing = !state.state.playing;
|
|
191
|
-
if (state.videoElm) {
|
|
192
|
-
if (state.state.playing) {
|
|
121
|
+
const u = () => {
|
|
122
|
+
e.videoElm = a.value, o.options.autoplay && setTimeout(() => {
|
|
123
|
+
e.videoElm.play();
|
|
124
|
+
}, 200), o.options.touchPlay && (e.showTouchMask = !0), o.options.playsinline && (e.videoElm.setAttribute("playsinline", o.options.playsinline), e.videoElm.setAttribute("webkit-playsinline", o.options.playsinline), e.videoElm.setAttribute("x5-video-player-type", "h5-page"), e.videoElm.setAttribute("x5-video-player-fullscreen", !1)), N(), e.showToolbox ? l() : (e.videoElm.addEventListener("play", () => {
|
|
125
|
+
e.state.playing = !0, t("play", e.videoElm);
|
|
126
|
+
}), e.videoElm.addEventListener("pause", () => {
|
|
127
|
+
e.state.playing = !1, t("pause", e.videoElm);
|
|
128
|
+
}), e.videoElm.addEventListener("ended", w), e.videoElm.addEventListener("timeupdate", A(T, 1e3)));
|
|
129
|
+
}, l = () => {
|
|
130
|
+
const s = a.value, n = a.value.getElementsByClassName("nut-video-controller__progress-value")[0];
|
|
131
|
+
e.player.$player = s, e.progressBar.progressElm = n, e.progressBar.pos = n.getBoundingClientRect(), e.videoSet.progress.width = Math.round(n.getBoundingClientRect().width);
|
|
132
|
+
}, P = () => {
|
|
133
|
+
if (o.options.autoplay && o.options.disabled)
|
|
134
|
+
return e.state.playing = !0, !1;
|
|
135
|
+
if (e.state.playing = !e.state.playing, e.videoElm)
|
|
136
|
+
if (e.state.playing)
|
|
193
137
|
try {
|
|
194
138
|
setTimeout(() => {
|
|
195
|
-
|
|
196
|
-
}, 200)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
state.videoElm.addEventListener("ended", playEnded);
|
|
202
|
-
emit("play", state.videoElm);
|
|
203
|
-
} catch (e) {
|
|
204
|
-
handleError();
|
|
139
|
+
e.videoElm.play();
|
|
140
|
+
}, 200), e.videoElm.addEventListener("progress", () => {
|
|
141
|
+
F();
|
|
142
|
+
}), e.videoElm.addEventListener("timeupdate", A(T, 1e3)), e.videoElm.addEventListener("ended", w), t("play", e.videoElm);
|
|
143
|
+
} catch (s) {
|
|
144
|
+
b();
|
|
205
145
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
146
|
+
else
|
|
147
|
+
e.videoElm.pause(), t("pause", e.videoElm);
|
|
148
|
+
}, S = (s) => {
|
|
149
|
+
var n = Math.floor(s / 3600);
|
|
150
|
+
n < 10 && (n = "0" + n);
|
|
151
|
+
var i = Math.floor(s % 3600 / 60);
|
|
152
|
+
i < 10 && (i = "0" + i);
|
|
153
|
+
var d = Math.round(s % 3600 % 60);
|
|
154
|
+
d < 10 && (d = "0" + d);
|
|
155
|
+
var m = "";
|
|
156
|
+
return n != 0 ? m = n + ":" + i + ":" + d : m = i + ":" + d, m;
|
|
157
|
+
}, F = () => {
|
|
158
|
+
e.videoSet.loaded && (e.videoSet.loaded = e.videoElm.buffered.end(0) / e.videoElm.duration * 100);
|
|
159
|
+
}, T = () => {
|
|
160
|
+
const s = e.videoElm.currentTime / e.videoElm.duration;
|
|
161
|
+
e.videoSet.progress.current = Math.round(e.videoSet.progress.width * s), e.videoSet.totalTime = S(e.videoElm.duration), e.videoSet.displayTime = S(e.videoElm.currentTime), t("time", e.videoSet.displayTime, e.videoSet.totalTime);
|
|
162
|
+
}, w = () => {
|
|
163
|
+
e.state.playing = !1, e.state.isEnd = !0, e.videoSet.displayTime = "00:00", e.videoSet.progress.current = 0, e.videoElm.currentTime = 0, t("playend", e.videoElm);
|
|
164
|
+
}, b = () => {
|
|
165
|
+
e.state.isError = !0;
|
|
166
|
+
}, N = () => {
|
|
167
|
+
e.state.vol = o.options.volume;
|
|
168
|
+
}, j = () => {
|
|
169
|
+
e.state.isMuted = !e.state.isMuted, e.videoElm.muted = e.state.isMuted;
|
|
170
|
+
}, q = () => {
|
|
171
|
+
}, z = (s) => {
|
|
172
|
+
let i = s.targetTouches[0].pageX - e.progressBar.pos.left;
|
|
173
|
+
i <= 0 && (i = 0), i >= e.videoSet.progress.width && (i = e.videoSet.progress.width), e.videoSet.progress.current = i;
|
|
174
|
+
let d = e.videoSet.progress.current / e.videoSet.progress.width;
|
|
175
|
+
e.videoElm.duration && M(d, e.videoElm.duration);
|
|
176
|
+
}, O = (s) => {
|
|
177
|
+
let i = s.changedTouches[0].pageX - e.progressBar.pos.left;
|
|
178
|
+
e.videoSet.progress.current = i;
|
|
179
|
+
let d = i / e.videoSet.progress.width;
|
|
180
|
+
e.videoElm.duration && M(d, e.videoElm.duration);
|
|
181
|
+
}, M = (s, n) => {
|
|
182
|
+
e.videoElm.currentTime = Math.floor(s * n);
|
|
183
|
+
}, V = () => {
|
|
184
|
+
e.state.isError = !1, u();
|
|
185
|
+
}, H = () => {
|
|
186
|
+
e.state.fullScreen ? (e.state.fullScreen = !1, document.webkitCancelFullScreen()) : (e.state.fullScreen = !0, e.videoElm.webkitRequestFullScreen());
|
|
236
187
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const handleError = () => {
|
|
253
|
-
state.state.isError = true;
|
|
254
|
-
};
|
|
255
|
-
const volumeHandle = () => {
|
|
256
|
-
state.state.vol = props.options.volume;
|
|
257
|
-
};
|
|
258
|
-
const handleMuted = () => {
|
|
259
|
-
state.state.isMuted = !state.state.isMuted;
|
|
260
|
-
state.videoElm.muted = state.state.isMuted;
|
|
261
|
-
};
|
|
262
|
-
const touchSlidSrart = () => {
|
|
263
|
-
};
|
|
264
|
-
const touchSlidMove = (e) => {
|
|
265
|
-
let currentX = e.targetTouches[0].pageX;
|
|
266
|
-
let offsetX = currentX - state.progressBar.pos.left;
|
|
267
|
-
if (offsetX <= 0) {
|
|
268
|
-
offsetX = 0;
|
|
269
|
-
}
|
|
270
|
-
if (offsetX >= state.videoSet.progress.width) {
|
|
271
|
-
offsetX = state.videoSet.progress.width;
|
|
272
|
-
}
|
|
273
|
-
state.videoSet.progress.current = offsetX;
|
|
274
|
-
let percent = state.videoSet.progress.current / state.videoSet.progress.width;
|
|
275
|
-
state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
|
|
276
|
-
};
|
|
277
|
-
const touchSlidEnd = (e) => {
|
|
278
|
-
let currentX = e.changedTouches[0].pageX;
|
|
279
|
-
let offsetX = currentX - state.progressBar.pos.left;
|
|
280
|
-
state.videoSet.progress.current = offsetX;
|
|
281
|
-
let percent = offsetX / state.videoSet.progress.width;
|
|
282
|
-
state.videoElm.duration && setPlayTime(percent, state.videoElm.duration);
|
|
283
|
-
};
|
|
284
|
-
const setPlayTime = (percent, totalTime) => {
|
|
285
|
-
state.videoElm.currentTime = Math.floor(percent * totalTime);
|
|
286
|
-
};
|
|
287
|
-
const retry = () => {
|
|
288
|
-
state.state.isError = false;
|
|
289
|
-
init();
|
|
290
|
-
};
|
|
291
|
-
const fullScreen = () => {
|
|
292
|
-
if (!state.state.fullScreen) {
|
|
293
|
-
state.state.fullScreen = true;
|
|
294
|
-
state.videoElm.webkitRequestFullScreen();
|
|
295
|
-
} else {
|
|
296
|
-
state.state.fullScreen = false;
|
|
297
|
-
document.webkitCancelFullScreen();
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
onMounted(() => {
|
|
301
|
-
init();
|
|
302
|
-
});
|
|
303
|
-
return __spreadProps(__spreadValues(__spreadValues({
|
|
304
|
-
root
|
|
305
|
-
}, toRefs(props)), toRefs(state)), {
|
|
306
|
-
handleError,
|
|
307
|
-
isDisabled,
|
|
308
|
-
play,
|
|
309
|
-
handleMuted,
|
|
310
|
-
touchSlidSrart,
|
|
311
|
-
touchSlidMove,
|
|
312
|
-
touchSlidEnd,
|
|
313
|
-
retry,
|
|
314
|
-
fullScreen,
|
|
315
|
-
translate
|
|
188
|
+
return _(() => {
|
|
189
|
+
u();
|
|
190
|
+
}), C(c(c({
|
|
191
|
+
root: a
|
|
192
|
+
}, D(o)), D(e)), {
|
|
193
|
+
handleError: b,
|
|
194
|
+
isDisabled: p,
|
|
195
|
+
play: P,
|
|
196
|
+
handleMuted: j,
|
|
197
|
+
touchSlidSrart: q,
|
|
198
|
+
touchSlidMove: z,
|
|
199
|
+
touchSlidEnd: O,
|
|
200
|
+
retry: V,
|
|
201
|
+
fullScreen: H,
|
|
202
|
+
translate: te
|
|
316
203
|
});
|
|
317
204
|
}
|
|
318
|
-
})
|
|
319
|
-
const _hoisted_1 = {
|
|
205
|
+
}), se = {
|
|
320
206
|
class: "nut-video",
|
|
321
207
|
ref: "videocon"
|
|
322
|
-
}
|
|
323
|
-
const _hoisted_2 = ["muted", "autoplay", "loop", "poster", "controls", "preload"];
|
|
324
|
-
const _hoisted_3 = ["src", "type"];
|
|
325
|
-
const _hoisted_4 = { class: "nut-video-controller__now" };
|
|
326
|
-
const _hoisted_5 = { class: "nut-video-controller__progress" };
|
|
327
|
-
const _hoisted_6 = {
|
|
208
|
+
}, re = ["muted", "autoplay", "loop", "poster", "controls", "preload"], ie = ["src", "type"], ne = { class: "nut-video-controller__now" }, de = { class: "nut-video-controller__progress" }, ae = {
|
|
328
209
|
class: "nut-video-controller__progress-value",
|
|
329
210
|
ref: "progressBar"
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
_hoisted_7
|
|
334
|
-
];
|
|
335
|
-
const _hoisted_9 = {
|
|
211
|
+
}, ue = /* @__PURE__ */ r("div", { class: "nut-video-controller__ball-move" }, null, -1), pe = [
|
|
212
|
+
ue
|
|
213
|
+
], ve = {
|
|
336
214
|
class: "nut-video-controller__played",
|
|
337
215
|
ref: "playedBar"
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
343
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
344
|
-
createElementVNode("video", {
|
|
216
|
+
}, me = { class: "nut-video-controller__total" }, ce = { class: "nut-video-error" }, fe = { class: "nut-video-error-tip" };
|
|
217
|
+
function ye(o, t, e, a, p, u) {
|
|
218
|
+
return f(), y("div", se, [
|
|
219
|
+
r("video", {
|
|
345
220
|
ref: "root",
|
|
346
221
|
class: "nut-video-player",
|
|
347
|
-
muted:
|
|
348
|
-
autoplay:
|
|
349
|
-
loop:
|
|
350
|
-
poster:
|
|
351
|
-
controls:
|
|
352
|
-
preload:
|
|
353
|
-
onError:
|
|
222
|
+
muted: o.options.muted,
|
|
223
|
+
autoplay: o.options.autoplay,
|
|
224
|
+
loop: o.options.loop,
|
|
225
|
+
poster: o.options.poster,
|
|
226
|
+
controls: o.options.controls,
|
|
227
|
+
preload: o.options.preload,
|
|
228
|
+
onError: t[0] || (t[0] = (...l) => o.handleError && o.handleError(...l))
|
|
354
229
|
}, [
|
|
355
|
-
|
|
356
|
-
src:
|
|
357
|
-
type:
|
|
358
|
-
}, null, 8,
|
|
359
|
-
], 40,
|
|
360
|
-
|
|
230
|
+
r("source", {
|
|
231
|
+
src: o.source.src,
|
|
232
|
+
type: o.source.type
|
|
233
|
+
}, null, 8, ie)
|
|
234
|
+
], 40, re),
|
|
235
|
+
o.showToolbox && !o.isDisabled ? (f(), y("div", {
|
|
361
236
|
key: 0,
|
|
362
237
|
class: "nut-video-mask",
|
|
363
238
|
ref: "touchMask",
|
|
364
|
-
onClick:
|
|
365
|
-
}, null, 512)) :
|
|
366
|
-
|
|
239
|
+
onClick: t[1] || (t[1] = (...l) => o.play && o.play(...l))
|
|
240
|
+
}, null, 512)) : L("", !0),
|
|
241
|
+
o.showToolbox && !o.isDisabled ? E((f(), y("div", {
|
|
367
242
|
key: 1,
|
|
368
243
|
class: "nut-video-play-btn",
|
|
369
244
|
ref: "palyBtn",
|
|
370
|
-
onClick:
|
|
245
|
+
onClick: t[2] || (t[2] = (...l) => o.play && o.play(...l))
|
|
371
246
|
}, null, 512)), [
|
|
372
|
-
[
|
|
373
|
-
]) :
|
|
374
|
-
|
|
375
|
-
class:
|
|
247
|
+
[g, !o.state.playing]
|
|
248
|
+
]) : L("", !0),
|
|
249
|
+
E(r("div", {
|
|
250
|
+
class: X(["nut-video-controller", { "nut-video-controller--show": !o.state.playing, "nut-video-controller--hide": o.state.playing }])
|
|
376
251
|
}, [
|
|
377
|
-
|
|
252
|
+
r("div", {
|
|
378
253
|
class: "nut-video-controller__playbtn",
|
|
379
|
-
onClick:
|
|
254
|
+
onClick: t[3] || (t[3] = (...l) => o.play && o.play(...l))
|
|
380
255
|
}),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
256
|
+
r("div", ne, v(o.videoSet.displayTime), 1),
|
|
257
|
+
r("div", de, [
|
|
258
|
+
r("div", ae, [
|
|
259
|
+
r("div", {
|
|
385
260
|
class: "buffered",
|
|
386
|
-
style:
|
|
261
|
+
style: R({ width: `${o.videoSet.loaded}%` })
|
|
387
262
|
}, null, 4),
|
|
388
|
-
|
|
263
|
+
r("div", {
|
|
389
264
|
class: "nut-video-controller__ball",
|
|
390
|
-
style:
|
|
391
|
-
transform: `translate3d(${
|
|
265
|
+
style: R({
|
|
266
|
+
transform: `translate3d(${o.videoSet.progress.current}px, -50%, 0)`
|
|
392
267
|
}),
|
|
393
|
-
onTouchmove:
|
|
394
|
-
onTouchstart:
|
|
395
|
-
onTouchend:
|
|
396
|
-
},
|
|
397
|
-
|
|
268
|
+
onTouchmove: t[4] || (t[4] = h((l) => o.touchSlidMove(l), ["stop", "prevent"])),
|
|
269
|
+
onTouchstart: t[5] || (t[5] = h((l) => o.touchSlidSrart(), ["stop"])),
|
|
270
|
+
onTouchend: t[6] || (t[6] = h((l) => o.touchSlidEnd(l), ["stop"]))
|
|
271
|
+
}, pe, 36),
|
|
272
|
+
r("div", ve, null, 512)
|
|
398
273
|
], 512)
|
|
399
274
|
]),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
class:
|
|
403
|
-
onClick:
|
|
275
|
+
r("div", me, v(o.videoSet.totalTime), 1),
|
|
276
|
+
r("div", {
|
|
277
|
+
class: X(["nut-video-controller__volume", { muted: o.state.isMuted }]),
|
|
278
|
+
onClick: t[7] || (t[7] = (...l) => o.handleMuted && o.handleMuted(...l))
|
|
404
279
|
}, null, 2),
|
|
405
|
-
|
|
280
|
+
r("div", {
|
|
406
281
|
class: "nut-video-controller__full",
|
|
407
|
-
onClick:
|
|
282
|
+
onClick: t[8] || (t[8] = (...l) => o.fullScreen && o.fullScreen(...l))
|
|
408
283
|
})
|
|
409
284
|
], 2), [
|
|
410
|
-
[
|
|
285
|
+
[g, o.showToolbox && !o.isDisabled]
|
|
411
286
|
]),
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
287
|
+
E(r("div", ce, [
|
|
288
|
+
r("p", fe, v(o.translate("errorTip")), 1),
|
|
289
|
+
r("p", {
|
|
415
290
|
class: "nut-video-error-retry",
|
|
416
|
-
onClick:
|
|
417
|
-
},
|
|
291
|
+
onClick: t[9] || (t[9] = (...l) => o.retry && o.retry(...l))
|
|
292
|
+
}, v(o.translate("clickRetry")), 1)
|
|
418
293
|
], 512), [
|
|
419
|
-
[
|
|
294
|
+
[g, o.state.isError]
|
|
420
295
|
])
|
|
421
296
|
], 512);
|
|
422
297
|
}
|
|
423
|
-
const
|
|
298
|
+
const we = /* @__PURE__ */ ee(le, [["render", ye]]);
|
|
424
299
|
export {
|
|
425
|
-
|
|
300
|
+
we as default
|
|
426
301
|
};
|