@w-run/wdesign-ui 1.0.0 → 1.1.0

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.
Files changed (213) hide show
  1. package/README.md +208 -127
  2. package/dist/index.d.ts +1010 -80
  3. package/dist/parts/WdAffix.js +159 -0
  4. package/dist/parts/WdAiMessage.js +277 -0
  5. package/dist/parts/WdAlert.js +92 -0
  6. package/dist/parts/WdAnchor.js +159 -0
  7. package/dist/parts/WdAudioPlayer.js +1024 -0
  8. package/dist/parts/WdAvatar.js +6 -0
  9. package/dist/parts/WdAvatarGroup.js +46 -0
  10. package/dist/parts/WdBacktop.js +120 -0
  11. package/dist/parts/WdBadge.js +61 -0
  12. package/dist/parts/WdBento.js +40 -0
  13. package/dist/parts/WdBentoItem.js +43 -0
  14. package/dist/parts/WdBottomSheet.js +263 -0
  15. package/dist/parts/WdBreadcrumb.js +64 -0
  16. package/dist/parts/WdButton.js +94 -0
  17. package/dist/parts/WdCalendar.js +11 -0
  18. package/dist/parts/WdCard.js +113 -0
  19. package/dist/parts/WdCarousel.js +365 -0
  20. package/dist/parts/WdCascader.js +386 -0
  21. package/dist/parts/WdCheckbox.js +81 -0
  22. package/dist/parts/WdCollapse.js +135 -0
  23. package/dist/parts/WdColorPicker.js +592 -0
  24. package/dist/parts/WdCommand.js +357 -0
  25. package/dist/parts/WdContainer.js +37 -0
  26. package/dist/parts/WdCountdown.js +163 -0
  27. package/dist/parts/WdDanmaku.js +6 -0
  28. package/dist/parts/WdDatePicker.js +169 -0
  29. package/dist/parts/WdDateTimePicker.js +162 -0
  30. package/dist/parts/WdDescriptions.js +146 -0
  31. package/dist/parts/WdDivider.js +64 -0
  32. package/dist/parts/WdDrawer.js +176 -0
  33. package/dist/parts/WdDropdown.js +140 -0
  34. package/dist/parts/WdEmpty.js +79 -0
  35. package/dist/parts/WdExplorer.js +336 -0
  36. package/dist/parts/WdFileList.js +177 -0
  37. package/dist/parts/WdForm.js +111 -0
  38. package/dist/parts/WdFormItem.js +156 -0
  39. package/dist/parts/WdGrid.js +40 -0
  40. package/dist/parts/WdGroup.js +68 -0
  41. package/dist/parts/WdImagePreview.js +274 -0
  42. package/dist/parts/WdInput.js +10 -0
  43. package/dist/parts/WdInputNumber.js +253 -0
  44. package/dist/parts/WdListItem.js +60 -0
  45. package/dist/parts/WdLoading.js +128 -0
  46. package/dist/parts/WdMarkdown.js +172 -0
  47. package/dist/parts/WdMarquee.js +80 -0
  48. package/dist/parts/WdMasonry.js +40 -0
  49. package/dist/parts/WdMediaCard.js +302 -0
  50. package/dist/parts/WdMentions.js +277 -0
  51. package/dist/parts/WdModal.js +149 -0
  52. package/dist/parts/WdNav.js +311 -0
  53. package/dist/parts/WdNotification.js +112 -0
  54. package/dist/parts/WdOtp.js +107 -0
  55. package/dist/parts/WdPagination.js +252 -0
  56. package/dist/parts/WdPopconfirm.js +214 -0
  57. package/dist/parts/WdPopover.js +203 -0
  58. package/dist/parts/WdPostItem.js +84 -0
  59. package/dist/parts/WdProgress.js +48 -0
  60. package/dist/parts/WdProgressRing.js +101 -0
  61. package/dist/parts/WdPullRefresh.js +167 -0
  62. package/dist/parts/WdQRCode.js +1909 -0
  63. package/dist/parts/WdRadioGroup.js +95 -0
  64. package/dist/parts/WdRate.js +128 -0
  65. package/dist/parts/WdResult.js +86 -0
  66. package/dist/parts/WdScrollbar.js +186 -0
  67. package/dist/parts/WdSegmented.js +11 -0
  68. package/dist/parts/WdSelect.js +465 -0
  69. package/dist/parts/WdSkeleton.js +69 -0
  70. package/dist/parts/WdSlider.js +100 -0
  71. package/dist/parts/WdSortableList.js +291 -0
  72. package/dist/parts/WdSpace.js +46 -0
  73. package/dist/parts/WdSparkline.js +148 -0
  74. package/dist/parts/WdSpinner.js +6 -0
  75. package/dist/parts/WdSplitter.js +183 -0
  76. package/dist/parts/WdStatBar.js +202 -0
  77. package/dist/parts/WdStatistic.js +131 -0
  78. package/dist/parts/WdSteps.js +110 -0
  79. package/dist/parts/WdSwitch.js +63 -0
  80. package/dist/parts/WdTabBar.js +84 -0
  81. package/dist/parts/WdTable.js +589 -0
  82. package/dist/parts/WdTabs.js +219 -0
  83. package/dist/parts/WdTag.js +6 -0
  84. package/dist/parts/WdTagInput.js +181 -0
  85. package/dist/parts/WdTimePicker.js +12 -0
  86. package/dist/parts/WdTimeline.js +145 -0
  87. package/dist/parts/WdTooltip.js +108 -0
  88. package/dist/parts/WdTour.js +264 -0
  89. package/dist/parts/WdTransfer.js +446 -0
  90. package/dist/parts/WdTree.js +322 -0
  91. package/dist/parts/WdUpload.js +309 -0
  92. package/dist/parts/WdVideoPlayer.js +1006 -0
  93. package/dist/parts/WdVirtualList.js +169 -0
  94. package/dist/parts/WdWatermark.js +150 -0
  95. package/dist/parts/chunk-3LVE72ZK.js +361 -0
  96. package/dist/parts/chunk-5HYOQ52I.js +101 -0
  97. package/dist/parts/chunk-7M3MUL3B.js +275 -0
  98. package/dist/parts/chunk-AOTJ63HN.js +15 -0
  99. package/dist/parts/chunk-AXEF2U2A.js +41 -0
  100. package/dist/parts/chunk-CY3QOSFP.js +645 -0
  101. package/dist/parts/chunk-G7NN4A6J.js +40 -0
  102. package/dist/parts/chunk-HAKYCUAR.js +9 -0
  103. package/dist/parts/chunk-JDE4AHBR.js +160 -0
  104. package/dist/parts/chunk-LT3NTWIT.js +117 -0
  105. package/dist/parts/chunk-OGHYFT7B.js +387 -0
  106. package/dist/parts/chunk-Q34U2HES.js +261 -0
  107. package/dist/parts/chunk-RLSVPJHM.js +10 -0
  108. package/dist/parts/chunk-U2CDKD2T.js +30 -0
  109. package/dist/parts/chunk-UYUNYHZD.js +40 -0
  110. package/dist/parts/chunk-VUJL2HGD.js +23 -0
  111. package/dist/parts/chunk-WCFG5KNT.js +51 -0
  112. package/dist/parts/chunk-WDDAALPI.js +42 -0
  113. package/dist/parts/chunk-WFXLDBP2.js +149 -0
  114. package/dist/style/affix.css +566 -0
  115. package/dist/style/ai-msg.css +572 -13
  116. package/dist/style/alert.css +577 -5
  117. package/dist/style/anchor.css +630 -0
  118. package/dist/style/audio.css +658 -67
  119. package/dist/style/avatar.css +575 -12
  120. package/dist/style/backtop.css +625 -0
  121. package/dist/style/badge.css +595 -11
  122. package/dist/style/bento.css +763 -0
  123. package/dist/style/bottom-sheet.css +776 -0
  124. package/dist/style/breadcrumb.css +579 -4
  125. package/dist/style/button.css +631 -36
  126. package/dist/style/calendar.css +1512 -0
  127. package/dist/style/card.css +683 -6
  128. package/dist/style/carousel.css +573 -4
  129. package/dist/style/cascader.css +862 -0
  130. package/dist/style/checkbox.css +584 -7
  131. package/dist/style/chevron.css +543 -1
  132. package/dist/style/collapse.css +586 -7
  133. package/dist/style/colorpicker.css +876 -0
  134. package/dist/style/command.css +572 -13
  135. package/dist/style/container.css +543 -0
  136. package/dist/style/countdown.css +722 -0
  137. package/dist/style/danmaku.css +644 -0
  138. package/dist/style/datepicker.css +606 -128
  139. package/dist/style/datetime-picker.css +714 -0
  140. package/dist/style/descriptions.css +604 -11
  141. package/dist/style/divider.css +544 -2
  142. package/dist/style/dot.css +556 -1
  143. package/dist/style/drawer.css +609 -11
  144. package/dist/style/dropdown.css +565 -3
  145. package/dist/style/empty.css +624 -3
  146. package/dist/style/explorer.css +632 -24
  147. package/dist/style/file-list.css +577 -5
  148. package/dist/style/flip.css +600 -0
  149. package/dist/style/form.css +550 -8
  150. package/dist/style/grid.css +614 -0
  151. package/dist/style/group.css +560 -16
  152. package/dist/style/icon-btn.css +570 -4
  153. package/dist/style/image-preview.css +652 -8
  154. package/dist/style/input-number.css +680 -0
  155. package/dist/style/input.css +571 -8
  156. package/dist/style/list.css +553 -4
  157. package/dist/style/loading.css +667 -0
  158. package/dist/style/markdown.css +592 -20
  159. package/dist/style/marquee.css +678 -0
  160. package/dist/style/masonry.css +614 -0
  161. package/dist/style/media-card.css +1229 -0
  162. package/dist/style/mentions.css +690 -0
  163. package/dist/style/modal.css +626 -15
  164. package/dist/style/nav.css +1046 -0
  165. package/dist/style/notification.css +556 -7
  166. package/dist/style/otp.css +567 -7
  167. package/dist/style/pagination.css +571 -11
  168. package/dist/style/popconfirm.css +568 -10
  169. package/dist/style/popover.css +645 -15
  170. package/dist/style/post-item.css +548 -6
  171. package/dist/style/progress-ring.css +640 -0
  172. package/dist/style/progress.css +543 -1
  173. package/dist/style/pull-refresh.css +637 -0
  174. package/dist/style/qrcode.css +613 -0
  175. package/dist/style/radio.css +584 -5
  176. package/dist/style/rate.css +594 -1
  177. package/dist/style/result.css +546 -3
  178. package/dist/style/scroll-reveal.css +613 -0
  179. package/dist/style/scrollbar.css +644 -0
  180. package/dist/style/segmented-picker.css +573 -14
  181. package/dist/style/segmented.css +711 -7
  182. package/dist/style/select.css +682 -26
  183. package/dist/style/skeleton.css +559 -0
  184. package/dist/style/slider.css +565 -4
  185. package/dist/style/sortable.css +593 -7
  186. package/dist/style/space.css +543 -0
  187. package/dist/style/sparkline.css +606 -0
  188. package/dist/style/spinner.css +559 -0
  189. package/dist/style/splitter.css +711 -0
  190. package/dist/style/stat-bar.css +767 -0
  191. package/dist/style/statistic.css +552 -7
  192. package/dist/style/steps.css +633 -9
  193. package/dist/style/switch.css +585 -4
  194. package/dist/style/tab-bar.css +647 -0
  195. package/dist/style/table.css +886 -36
  196. package/dist/style/tabs.css +599 -10
  197. package/dist/style/tag-input.css +710 -0
  198. package/dist/style/tag.css +603 -18
  199. package/dist/style/time-picker.css +749 -0
  200. package/dist/style/timeline.css +575 -14
  201. package/dist/style/toast.css +567 -6
  202. package/dist/style/tooltip.css +564 -5
  203. package/dist/style/tour.css +683 -0
  204. package/dist/style/transfer.css +858 -0
  205. package/dist/style/tree.css +613 -16
  206. package/dist/style/typography.css +884 -3
  207. package/dist/style/upload.css +602 -13
  208. package/dist/style/vlist.css +543 -1
  209. package/dist/style/vplayer.css +799 -57
  210. package/dist/style/watermark.css +570 -0
  211. package/dist/wdesign-ui.css +18055 -7262
  212. package/dist/wdesign-ui.esm.js +8976 -5044
  213. package/package.json +99 -13
@@ -0,0 +1,1006 @@
1
+ import {
2
+ WdDanmaku_default
3
+ } from "./chunk-7M3MUL3B.js";
4
+ import {
5
+ formatDuration
6
+ } from "./chunk-AOTJ63HN.js";
7
+ import {
8
+ WdIcon_default
9
+ } from "./chunk-Q34U2HES.js";
10
+
11
+ // .lib-build/WdVideoPlayer.ts
12
+ import { defineComponent as _defineComponent } from "vue";
13
+ import { createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createTextVNode as _createTextVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, createBlock as _createBlock, unref as _unref, createVNode as _createVNode, withModifiers as _withModifiers, renderList as _renderList, Fragment as _Fragment, normalizeStyle as _normalizeStyle } from "vue";
14
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
15
+ var _hoisted_1 = ["poster", "loop", "muted", "autoplay"];
16
+ var _hoisted_2 = {
17
+ key: 0,
18
+ class: "wd-vplayer__title"
19
+ };
20
+ var _hoisted_3 = {
21
+ key: 1,
22
+ class: "wd-vplayer__live"
23
+ };
24
+ var _hoisted_4 = { class: "wd-vplayer__overlay" };
25
+ var _hoisted_5 = {
26
+ key: 2,
27
+ class: "wd-vplayer__loading",
28
+ "aria-hidden": "true"
29
+ };
30
+ var _hoisted_6 = {
31
+ key: 3,
32
+ class: "wd-vplayer__error"
33
+ };
34
+ var _hoisted_7 = { class: "wd-vplayer__drawer-head" };
35
+ var _hoisted_8 = {
36
+ key: 0,
37
+ class: "wd-vplayer__ep-tabs",
38
+ role: "tablist",
39
+ "aria-label": "\u9009\u96C6\u5206\u9875"
40
+ };
41
+ var _hoisted_9 = ["aria-selected", "onClick"];
42
+ var _hoisted_10 = { class: "wd-vplayer__drawer-body" };
43
+ var _hoisted_11 = ["disabled", "onClick"];
44
+ var _hoisted_12 = { class: "wd-vplayer__ep-index" };
45
+ var _hoisted_13 = { class: "wd-vplayer__ep-label" };
46
+ var _hoisted_14 = {
47
+ key: 0,
48
+ class: "wd-vplayer__ep-tag"
49
+ };
50
+ var _hoisted_15 = ["aria-valuenow"];
51
+ var _hoisted_16 = { class: "wd-vplayer__row" };
52
+ var _hoisted_17 = ["aria-label"];
53
+ var _hoisted_18 = ["disabled"];
54
+ var _hoisted_19 = ["disabled"];
55
+ var _hoisted_20 = {
56
+ key: 1,
57
+ class: "wd-vplayer__time"
58
+ };
59
+ var _hoisted_21 = { class: "wd-vplayer__time" };
60
+ var _hoisted_22 = ["aria-pressed"];
61
+ var _hoisted_23 = { class: "wd-vplayer__vol" };
62
+ var _hoisted_24 = ["aria-label"];
63
+ var _hoisted_25 = {
64
+ key: 4,
65
+ class: "wd-vplayer__panel-wrap"
66
+ };
67
+ var _hoisted_26 = ["aria-expanded"];
68
+ var _hoisted_27 = ["onClick"];
69
+ var _hoisted_28 = ["aria-expanded"];
70
+ var WdVideoPlayer_default = /* @__PURE__ */ _defineComponent({
71
+ ...{ name: "WdVideoPlayer" },
72
+ __name: "WdVideoPlayer",
73
+ props: {
74
+ src: { type: String, required: false, default: "" },
75
+ mode: { type: String, required: false, default: "vod" },
76
+ poster: { type: String, required: false, default: "" },
77
+ title: { type: String, required: false, default: "" },
78
+ controlsMode: { type: String, required: false, default: "auto" },
79
+ autoplay: { type: Boolean, required: false, default: false },
80
+ loop: { type: Boolean, required: false, default: false },
81
+ muted: { type: Boolean, required: false, default: false },
82
+ rates: { type: Array, required: false, default: () => [0.75, 1, 1.25, 1.5, 2] },
83
+ episodes: { type: Array, required: false, default: () => [] },
84
+ currentEpisode: { type: [String, Number], required: false, default: void 0 },
85
+ episodeNav: { type: Boolean, required: false, default: true },
86
+ playlist: { type: Boolean, required: false, default: true },
87
+ episodePageSize: { type: Number, required: false, default: 100 },
88
+ pip: { type: Boolean, required: false, default: true },
89
+ hls: { type: String, required: false, default: "auto" },
90
+ liveSync: { type: Boolean, required: false, default: true },
91
+ iconStyle: { type: String, required: false, default: "filled" },
92
+ danmaku: { type: Array, required: false, default: () => [] },
93
+ danmakuSrc: { type: String, required: false, default: "" },
94
+ danmakuRaw: { type: String, required: false, default: "" },
95
+ danmakuOn: { type: Boolean, required: false, default: true },
96
+ danmakuSpeed: { type: Number, required: false, default: 120 },
97
+ danmakuRows: { type: Number, required: false, default: 6 }
98
+ },
99
+ emits: ["play", "pause", "ended", "timeupdate", "error", "change-episode", "rate-change", "update:danmakuOn"],
100
+ setup(__props, { emit: __emit }) {
101
+ const props = __props;
102
+ const hasDanmaku = computed(
103
+ () => props.danmaku.length > 0 || !!props.danmakuSrc || !!props.danmakuRaw
104
+ );
105
+ const emit = __emit;
106
+ const video = ref(null);
107
+ const wrap = ref(null);
108
+ const playing = ref(false);
109
+ const current = ref(0);
110
+ const duration = ref(0);
111
+ const buffered = ref(0);
112
+ const volume = ref(1);
113
+ const muted = ref(props.muted);
114
+ const rate = ref(1);
115
+ const ready = ref(false);
116
+ const errMsg = ref("");
117
+ const isFullscreen = ref(false);
118
+ const isLive = computed(() => props.mode === "live");
119
+ let hls = null;
120
+ const getHls = () => globalThis.Hls;
121
+ const isM3u8 = computed(() => {
122
+ const src = props.src || "";
123
+ let decoded = src;
124
+ try {
125
+ decoded = decodeURIComponent(src);
126
+ } catch {
127
+ }
128
+ return /\.m3u8/i.test(src) || /\.m3u8/i.test(decoded);
129
+ });
130
+ let loadTimer;
131
+ function armLoadTimeout() {
132
+ if (loadTimer) clearTimeout(loadTimer);
133
+ loadTimer = setTimeout(() => {
134
+ const v = video.value;
135
+ if (ready.value || v && v.readyState >= 1 || errMsg.value) return;
136
+ errMsg.value = "\u52A0\u8F7D\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u5730\u5740\u6216\u7F51\u7EDC";
137
+ emit("error", errMsg.value);
138
+ }, 15e3);
139
+ }
140
+ function clearLoadTimeout() {
141
+ if (loadTimer) {
142
+ clearTimeout(loadTimer);
143
+ loadTimer = void 0;
144
+ }
145
+ }
146
+ function destroyHls() {
147
+ if (hls) {
148
+ try {
149
+ hls.destroy();
150
+ } catch {
151
+ }
152
+ hls = null;
153
+ }
154
+ }
155
+ const canNativeHls = () => {
156
+ const v = document.createElement("video");
157
+ return v.canPlayType("application/vnd.apple.mpegurl") === "probably";
158
+ };
159
+ const hasMSE = () => typeof MediaSource !== "undefined";
160
+ let tryFallbackHls = false;
161
+ function mountSource() {
162
+ const v = video.value;
163
+ if (!v) return;
164
+ destroyHls();
165
+ clearLoadTimeout();
166
+ v.removeAttribute("src");
167
+ v.load();
168
+ errMsg.value = "";
169
+ tryFallbackHls = false;
170
+ if (props.hls === "off" || !isM3u8.value) {
171
+ v.src = props.src;
172
+ enforceInline();
173
+ return;
174
+ }
175
+ if (props.hls === "hlsjs") {
176
+ attachHls();
177
+ return;
178
+ }
179
+ if (canNativeHls()) {
180
+ tryFallbackHls = !!getHls() && hasMSE();
181
+ v.src = props.src;
182
+ return;
183
+ }
184
+ if (hasMSE()) {
185
+ const waitHls = (n = 20) => {
186
+ if (getHls()) {
187
+ attachHls();
188
+ return;
189
+ }
190
+ if (n > 0) {
191
+ setTimeout(() => waitHls(n - 1), 100);
192
+ return;
193
+ }
194
+ v.src = props.src;
195
+ };
196
+ waitHls();
197
+ return;
198
+ }
199
+ v.src = props.src;
200
+ }
201
+ function attachHls() {
202
+ const v = video.value;
203
+ const Ctor = getHls();
204
+ if (!v || !Ctor) return;
205
+ hls = new Ctor({
206
+ // 直播从近边缘起播,别从头拉一堆积压分片
207
+ liveSyncDurationCount: props.liveSync ? 3 : 6,
208
+ enableWorker: true,
209
+ lowLatencyMode: false
210
+ });
211
+ hls.on("hlsError", ((_e, data) => {
212
+ if (!data?.fatal) return;
213
+ if (data.type === "mediaError") {
214
+ hls?.recoverMediaError();
215
+ return;
216
+ }
217
+ errMsg.value = "\u76F4\u64AD\u6D41\u8FDE\u63A5\u5931\u8D25";
218
+ emit("error", errMsg.value);
219
+ }));
220
+ hls.loadSource(props.src);
221
+ hls.attachMedia(v);
222
+ }
223
+ const hovering = ref(false);
224
+ const panelOpen = ref("");
225
+ const barVisible = computed(
226
+ () => props.controlsMode === "always" || !playing.value || hovering.value || panelOpen.value !== "" || !ready.value
227
+ );
228
+ let hideTimer;
229
+ function poke() {
230
+ hovering.value = true;
231
+ if (hideTimer) clearTimeout(hideTimer);
232
+ if (props.controlsMode === "auto" && playing.value && !panelOpen.value) {
233
+ hideTimer = setTimeout(() => {
234
+ hovering.value = false;
235
+ }, 2600);
236
+ }
237
+ }
238
+ function onLeave() {
239
+ if (hideTimer) clearTimeout(hideTimer);
240
+ hovering.value = false;
241
+ }
242
+ const showCursor = computed(() => !isFullscreen.value || barVisible.value);
243
+ function togglePlay() {
244
+ const v = video.value;
245
+ if (!v) return;
246
+ if (v.paused) {
247
+ if (!ready.value) armLoadTimeout();
248
+ v.play().catch((e) => {
249
+ errMsg.value = "\u64AD\u653E\u5931\u8D25\uFF1A" + e.message;
250
+ });
251
+ } else {
252
+ v.pause();
253
+ }
254
+ }
255
+ const progress = computed(() => {
256
+ if (isLive.value || !isFinite(duration.value) || duration.value <= 0) return 0;
257
+ return current.value / duration.value * 100;
258
+ });
259
+ const bufferedPct = computed(() => duration.value > 0 ? buffered.value / duration.value * 100 : 0);
260
+ const remain = computed(() => Math.max(0, duration.value - current.value));
261
+ const liveClock = ref("");
262
+ let clockTimer;
263
+ function tickClock() {
264
+ const d = /* @__PURE__ */ new Date();
265
+ const p = (n) => String(n).padStart(2, "0");
266
+ liveClock.value = `${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
267
+ }
268
+ watch(playing, (v) => {
269
+ if (v && isLive.value) {
270
+ tickClock();
271
+ clockTimer = setInterval(tickClock, 1e3);
272
+ } else if (clockTimer) {
273
+ clearInterval(clockTimer);
274
+ clockTimer = void 0;
275
+ }
276
+ });
277
+ function onTimeUpdate() {
278
+ const v = video.value;
279
+ if (!v) return;
280
+ if (errMsg.value && v.readyState >= 2) errMsg.value = "";
281
+ current.value = v.currentTime;
282
+ duration.value = v.duration || 0;
283
+ emit("timeupdate", current.value, duration.value);
284
+ }
285
+ function onProgressEvt() {
286
+ const v = video.value;
287
+ if (!v || !v.buffered.length) return;
288
+ buffered.value = v.buffered.end(v.buffered.length - 1);
289
+ }
290
+ const dragging = ref(false);
291
+ function ratioFrom(e, el) {
292
+ const r = el.getBoundingClientRect();
293
+ return Math.min(1, Math.max(0, (e.clientX - r.left) / r.width));
294
+ }
295
+ function seekAt(e) {
296
+ const v = video.value;
297
+ if (!v || isLive.value || !duration.value) return;
298
+ const t = ratioFrom(e, e.currentTarget) * duration.value;
299
+ v.currentTime = t;
300
+ current.value = t;
301
+ }
302
+ function onScrubKey(e) {
303
+ const v = video.value;
304
+ if (!v) return;
305
+ if (e.key === "ArrowRight" && !isLive.value) {
306
+ v.currentTime = Math.min(v.duration || 0, v.currentTime + 5);
307
+ e.preventDefault();
308
+ } else if (e.key === "ArrowLeft" && !isLive.value) {
309
+ v.currentTime = Math.max(0, v.currentTime - 5);
310
+ e.preventDefault();
311
+ } else if (e.key === " " || e.key === "Enter") {
312
+ togglePlay();
313
+ e.preventDefault();
314
+ }
315
+ }
316
+ function setVolumeAt(e) {
317
+ const v = video.value;
318
+ if (!v) return;
319
+ const r = ratioFrom(e, e.currentTarget);
320
+ volume.value = r;
321
+ v.volume = r;
322
+ v.muted = r === 0;
323
+ muted.value = v.muted;
324
+ }
325
+ function toggleMute() {
326
+ const v = video.value;
327
+ if (!v) return;
328
+ v.muted = !v.muted;
329
+ muted.value = v.muted;
330
+ if (!v.muted && v.volume === 0) {
331
+ v.volume = 0.5;
332
+ volume.value = 0.5;
333
+ }
334
+ }
335
+ function setRate(r) {
336
+ const v = video.value;
337
+ if (!v) return;
338
+ v.playbackRate = r;
339
+ rate.value = r;
340
+ panelOpen.value = "";
341
+ emit("rateChange", r);
342
+ }
343
+ function togglePanel(p) {
344
+ panelOpen.value = panelOpen.value === p ? "" : p;
345
+ }
346
+ const epPage = ref(0);
347
+ const epPages = computed(() => {
348
+ const raw = props.episodePageSize;
349
+ const size = typeof raw === "number" && Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : 100;
350
+ const out = [];
351
+ for (let from = 0; from < props.episodes.length; from += size) {
352
+ const to = Math.min(from + size, props.episodes.length);
353
+ out.push({ key: from, label: `${from + 1}-${to}`, from, to });
354
+ }
355
+ return out;
356
+ });
357
+ const epPageItems = computed(() => {
358
+ const page = epPages.value[epPage.value];
359
+ if (!page) return props.episodes;
360
+ return props.episodes.slice(page.from, page.to).map((ep, i) => ({ ep, index: page.from + i }));
361
+ });
362
+ function syncPageToCurrent() {
363
+ const i = epIndex.value;
364
+ if (i < 0) return;
365
+ const raw = props.episodePageSize;
366
+ const size = typeof raw === "number" && Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : 100;
367
+ epPage.value = Math.floor(i / size);
368
+ }
369
+ const epIndex = computed(
370
+ () => props.episodes.findIndex((e) => e.key === props.currentEpisode)
371
+ );
372
+ const hasPrev = computed(() => props.episodeNav && epIndex.value > 0);
373
+ const hasNext = computed(
374
+ () => props.episodeNav && epIndex.value >= 0 && epIndex.value < props.episodes.length - 1
375
+ );
376
+ watch([() => panelOpen.value, epIndex], () => {
377
+ if (panelOpen.value === "playlist") syncPageToCurrent();
378
+ });
379
+ function goEpisode(ep, idx) {
380
+ if (!ep || ep.disabled) return;
381
+ emit("changeEpisode", ep, idx);
382
+ if (ep.src && video.value) {
383
+ video.value.src = ep.src;
384
+ video.value.play().catch(() => {
385
+ });
386
+ }
387
+ panelOpen.value = "";
388
+ }
389
+ function prevEpisode() {
390
+ if (hasPrev.value) goEpisode(props.episodes[epIndex.value - 1], epIndex.value - 1);
391
+ }
392
+ function nextEpisode() {
393
+ if (hasNext.value) goEpisode(props.episodes[epIndex.value + 1], epIndex.value + 1);
394
+ }
395
+ async function togglePip() {
396
+ const v = video.value;
397
+ if (!v || !document.pictureInPictureEnabled) return;
398
+ try {
399
+ if (document.pictureInPictureElement) await document.exitPictureInPicture();
400
+ else await v.requestPictureInPicture();
401
+ } catch {
402
+ errMsg.value = "\u753B\u4E2D\u753B\u4E0D\u53EF\u7528";
403
+ }
404
+ }
405
+ function toggleFullscreen() {
406
+ const el = wrap.value;
407
+ if (!el) return;
408
+ if (document.fullscreenElement) document.exitFullscreen();
409
+ else el.requestFullscreen?.().catch(() => {
410
+ errMsg.value = "\u5168\u5C4F\u88AB\u62D2\u7EDD\uFF08\u9700\u7528\u6237\u624B\u52BF\uFF09";
411
+ });
412
+ }
413
+ function onFsChange() {
414
+ isFullscreen.value = !!document.fullscreenElement;
415
+ poke();
416
+ }
417
+ function onError() {
418
+ const v = video.value;
419
+ if (tryFallbackHls && getHls() && hasMSE()) {
420
+ tryFallbackHls = false;
421
+ attachHls();
422
+ return;
423
+ }
424
+ const map = { 1: "\u52A0\u8F7D\u88AB\u4E2D\u65AD", 2: "\u7F51\u7EDC\u9519\u8BEF", 3: "\u89E3\u7801\u5931\u8D25", 4: "\u5730\u5740\u4E0D\u652F\u6301\u6216\u683C\u5F0F\u4E0D\u517C\u5BB9" };
425
+ errMsg.value = map[v?.error?.code || 0] || "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25";
426
+ emit("error", errMsg.value);
427
+ }
428
+ watch(() => props.src, async () => {
429
+ ready.value = false;
430
+ current.value = 0;
431
+ duration.value = 0;
432
+ buffered.value = 0;
433
+ await nextTick();
434
+ mountSource();
435
+ });
436
+ function enforceInline() {
437
+ const v = video.value;
438
+ if (!v) return;
439
+ v.setAttribute("playsinline", "true");
440
+ v.setAttribute("webkit-playsinline", "true");
441
+ v.setAttribute("x5-playsinline", "true");
442
+ v.setAttribute("x5-video-player-type", "h5");
443
+ v.setAttribute("disablepictureinpicture", "true");
444
+ v.setAttribute("disableremoteplayback", "true");
445
+ v.playsInline = true;
446
+ v.webkitPlaysInline = true;
447
+ }
448
+ onMounted(() => {
449
+ enforceInline();
450
+ mountSource();
451
+ if (props.autoplay) armLoadTimeout();
452
+ document.addEventListener("fullscreenchange", onFsChange);
453
+ const v = video.value;
454
+ if (v) {
455
+ for (const evt of ["loadstart", "loadedmetadata", "canplay", "play"]) {
456
+ v.addEventListener(evt, enforceInline, { passive: true });
457
+ }
458
+ }
459
+ });
460
+ watch(() => props.muted, (m) => {
461
+ if (video.value) video.value.muted = m;
462
+ });
463
+ onBeforeUnmount(() => {
464
+ if (hideTimer) clearTimeout(hideTimer);
465
+ if (clockTimer) clearInterval(clockTimer);
466
+ clearLoadTimeout();
467
+ destroyHls();
468
+ document.removeEventListener("fullscreenchange", onFsChange);
469
+ });
470
+ return (_ctx, _cache) => {
471
+ return _openBlock(), _createElementBlock(
472
+ "div",
473
+ {
474
+ ref_key: "wrap",
475
+ ref: wrap,
476
+ class: _normalizeClass(["wd-vplayer", { "is-fullscreen": isFullscreen.value, "no-cursor": !showCursor.value }]),
477
+ onMousemove: poke,
478
+ onMouseleave: onLeave,
479
+ onTouchstartPassive: poke
480
+ },
481
+ [
482
+ _createElementVNode("video", {
483
+ ref_key: "video",
484
+ ref: video,
485
+ class: "wd-vplayer__el",
486
+ poster: __props.poster,
487
+ loop: __props.loop,
488
+ muted: muted.value,
489
+ autoplay: __props.autoplay,
490
+ playsinline: "",
491
+ "webkit-playsinline": "",
492
+ "x5-playsinline": "",
493
+ disablepictureinpicture: "",
494
+ disableremoteplayback: "",
495
+ preload: "metadata",
496
+ onClick: togglePlay,
497
+ onDblclick: toggleFullscreen,
498
+ onPlay: _cache[0] || (_cache[0] = ($event) => {
499
+ playing.value = true;
500
+ poke();
501
+ emit("play");
502
+ }),
503
+ onPause: _cache[1] || (_cache[1] = ($event) => {
504
+ playing.value = false;
505
+ emit("pause");
506
+ }),
507
+ onEnded: _cache[2] || (_cache[2] = ($event) => {
508
+ playing.value = false;
509
+ emit("ended");
510
+ }),
511
+ onTimeupdate: onTimeUpdate,
512
+ onProgress: onProgressEvt,
513
+ onLoadedmetadata: _cache[3] || (_cache[3] = ($event) => {
514
+ ready.value = true;
515
+ errMsg.value = "";
516
+ clearLoadTimeout();
517
+ onTimeUpdate();
518
+ }),
519
+ onCanplay: _cache[4] || (_cache[4] = ($event) => {
520
+ ready.value = true;
521
+ errMsg.value = "";
522
+ clearLoadTimeout();
523
+ }),
524
+ onPlaying: _cache[5] || (_cache[5] = ($event) => errMsg.value = ""),
525
+ onError
526
+ }, null, 40, _hoisted_1),
527
+ _createCommentVNode(" ===== \u70B9\u51FB\u5C42\uFF1A\u6574\u4E2A\u753B\u9762\u53EF\u6682\u505C\uFF08\u9F20\u6807\u6307\u9488\u4E0D\u663E\u793A\uFF09 ===== "),
528
+ _createElementVNode("div", {
529
+ class: "wd-vplayer__hit",
530
+ onClick: togglePlay
531
+ }),
532
+ _createCommentVNode(" ===== \u9876\u90E8\u6E10\u53D8\u6761\uFF1A\u6807\u9898 + \u76F4\u64AD\u6807\u8BC6 ===== "),
533
+ _createElementVNode(
534
+ "div",
535
+ {
536
+ class: _normalizeClass(["wd-vplayer__top", { "is-visible": barVisible.value }])
537
+ },
538
+ [
539
+ __props.title ? (_openBlock(), _createElementBlock(
540
+ "span",
541
+ _hoisted_2,
542
+ _toDisplayString(__props.title),
543
+ 1
544
+ /* TEXT */
545
+ )) : _createCommentVNode("v-if", true),
546
+ isLive.value ? (_openBlock(), _createElementBlock("span", _hoisted_3, [..._cache[12] || (_cache[12] = [
547
+ _createElementVNode(
548
+ "i",
549
+ { class: "wd-vplayer__live-dot" },
550
+ null,
551
+ -1
552
+ /* CACHED */
553
+ ),
554
+ _createTextVNode(
555
+ "\u76F4\u64AD ",
556
+ -1
557
+ /* CACHED */
558
+ )
559
+ ])])) : _createCommentVNode("v-if", true),
560
+ _createCommentVNode(" \u9876\u90E8\u53F3\u4FA7\uFF1A\u6E05\u6670\u5EA6\u5207\u6362\u3001\u5F39\u5E55\u5F00\u5173\u3001\u7247\u6E90\u7B49 "),
561
+ _cache[13] || (_cache[13] = _createElementVNode(
562
+ "span",
563
+ { class: "wd-vplayer__spacer" },
564
+ null,
565
+ -1
566
+ /* CACHED */
567
+ )),
568
+ _renderSlot(_ctx.$slots, "top-right")
569
+ ],
570
+ 2
571
+ /* CLASS */
572
+ ),
573
+ _createCommentVNode(" ===== \u5F39\u5E55\u5C42\uFF08\u5185\u7F6E\uFF09 ===== "),
574
+ hasDanmaku.value ? (_openBlock(), _createBlock(WdDanmaku_default, {
575
+ key: 0,
576
+ items: __props.danmaku,
577
+ src: __props.danmakuSrc,
578
+ raw: __props.danmakuRaw,
579
+ current: current.value,
580
+ visible: __props.danmakuOn,
581
+ paused: !playing.value,
582
+ rows: __props.danmakuRows
583
+ }, null, 8, ["items", "src", "raw", "current", "visible", "paused", "rows"])) : _createCommentVNode("v-if", true),
584
+ _createCommentVNode(" ===== \u753B\u9762\u8986\u76D6\u5C42\uFF1A\u81EA\u5B9A\u4E49\u5B57\u5E55 / \u6C34\u5370 ===== "),
585
+ _createElementVNode("div", _hoisted_4, [
586
+ _renderSlot(_ctx.$slots, "overlay", {
587
+ playing: playing.value,
588
+ current: current.value,
589
+ duration: duration.value
590
+ })
591
+ ]),
592
+ _createCommentVNode(" ===== \u4E2D\u592E\u5927\u64AD\u653E\u6309\u94AE\uFF08\u672A\u64AD\u653E\u65F6\uFF09 ===== "),
593
+ !playing.value && !errMsg.value ? (_openBlock(), _createElementBlock("button", {
594
+ key: 1,
595
+ type: "button",
596
+ class: "wd-vplayer__big",
597
+ "aria-label": "\u64AD\u653E",
598
+ onClick: _withModifiers(togglePlay, ["stop"])
599
+ }, [
600
+ _createVNode(_unref(WdIcon_default), {
601
+ name: "play",
602
+ variant: __props.iconStyle,
603
+ size: 30
604
+ }, null, 8, ["variant"])
605
+ ])) : _createCommentVNode("v-if", true),
606
+ _createCommentVNode(" \u52A0\u8F7D\u4E2D "),
607
+ !ready.value && !errMsg.value ? (_openBlock(), _createElementBlock("div", _hoisted_5, [..._cache[14] || (_cache[14] = [
608
+ _createElementVNode(
609
+ "span",
610
+ { class: "wd-vplayer__spinner" },
611
+ null,
612
+ -1
613
+ /* CACHED */
614
+ )
615
+ ])])) : _createCommentVNode("v-if", true),
616
+ _createCommentVNode(" \u9519\u8BEF "),
617
+ errMsg.value ? (_openBlock(), _createElementBlock("div", _hoisted_6, [
618
+ _createVNode(_unref(WdIcon_default), {
619
+ name: "warning-circle",
620
+ variant: __props.iconStyle,
621
+ size: 22
622
+ }, null, 8, ["variant"]),
623
+ _createElementVNode(
624
+ "span",
625
+ null,
626
+ _toDisplayString(errMsg.value),
627
+ 1
628
+ /* TEXT */
629
+ )
630
+ ])) : _createCommentVNode("v-if", true),
631
+ _createCommentVNode("\n \u9009\u96C6\u62BD\u5C49\uFF1A\u4ECE\u64AD\u653E\u5668**\u53F3\u4FA7\u5185\u90E8**\u6ED1\u51FA\uFF0C\u4E0D\u8D85\u51FA\u64AD\u653E\u5668\u8FB9\u754C\u3002\n \u26A0\uFE0F \u4E0D\u7528\u6D6E\u5C42\u5F39\u51FA\uFF08\u90A3\u4F1A\u6EA2\u51FA\u5BB9\u5668\u3001\u88AB overflow \u88C1\u5207\uFF09\uFF0C\n \u6539\u6210\u8D34\u8FB9\u4FA7\u680F \u2014\u2014 \u96C6\u6570\u591A\u65F6\u5185\u90E8\u7AD6\u5411\u6EDA\u52A8\uFF0C\u5173\u95ED\u6309\u94AE\u4F4D\u7F6E\u56FA\u5B9A\u3002\n \u8FD9\u662F\u4E3B\u6D41\u89C6\u9891\u7AD9\uFF08B \u7AD9 / YouTube / Netflix\uFF09\u7684\u901A\u884C\u505A\u6CD5\u3002\n "),
632
+ __props.playlist && __props.episodes.length ? (_openBlock(), _createElementBlock(
633
+ "div",
634
+ {
635
+ key: 4,
636
+ class: _normalizeClass(["wd-vplayer__drawer", { "is-open": panelOpen.value === "playlist" }]),
637
+ onClick: _cache[7] || (_cache[7] = _withModifiers(() => {
638
+ }, ["stop"]))
639
+ },
640
+ [
641
+ _createElementVNode("div", _hoisted_7, [
642
+ _createElementVNode(
643
+ "span",
644
+ null,
645
+ "\u9009\u96C6 \xB7 \u5171 " + _toDisplayString(__props.episodes.length) + " \u96C6",
646
+ 1
647
+ /* TEXT */
648
+ ),
649
+ _createElementVNode("button", {
650
+ type: "button",
651
+ class: "wd-vplayer__drawer-close",
652
+ "aria-label": "\u6536\u8D77\u9009\u96C6",
653
+ onClick: _cache[6] || (_cache[6] = _withModifiers(($event) => togglePanel("playlist"), ["stop"]))
654
+ }, [
655
+ _createVNode(_unref(WdIcon_default), {
656
+ name: "close",
657
+ variant: __props.iconStyle,
658
+ size: 14
659
+ }, null, 8, ["variant"])
660
+ ])
661
+ ]),
662
+ _createCommentVNode(" \u5206\uFFFD\uFFFD\uFFFD\uFF1A\u96C6\u6570\u591A\u65F6\u6309\u300C1-100 / 101-200\u300D\u5207\u9875\uFF0C\u907F\u514D\u4E00\u6B21\u94FA\u51E0\u767E\u884C "),
663
+ epPages.value.length > 1 ? (_openBlock(), _createElementBlock("div", _hoisted_8, [
664
+ (_openBlock(true), _createElementBlock(
665
+ _Fragment,
666
+ null,
667
+ _renderList(epPages.value, (pg, pi) => {
668
+ return _openBlock(), _createElementBlock("button", {
669
+ key: pg.key,
670
+ type: "button",
671
+ role: "tab",
672
+ class: _normalizeClass(["wd-vplayer__ep-tab", { "is-on": epPage.value === pi }]),
673
+ "aria-selected": epPage.value === pi,
674
+ onClick: _withModifiers(($event) => epPage.value = pi, ["stop"])
675
+ }, _toDisplayString(pg.label), 11, _hoisted_9);
676
+ }),
677
+ 128
678
+ /* KEYED_FRAGMENT */
679
+ ))
680
+ ])) : _createCommentVNode("v-if", true),
681
+ _createCommentVNode(' \u5217\u8868\uFF1A\u4E00\u884C\u4E00\u96C6\uFF0C\u5E8F\u53F7 + \u6807\u9898 + \u6807\u8BB0\uFF1B\u9009\u4E2D\u884C\u7528\u53CD\u76F8\u5B9E\u5FC3\uFF0C\u773C\u524D\u6709"\u6B63\u5728\u770B"\u7684\u843D\u70B9 '),
682
+ _createElementVNode("div", _hoisted_10, [
683
+ (_openBlock(true), _createElementBlock(
684
+ _Fragment,
685
+ null,
686
+ _renderList(epPageItems.value, (row) => {
687
+ return _openBlock(), _createElementBlock("button", {
688
+ key: row.ep.key,
689
+ type: "button",
690
+ class: _normalizeClass(["wd-vplayer__ep-row", { "is-on": row.ep.key === __props.currentEpisode, "is-off": row.ep.disabled }]),
691
+ disabled: row.ep.disabled,
692
+ onClick: ($event) => goEpisode(row.ep, row.index)
693
+ }, [
694
+ _createElementVNode(
695
+ "span",
696
+ _hoisted_12,
697
+ _toDisplayString(row.index + 1),
698
+ 1
699
+ /* TEXT */
700
+ ),
701
+ _createElementVNode(
702
+ "span",
703
+ _hoisted_13,
704
+ _toDisplayString(row.ep.label),
705
+ 1
706
+ /* TEXT */
707
+ ),
708
+ row.ep.tag ? (_openBlock(), _createElementBlock(
709
+ "i",
710
+ _hoisted_14,
711
+ _toDisplayString(row.ep.tag),
712
+ 1
713
+ /* TEXT */
714
+ )) : _createCommentVNode("v-if", true)
715
+ ], 10, _hoisted_11);
716
+ }),
717
+ 128
718
+ /* KEYED_FRAGMENT */
719
+ ))
720
+ ])
721
+ ],
722
+ 2
723
+ /* CLASS */
724
+ )) : _createCommentVNode("v-if", true),
725
+ _createCommentVNode(" ===== \u5E95\u90E8\u957F\u6761\uFF08\u5168\u90E8\u63A7\u4EF6\uFF09 ===== "),
726
+ _createElementVNode(
727
+ "div",
728
+ {
729
+ class: _normalizeClass(["wd-vplayer__bottom", { "is-visible": barVisible.value }])
730
+ },
731
+ [
732
+ _renderSlot(_ctx.$slots, "above-controls"),
733
+ _createCommentVNode(" \u8FDB\u5EA6\u6761\uFF08\u70B9\u64AD\uFF09 "),
734
+ !isLive.value ? (_openBlock(), _createElementBlock("div", {
735
+ key: 0,
736
+ class: "wd-vplayer__scrub",
737
+ role: "slider",
738
+ tabindex: "0",
739
+ "aria-label": "\u64AD\u653E\u8FDB\u5EA6",
740
+ "aria-valuenow": Math.round(progress.value),
741
+ "aria-valuemin": "0",
742
+ "aria-valuemax": "100",
743
+ onClick: _withModifiers(seekAt, ["stop"]),
744
+ onKeydown: onScrubKey
745
+ }, [
746
+ _cache[15] || (_cache[15] = _createElementVNode(
747
+ "span",
748
+ { class: "wd-vplayer__track" },
749
+ null,
750
+ -1
751
+ /* CACHED */
752
+ )),
753
+ _createElementVNode(
754
+ "span",
755
+ {
756
+ class: "wd-vplayer__buffer",
757
+ style: _normalizeStyle({ width: bufferedPct.value + "%" })
758
+ },
759
+ null,
760
+ 4
761
+ /* STYLE */
762
+ ),
763
+ _createElementVNode(
764
+ "span",
765
+ {
766
+ class: "wd-vplayer__played",
767
+ style: _normalizeStyle({ width: progress.value + "%" })
768
+ },
769
+ null,
770
+ 4
771
+ /* STYLE */
772
+ ),
773
+ _createElementVNode(
774
+ "span",
775
+ {
776
+ class: "wd-vplayer__knob",
777
+ style: _normalizeStyle({ left: progress.value + "%" })
778
+ },
779
+ null,
780
+ 4
781
+ /* STYLE */
782
+ )
783
+ ], 40, _hoisted_15)) : (_openBlock(), _createElementBlock(
784
+ _Fragment,
785
+ { key: 1 },
786
+ [
787
+ _createCommentVNode(" \u76F4\u64AD\uFF1A\u4E0D\u505A\u8FDB\u5EA6\u6761\uFF0C\u53EA\u663E\u793A\u4E00\u6761\u300C\u5B9E\u65F6\u300D\u7EC6\u7EBF "),
788
+ _cache[16] || (_cache[16] = _createElementVNode(
789
+ "div",
790
+ { class: "wd-vplayer__live-bar" },
791
+ [
792
+ _createElementVNode("span")
793
+ ],
794
+ -1
795
+ /* CACHED */
796
+ ))
797
+ ],
798
+ 2112
799
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
800
+ )),
801
+ _createElementVNode("div", _hoisted_16, [
802
+ _createCommentVNode(" \u63A7\u5236\u6761\u6700\u5DE6\uFF1A\u6781\u5C11\u7528\uFF0C\u7559\u7ED9\u81EA\u5B9A\u4E49\u5165\u53E3 "),
803
+ _renderSlot(_ctx.$slots, "controls-start"),
804
+ _createElementVNode("button", {
805
+ type: "button",
806
+ class: "wd-vplayer__btn",
807
+ "aria-label": playing.value ? "\u6682\u505C" : "\u64AD\u653E",
808
+ onClick: _withModifiers(togglePlay, ["stop"])
809
+ }, [
810
+ _createVNode(_unref(WdIcon_default), {
811
+ name: playing.value ? "pause" : "play",
812
+ variant: __props.iconStyle,
813
+ size: 18
814
+ }, null, 8, ["name", "variant"])
815
+ ], 8, _hoisted_17),
816
+ _createCommentVNode(" \u4E0A\u4E0B\u96C6 "),
817
+ __props.episodeNav && __props.episodes.length ? (_openBlock(), _createElementBlock(
818
+ _Fragment,
819
+ { key: 0 },
820
+ [
821
+ _createElementVNode("button", {
822
+ type: "button",
823
+ class: "wd-vplayer__btn",
824
+ disabled: !hasPrev.value,
825
+ "aria-label": "\u4E0A\u4E00\u96C6",
826
+ onClick: _withModifiers(prevEpisode, ["stop"])
827
+ }, [
828
+ _createVNode(_unref(WdIcon_default), {
829
+ name: "skip-previous",
830
+ variant: __props.iconStyle,
831
+ size: 17
832
+ }, null, 8, ["variant"])
833
+ ], 8, _hoisted_18),
834
+ _createElementVNode("button", {
835
+ type: "button",
836
+ class: "wd-vplayer__btn",
837
+ disabled: !hasNext.value,
838
+ "aria-label": "\u4E0B\u4E00\u96C6",
839
+ onClick: _withModifiers(nextEpisode, ["stop"])
840
+ }, [
841
+ _createVNode(_unref(WdIcon_default), {
842
+ name: "skip-next",
843
+ variant: __props.iconStyle,
844
+ size: 17
845
+ }, null, 8, ["variant"])
846
+ ], 8, _hoisted_19)
847
+ ],
848
+ 64
849
+ /* STABLE_FRAGMENT */
850
+ )) : _createCommentVNode("v-if", true),
851
+ !isLive.value ? (_openBlock(), _createElementBlock(
852
+ "span",
853
+ _hoisted_20,
854
+ _toDisplayString(_unref(formatDuration)(current.value)) + " / " + _toDisplayString(_unref(formatDuration)(duration.value)),
855
+ 1
856
+ /* TEXT */
857
+ )) : (_openBlock(), _createElementBlock(
858
+ _Fragment,
859
+ { key: 2 },
860
+ [
861
+ _createCommentVNode(' \u76F4\u64AD\u7684 currentTime \u662F\u76F8\u5BF9\u8D77\u64AD\u7684\u504F\u79FB\uFF0C\u4E0D\u662F\u8282\u76EE\u65F6\u95F4\uFF0C\n \u663E\u793A "\u5DF2\u76F4\u64AD 00:00" \u4F1A\u8BA9\u7528\u6237\u56F0\u60D1 \u2192 \u6539\u663E\u793A\u5F53\u524D\u65F6\u523B '),
862
+ _createElementVNode(
863
+ "span",
864
+ _hoisted_21,
865
+ _toDisplayString(liveClock.value),
866
+ 1
867
+ /* TEXT */
868
+ )
869
+ ],
870
+ 2112
871
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
872
+ )),
873
+ _cache[17] || (_cache[17] = _createElementVNode(
874
+ "span",
875
+ { class: "wd-vplayer__spacer" },
876
+ null,
877
+ -1
878
+ /* CACHED */
879
+ )),
880
+ _createCommentVNode(" \u5F39\u5E55\u5F00\u5173 "),
881
+ hasDanmaku.value ? (_openBlock(), _createElementBlock("button", {
882
+ key: 3,
883
+ type: "button",
884
+ class: _normalizeClass(["wd-vplayer__btn wd-vplayer__btn--text", { "is-muted": !__props.danmakuOn }]),
885
+ "aria-pressed": __props.danmakuOn,
886
+ "aria-label": "\u5F39\u5E55",
887
+ onClick: _cache[8] || (_cache[8] = _withModifiers(($event) => emit("update:danmakuOn", !__props.danmakuOn), ["stop"]))
888
+ }, " \u5F39 ", 10, _hoisted_22)) : _createCommentVNode("v-if", true),
889
+ _createCommentVNode(" \u53F3\u4FA7\u6269\u5C55\u4F4D\uFF1A\u5B57\u5E55\u3001\u97F3\u8F68\u3001\u6E05\u6670\u5EA6\u7B49\uFF08\u5728\u539F\u751F\u63A7\u4EF6\u4E4B\u524D\uFF09 "),
890
+ _renderSlot(_ctx.$slots, "controls-end"),
891
+ _createCommentVNode(" \u97F3\u91CF\uFF1Ahover \u5C55\u5F00\u6ED1\u6761\uFF0C\u907F\u514D\u957F\u671F\u5360\u5BBD "),
892
+ _createElementVNode("div", _hoisted_23, [
893
+ _createElementVNode("button", {
894
+ type: "button",
895
+ class: "wd-vplayer__btn",
896
+ "aria-label": muted.value ? "\u53D6\u6D88\u9759\u97F3" : "\u9759\u97F3",
897
+ onClick: _withModifiers(toggleMute, ["stop"])
898
+ }, [
899
+ _createVNode(_unref(WdIcon_default), {
900
+ name: muted.value ? "volume-mute" : "volume-up",
901
+ variant: __props.iconStyle,
902
+ size: 17
903
+ }, null, 8, ["name", "variant"])
904
+ ], 8, _hoisted_24),
905
+ _createElementVNode("div", {
906
+ class: "wd-vplayer__vol-slider",
907
+ onClick: _withModifiers(setVolumeAt, ["stop"])
908
+ }, [
909
+ _createElementVNode(
910
+ "span",
911
+ {
912
+ class: "wd-vplayer__vol-fill",
913
+ style: _normalizeStyle({ width: (muted.value ? 0 : volume.value * 100) + "%" })
914
+ },
915
+ null,
916
+ 4
917
+ /* STYLE */
918
+ )
919
+ ])
920
+ ]),
921
+ _createCommentVNode(" \u500D\u901F\uFF08\u70B9\u64AD\uFF09 "),
922
+ !isLive.value ? (_openBlock(), _createElementBlock("div", _hoisted_25, [
923
+ _createElementVNode("button", {
924
+ type: "button",
925
+ class: "wd-vplayer__btn wd-vplayer__btn--text",
926
+ "aria-expanded": panelOpen.value === "rate",
927
+ "aria-label": "\u500D\u901F",
928
+ onClick: _cache[9] || (_cache[9] = _withModifiers(($event) => togglePanel("rate"), ["stop"]))
929
+ }, _toDisplayString(rate.value) + "\xD7", 9, _hoisted_26),
930
+ panelOpen.value === "rate" ? (_openBlock(), _createElementBlock("div", {
931
+ key: 0,
932
+ class: "wd-vplayer__panel wd-vplayer__panel--rates",
933
+ onClick: _cache[10] || (_cache[10] = _withModifiers(() => {
934
+ }, ["stop"]))
935
+ }, [
936
+ (_openBlock(true), _createElementBlock(
937
+ _Fragment,
938
+ null,
939
+ _renderList(__props.rates, (r) => {
940
+ return _openBlock(), _createElementBlock("button", {
941
+ key: r,
942
+ type: "button",
943
+ class: _normalizeClass({ "is-on": r === rate.value }),
944
+ onClick: ($event) => setRate(r)
945
+ }, _toDisplayString(r) + "\xD7", 11, _hoisted_27);
946
+ }),
947
+ 128
948
+ /* KEYED_FRAGMENT */
949
+ ))
950
+ ])) : _createCommentVNode("v-if", true)
951
+ ])) : _createCommentVNode("v-if", true),
952
+ _createCommentVNode(" \u9009\u96C6\uFF1A\u53EA\u653E\u6309\u94AE\uFF0C\u62BD\u5C49\u5728\u64AD\u653E\u5668\u5C42\uFF08\u89C1\u4E0B\u65B9\uFF09 "),
953
+ __props.playlist && __props.episodes.length ? (_openBlock(), _createElementBlock("button", {
954
+ key: 5,
955
+ type: "button",
956
+ class: "wd-vplayer__btn",
957
+ "aria-expanded": panelOpen.value === "playlist",
958
+ "aria-label": "\u9009\u96C6",
959
+ onClick: _cache[11] || (_cache[11] = _withModifiers(($event) => togglePanel("playlist"), ["stop"]))
960
+ }, [
961
+ _createVNode(_unref(WdIcon_default), {
962
+ name: "playlist",
963
+ variant: __props.iconStyle,
964
+ size: 17
965
+ }, null, 8, ["variant"])
966
+ ], 8, _hoisted_28)) : _createCommentVNode("v-if", true),
967
+ __props.pip ? (_openBlock(), _createElementBlock("button", {
968
+ key: 6,
969
+ type: "button",
970
+ class: "wd-vplayer__btn",
971
+ "aria-label": "\u753B\u4E2D\u753B",
972
+ onClick: _withModifiers(togglePip, ["stop"])
973
+ }, [
974
+ _createVNode(_unref(WdIcon_default), {
975
+ name: "pip",
976
+ variant: __props.iconStyle,
977
+ size: 17
978
+ }, null, 8, ["variant"])
979
+ ])) : _createCommentVNode("v-if", true),
980
+ _createElementVNode("button", {
981
+ type: "button",
982
+ class: "wd-vplayer__btn",
983
+ "aria-label": "\u5168\u5C4F",
984
+ onClick: _withModifiers(toggleFullscreen, ["stop"])
985
+ }, [
986
+ _createVNode(_unref(WdIcon_default), {
987
+ name: "maximize",
988
+ variant: __props.iconStyle,
989
+ size: 17
990
+ }, null, 8, ["variant"])
991
+ ])
992
+ ])
993
+ ],
994
+ 2
995
+ /* CLASS */
996
+ )
997
+ ],
998
+ 34
999
+ /* CLASS, NEED_HYDRATION */
1000
+ );
1001
+ };
1002
+ }
1003
+ });
1004
+ export {
1005
+ WdVideoPlayer_default as WdVideoPlayer
1006
+ };