xgplayer 2.32.5 → 2.32.6
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/browser/controls/airplay.js +1 -1
- package/browser/controls/cssFullscreen.js +1 -1
- package/browser/controls/danmu.js +3 -1
- package/browser/controls/definition.js +1 -1
- package/browser/controls/download.js +1 -1
- package/browser/controls/enter.js +1 -1
- package/browser/controls/error.js +1 -1
- package/browser/controls/errorRetry.js +1 -1
- package/browser/controls/flex.js +1 -1
- package/browser/controls/fullscreen.js +1 -1
- package/browser/controls/loading.js +1 -1
- package/browser/controls/memoryPlay.js +1 -1
- package/browser/controls/miniplayer.js +9 -7
- package/browser/controls/mobile.js +1 -1
- package/browser/controls/nativeTextTrack.js +1 -1
- package/browser/controls/pc.js +1 -1
- package/browser/controls/pip.js +1 -1
- package/browser/controls/play.js +1 -1
- package/browser/controls/playNext.js +1 -1
- package/browser/controls/playbackRate.js +1 -1
- package/browser/controls/poster.js +1 -1
- package/browser/controls/progress.js +1 -1
- package/browser/controls/reload.js +1 -1
- package/browser/controls/replay.js +1 -1
- package/browser/controls/rotate.js +1 -1
- package/browser/controls/screenShot.js +1 -1
- package/browser/controls/start.js +1 -1
- package/browser/controls/textTrack.js +1 -1
- package/browser/controls/time.js +1 -1
- package/browser/controls/volume.js +1 -1
- package/browser/core_player.js +1 -1
- package/browser/core_player.js.map +1 -1
- package/browser/index.js +11 -7
- package/browser/index.js.map +1 -1
- package/browser/simple_player.js +1 -1
- package/browser/simple_player.js.map +1 -1
- package/dist/controls/airplay.js +1 -1
- package/dist/controls/cssFullscreen.js +1 -1
- package/dist/controls/danmu.js +3 -1
- package/dist/controls/definition.js +1 -1
- package/dist/controls/download.js +1 -1
- package/dist/controls/enter.js +1 -1
- package/dist/controls/error.js +1 -1
- package/dist/controls/errorRetry.js +1 -1
- package/dist/controls/flex.js +1 -1
- package/dist/controls/fullscreen.js +1 -1
- package/dist/controls/loading.js +1 -1
- package/dist/controls/memoryPlay.js +1 -1
- package/dist/controls/miniplayer.js +9 -7
- package/dist/controls/mobile.js +1 -1
- package/dist/controls/nativeTextTrack.js +1 -1
- package/dist/controls/pc.js +1 -1
- package/dist/controls/pip.js +1 -1
- package/dist/controls/play.js +1 -1
- package/dist/controls/playNext.js +1 -1
- package/dist/controls/playbackRate.js +1 -1
- package/dist/controls/poster.js +1 -1
- package/dist/controls/progress.js +1 -1
- package/dist/controls/reload.js +1 -1
- package/dist/controls/replay.js +1 -1
- package/dist/controls/rotate.js +1 -1
- package/dist/controls/screenShot.js +1 -1
- package/dist/controls/start.js +1 -1
- package/dist/controls/textTrack.js +1 -1
- package/dist/controls/time.js +1 -1
- package/dist/controls/volume.js +1 -1
- package/dist/core_player.js +2960 -2889
- package/dist/core_player.js.map +1 -1
- package/dist/index.js +1938 -3321
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/simple_player.js +274 -281
- package/dist/simple_player.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +216 -0
- package/es/constant.d.ts +4 -0
- package/es/constant.js +5 -0
- package/es/controls/airplay.js +1 -1
- package/es/controls/cssFullscreen.js +1 -1
- package/es/controls/danmu.js +3 -1
- package/es/controls/definition.js +1 -1
- package/es/controls/download.js +1 -1
- package/es/controls/enter.js +1 -1
- package/es/controls/error.js +1 -1
- package/es/controls/errorRetry.js +1 -1
- package/es/controls/flex.js +1 -1
- package/es/controls/fullscreen.js +1 -1
- package/es/controls/i18n.js +1 -1
- package/es/controls/keyboard.js +1 -1
- package/es/controls/loading.js +1 -1
- package/es/controls/localPreview.js +1 -1
- package/es/controls/memoryPlay.js +1 -1
- package/es/controls/miniplayer.js +9 -7
- package/es/controls/mobile.js +1 -1
- package/es/controls/nativeTextTrack.js +1 -1
- package/es/controls/pc.js +1 -1
- package/es/controls/pip.js +1 -1
- package/es/controls/play.js +1 -1
- package/es/controls/playNext.js +1 -1
- package/es/controls/playbackRate.js +1 -1
- package/es/controls/poster.js +1 -1
- package/es/controls/progress.js +1 -1
- package/es/controls/reload.js +1 -1
- package/es/controls/replay.js +1 -1
- package/es/controls/rotate.js +1 -1
- package/es/controls/screenShot.js +1 -1
- package/es/controls/start.js +1 -1
- package/es/controls/textTrack.js +1 -1
- package/es/controls/time.js +1 -1
- package/es/controls/volume.js +1 -1
- package/es/core_player.js +1 -1
- package/es/core_player.js.map +1 -1
- package/es/defaultConfig.d.ts +243 -0
- package/es/defaultConfig.js +85 -0
- package/es/error.d.ts +114 -0
- package/es/error.js +75 -0
- package/es/events.d.ts +61 -0
- package/es/events.js +62 -0
- package/es/icons.d.ts +2 -0
- package/es/index.css +499 -0
- package/es/index.d.ts +25 -0
- package/es/index.js +11 -7
- package/es/index.js.map +1 -1
- package/es/index.scss +29 -0
- package/es/index.umd.d.ts +60 -0
- package/es/index.umd.js +30 -0
- package/es/lang/en.d.ts +91 -0
- package/es/lang/en.js +77 -0
- package/es/lang/i18n.d.ts +36 -0
- package/es/lang/i18n.js +122 -0
- package/es/lang/index.d.ts +2 -0
- package/es/lang/jp.d.ts +91 -0
- package/es/lang/jp.js +77 -0
- package/es/lang/zh-cn.d.ts +91 -0
- package/es/lang/zh-cn.js +77 -0
- package/es/lang/zh-hk.d.ts +91 -0
- package/es/lang/zh-hk.js +77 -0
- package/es/mediaProxy.d.ts +334 -0
- package/es/mediaProxy.js +623 -0
- package/es/player.d.ts +825 -0
- package/es/player.js +1945 -0
- package/es/plugin/basePlugin.d.ts +180 -0
- package/es/plugin/basePlugin.js +259 -0
- package/es/plugin/hooksDescriptor.d.ts +60 -0
- package/es/plugin/hooksDescriptor.js +149 -0
- package/es/plugin/index.d.ts +13 -0
- package/es/plugin/plugin.d.ts +207 -0
- package/es/plugin/plugin.js +542 -0
- package/es/plugin/pluginsManager.d.ts +162 -0
- package/es/plugin/pluginsManager.js +362 -0
- package/es/plugin/preset.d.ts +1 -0
- package/es/plugin/preset.js +28 -0
- package/es/plugin/resizeObserver.d.ts +3 -0
- package/es/plugin/resizeObserver.js +108 -0
- package/es/plugins/assets/back.js +4 -0
- package/es/plugins/assets/download.js +4 -0
- package/es/plugins/assets/exitCssFull.js +4 -0
- package/es/plugins/assets/exitFull.js +4 -0
- package/es/plugins/assets/loading.js +4 -0
- package/es/plugins/assets/panel.js +4 -0
- package/es/plugins/assets/pause.js +4 -0
- package/es/plugins/assets/pipIcon.js +4 -0
- package/es/plugins/assets/pipIconExit.js +4 -0
- package/es/plugins/assets/play.js +4 -0
- package/es/plugins/assets/playNext.js +4 -0
- package/es/plugins/assets/replay.js +4 -0
- package/es/plugins/assets/requestCssFull.js +7 -0
- package/es/plugins/assets/requestFull.js +4 -0
- package/es/plugins/assets/rotate.js +4 -0
- package/es/plugins/assets/seekicon.js +4 -0
- package/es/plugins/assets/volumeLarge.js +4 -0
- package/es/plugins/assets/volumeMuted.js +4 -0
- package/es/plugins/assets/volumeSmall.js +4 -0
- package/es/plugins/common/iconPlugin.d.ts +5 -0
- package/es/plugins/common/iconPlugin.js +42 -0
- package/es/plugins/common/iconTools.d.ts +1 -0
- package/es/plugins/common/iconTools.js +8 -0
- package/es/plugins/common/index.scss +2 -0
- package/es/plugins/common/optionList.d.ts +15 -0
- package/es/plugins/common/optionList.js +120 -0
- package/es/plugins/common/optionsIcon.d.ts +40 -0
- package/es/plugins/common/optionsIcon.js +304 -0
- package/es/plugins/common/optionsIcon.scss +154 -0
- package/es/plugins/common/thumbnail.d.ts +62 -0
- package/es/plugins/common/thumbnail.js +191 -0
- package/es/plugins/common/thumbnail.scss +27 -0
- package/es/plugins/controls/index.css +132 -0
- package/es/plugins/controls/index.d.ts +73 -0
- package/es/plugins/controls/index.js +189 -0
- package/es/plugins/controls/index.scss +204 -0
- package/es/plugins/cssFullScreen/index.css +12 -0
- package/es/plugins/cssFullScreen/index.d.ts +40 -0
- package/es/plugins/cssFullScreen/index.js +136 -0
- package/es/plugins/cssFullScreen/index.scss +19 -0
- package/es/plugins/danmu/danmuIcon.d.ts +24 -0
- package/es/plugins/danmu/danmuIcon.js +98 -0
- package/es/plugins/danmu/danmuPanel.d.ts +39 -0
- package/es/plugins/danmu/danmuPanel.js +81 -0
- package/es/plugins/danmu/index.css +603 -0
- package/es/plugins/danmu/index.d.ts +96 -0
- package/es/plugins/danmu/index.js +313 -0
- package/es/plugins/danmu/index.scss +356 -0
- package/es/plugins/definition/index.css +4 -0
- package/es/plugins/definition/index.d.ts +38 -0
- package/es/plugins/definition/index.js +164 -0
- package/es/plugins/definition/index.scss +4 -0
- package/es/plugins/download/index.css +13 -0
- package/es/plugins/download/index.d.ts +31 -0
- package/es/plugins/download/index.js +107 -0
- package/es/plugins/download/index.scss +22 -0
- package/es/plugins/dynamicBg/index.css +16 -0
- package/es/plugins/dynamicBg/index.d.ts +83 -0
- package/es/plugins/dynamicBg/index.js +316 -0
- package/es/plugins/dynamicBg/index.scss +19 -0
- package/es/plugins/enter/index.css +104 -0
- package/es/plugins/enter/index.d.ts +19 -0
- package/es/plugins/enter/index.js +46 -0
- package/es/plugins/enter/index.scss +78 -0
- package/es/plugins/error/index.css +29 -0
- package/es/plugins/error/index.d.ts +8 -0
- package/es/plugins/error/index.js +75 -0
- package/es/plugins/error/index.scss +34 -0
- package/es/plugins/fpsDetect/index.d.ts +34 -0
- package/es/plugins/fpsDetect/index.js +149 -0
- package/es/plugins/fullscreen/backicon.d.ts +17 -0
- package/es/plugins/fullscreen/backicon.js +72 -0
- package/es/plugins/fullscreen/index.css +23 -0
- package/es/plugins/fullscreen/index.d.ts +58 -0
- package/es/plugins/fullscreen/index.js +202 -0
- package/es/plugins/fullscreen/index.scss +35 -0
- package/es/plugins/gapJump/index.d.ts +21 -0
- package/es/plugins/gapJump/index.js +142 -0
- package/es/plugins/keyboard/index.d.ts +89 -0
- package/es/plugins/keyboard/index.js +421 -0
- package/es/plugins/loading/index.css +58 -0
- package/es/plugins/loading/index.d.ts +11 -0
- package/es/plugins/loading/index.js +43 -0
- package/es/plugins/loading/index.scss +70 -0
- package/es/plugins/logger/index.d.ts +54 -0
- package/es/plugins/logger/index.js +311 -0
- package/es/plugins/miniScreen/index.css +179 -0
- package/es/plugins/miniScreen/index.d.ts +68 -0
- package/es/plugins/miniScreen/index.js +212 -0
- package/es/plugins/miniScreen/index.scss +198 -0
- package/es/plugins/miniScreen/miniScreenIcon.d.ts +11 -0
- package/es/plugins/miniScreen/miniScreenIcon.js +56 -0
- package/es/plugins/mobile/index.css +181 -0
- package/es/plugins/mobile/index.d.ts +125 -0
- package/es/plugins/mobile/index.js +631 -0
- package/es/plugins/mobile/index.scss +180 -0
- package/es/plugins/mobile/touch.d.ts +43 -0
- package/es/plugins/mobile/touch.js +214 -0
- package/es/plugins/netAdaption/index.d.ts +5 -0
- package/es/plugins/pc/index.css +3 -0
- package/es/plugins/pc/index.d.ts +14 -0
- package/es/plugins/pc/index.js +199 -0
- package/es/plugins/pc/index.scss +5 -0
- package/es/plugins/pip/index.css +12 -0
- package/es/plugins/pip/index.d.ts +37 -0
- package/es/plugins/pip/index.js +222 -0
- package/es/plugins/pip/index.scss +21 -0
- package/es/plugins/play/index.css +12 -0
- package/es/plugins/play/index.d.ts +23 -0
- package/es/plugins/play/index.js +127 -0
- package/es/plugins/play/index.scss +18 -0
- package/es/plugins/playNext/index.css +22 -0
- package/es/plugins/playNext/index.d.ts +19 -0
- package/es/plugins/playNext/index.js +104 -0
- package/es/plugins/playNext/index.scss +35 -0
- package/es/plugins/playbackRate/index.css +4 -0
- package/es/plugins/playbackRate/index.d.ts +31 -0
- package/es/plugins/playbackRate/index.js +140 -0
- package/es/plugins/playbackRate/index.scss +6 -0
- package/es/plugins/poster/index.css +39 -0
- package/es/plugins/poster/index.d.ts +27 -0
- package/es/plugins/poster/index.js +109 -0
- package/es/plugins/poster/index.scss +56 -0
- package/es/plugins/progress/index.css +234 -0
- package/es/plugins/progress/index.d.ts +178 -0
- package/es/plugins/progress/index.js +687 -0
- package/es/plugins/progress/index.scss +288 -0
- package/es/plugins/progress/innerList.d.ts +49 -0
- package/es/plugins/progress/innerList.js +285 -0
- package/es/plugins/progress/miniProgress.d.ts +9 -0
- package/es/plugins/progress/miniProgress.js +55 -0
- package/es/plugins/progressPreview/dotsApi.d.ts +1 -0
- package/es/plugins/progressPreview/dotsApi.js +269 -0
- package/es/plugins/progressPreview/index.css +190 -0
- package/es/plugins/progressPreview/index.d.ts +87 -0
- package/es/plugins/progressPreview/index.js +475 -0
- package/es/plugins/progressPreview/index.scss +235 -0
- package/es/plugins/prompt/index.css +47 -0
- package/es/plugins/prompt/index.d.ts +24 -0
- package/es/plugins/prompt/index.js +110 -0
- package/es/plugins/prompt/index.scss +53 -0
- package/es/plugins/replay/index.css +33 -0
- package/es/plugins/replay/index.d.ts +16 -0
- package/es/plugins/replay/index.js +109 -0
- package/es/plugins/replay/index.scss +41 -0
- package/es/plugins/rotate/index.css +0 -0
- package/es/plugins/rotate/index.d.ts +22 -0
- package/es/plugins/rotate/index.js +148 -0
- package/es/plugins/rotate/index.scss +0 -0
- package/es/plugins/rotate/index2.js +2 -0
- package/es/plugins/screenShot/index.css +3 -0
- package/es/plugins/screenShot/index.d.ts +30 -0
- package/es/plugins/screenShot/index.js +178 -0
- package/es/plugins/screenShot/index.scss +5 -0
- package/es/plugins/start/index.css +91 -0
- package/es/plugins/start/index.d.ts +41 -0
- package/es/plugins/start/index.js +267 -0
- package/es/plugins/start/index.scss +115 -0
- package/es/plugins/stats/index.d.ts +38 -0
- package/es/plugins/stats/index.js +194 -0
- package/es/plugins/testspeed/index.d.ts +26 -0
- package/es/plugins/testspeed/index.js +207 -0
- package/es/plugins/time/index.css +46 -0
- package/es/plugins/time/index.d.ts +28 -0
- package/es/plugins/time/index.js +225 -0
- package/es/plugins/time/index.scss +57 -0
- package/es/plugins/time/timesegments.d.ts +24 -0
- package/es/plugins/time/timesegments.js +216 -0
- package/es/plugins/track/index.css +91 -0
- package/es/plugins/track/index.d.ts +132 -0
- package/es/plugins/track/index.js +463 -0
- package/es/plugins/track/index.scss +111 -0
- package/es/plugins/track/nativeSubTitle.d.ts +22 -0
- package/es/plugins/track/nativeSubTitle.js +94 -0
- package/es/plugins/volume/index.css +95 -0
- package/es/plugins/volume/index.d.ts +88 -0
- package/es/plugins/volume/index.js +319 -0
- package/es/plugins/volume/index.scss +124 -0
- package/es/plugins/waitingTimeoutJump/index.d.ts +15 -0
- package/es/plugins/waitingTimeoutJump/index.js +88 -0
- package/es/presets/default-en.d.ts +33 -0
- package/es/presets/default-en.js +63 -0
- package/es/presets/default.d.ts +34 -0
- package/es/presets/default.js +70 -0
- package/es/presets/index.d.ts +4 -0
- package/es/presets/live.d.ts +94 -0
- package/es/presets/live.js +39 -0
- package/es/presets/mobile.d.ts +103 -0
- package/es/presets/mobile.js +34 -0
- package/es/simple_player.js +1 -1
- package/es/simple_player.js.map +1 -1
- package/es/state.d.ts +11 -0
- package/es/state.js +12 -0
- package/es/stateClassMap.d.ts +32 -0
- package/es/stateClassMap.js +32 -0
- package/es/style/common/animation.scss +16 -0
- package/es/style/common/svg-url.scss +70 -0
- package/es/style/common.scss +457 -0
- package/es/style/index.scss +4 -0
- package/es/style/variable.scss +76 -0
- package/es/utils/database.d.ts +31 -0
- package/es/utils/database.js +107 -0
- package/es/utils/debug.d.ts +10 -0
- package/es/utils/debug.js +43 -0
- package/es/utils/draggabilly.d.ts +54 -0
- package/es/utils/draggabilly.js +410 -0
- package/es/utils/sniffer.d.ts +28 -0
- package/es/utils/sniffer.js +150 -0
- package/es/utils/url.d.ts +1 -0
- package/es/utils/util.d.ts +304 -0
- package/es/utils/util.js +827 -0
- package/es/utils/xgplayerTimeRange.d.ts +7 -0
- package/es/utils/xgplayerTimeRange.js +25 -0
- package/es/version.d.ts +2 -0
- package/es/version.js +2 -0
- package/package.json +2 -3
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
@import "../../style/variable";
|
|
2
|
+
|
|
3
|
+
.xgplayer {
|
|
4
|
+
.xgplayer-progress {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
position: relative;
|
|
8
|
+
min-width: 50px;
|
|
9
|
+
height: 12px;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
top: 0;
|
|
13
|
+
outline: none;
|
|
14
|
+
flex: 1;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.xgplayer-progress-outer {
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 2px;
|
|
22
|
+
border-radius: 3px;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.progress-list {
|
|
27
|
+
display: flex;
|
|
28
|
+
height: 100%;
|
|
29
|
+
width: 100%;
|
|
30
|
+
border-radius: inherit;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.xgplayer-progress-inner {
|
|
34
|
+
position: relative;
|
|
35
|
+
flex: 1;
|
|
36
|
+
height: 100%;
|
|
37
|
+
background: $progressOuterBgColor;
|
|
38
|
+
transition: height 0.2s ease-in, opacity 0.2s ease-out;
|
|
39
|
+
border-radius: inherit;
|
|
40
|
+
margin-right: 2px;
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
&:last-child, &:only-child{
|
|
43
|
+
margin-right: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.inner-focus-point {
|
|
48
|
+
background: #fff;
|
|
49
|
+
position: relative;
|
|
50
|
+
&:before, &:after{
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: 0;
|
|
53
|
+
content: ' ';
|
|
54
|
+
display: block;
|
|
55
|
+
width: 2px;
|
|
56
|
+
height: 300%;
|
|
57
|
+
top: 50%;
|
|
58
|
+
z-index: 1;
|
|
59
|
+
transform: translateY(-50%);
|
|
60
|
+
border-radius: 3px;
|
|
61
|
+
background: #fff;
|
|
62
|
+
}
|
|
63
|
+
&:before {
|
|
64
|
+
left: 0;
|
|
65
|
+
}
|
|
66
|
+
&:after {
|
|
67
|
+
right: 0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.xgplayer-progress-cache,.xgplayer-progress-played {
|
|
72
|
+
display: block;
|
|
73
|
+
height: 100%;
|
|
74
|
+
width: 0;
|
|
75
|
+
position:absolute;
|
|
76
|
+
top: 0;
|
|
77
|
+
left: 0;
|
|
78
|
+
border-radius: inherit;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.xgplayer-progress-played {
|
|
82
|
+
background: $progressPlayedBgImage
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.xgplayer-progress-cache {
|
|
86
|
+
background: $progressCacheBgColor
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* 滑块样式 */
|
|
90
|
+
.xgplayer-progress-btn {
|
|
91
|
+
display: block;
|
|
92
|
+
background: rgba(255, 94, 94, 0.304093);
|
|
93
|
+
border: 0.5px solid rgba(255, 94, 94, 0.056545);
|
|
94
|
+
box-shadow: 0px 0px 1px rgba(255, 0, 0, 0.382897);
|
|
95
|
+
width: 20px;
|
|
96
|
+
height: 20px;
|
|
97
|
+
border-radius: 30px;
|
|
98
|
+
left: 0;
|
|
99
|
+
top: 50%;
|
|
100
|
+
position: absolute;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
transform: translate(-50%, -50%);
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
&:before {
|
|
106
|
+
content: ' ';
|
|
107
|
+
display: block;
|
|
108
|
+
position: relative;
|
|
109
|
+
width: 12px;
|
|
110
|
+
height: 12px;
|
|
111
|
+
left: 50%;
|
|
112
|
+
top: 50%;
|
|
113
|
+
transform: translate(-50%, -50%);
|
|
114
|
+
border-radius: 30px;
|
|
115
|
+
background: #FFFFFF;
|
|
116
|
+
}
|
|
117
|
+
&.active {
|
|
118
|
+
border: 4px solid rgba(255, 94, 94, 0.064057);
|
|
119
|
+
&:before{
|
|
120
|
+
box-shadow: 0px 0px 3px rgba(248, 89, 89, 0.689);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* 进度条打点*/
|
|
126
|
+
.xgplayer-progress-dot {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
position: absolute;
|
|
129
|
+
height: 100%;
|
|
130
|
+
width: 5px;
|
|
131
|
+
top: 0px;
|
|
132
|
+
background: white;
|
|
133
|
+
border-radius: 6px;
|
|
134
|
+
z-index: 16;
|
|
135
|
+
.xgplayer-progress-tip {
|
|
136
|
+
position: absolute;
|
|
137
|
+
left: 25%;
|
|
138
|
+
top: -40px;
|
|
139
|
+
height: auto;
|
|
140
|
+
line-height: 30px;
|
|
141
|
+
width: auto;
|
|
142
|
+
transform: scale(0.8) translateX(-50%);
|
|
143
|
+
background: rgba(0, 0, 0, .3);
|
|
144
|
+
border-radius: 6px;
|
|
145
|
+
border: 1px solid rgba(0, 0, 0, .8);
|
|
146
|
+
cursor: default;
|
|
147
|
+
white-space: nowrap;
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
&:hover {
|
|
151
|
+
.xgplayer-progress-tip {
|
|
152
|
+
display: block;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.flex-controls {
|
|
158
|
+
.xgplayer-progress {
|
|
159
|
+
transform: translateY(0);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.xgplayer-pc {
|
|
164
|
+
.xgplayer-progress-btn {
|
|
165
|
+
transform: translate(-50%, -50%) scale(0);
|
|
166
|
+
}
|
|
167
|
+
.xgplayer-progress-outer {
|
|
168
|
+
height: 3px;
|
|
169
|
+
}
|
|
170
|
+
.xgplayer-progress-inner {
|
|
171
|
+
margin-right: 4px;
|
|
172
|
+
&:last-child, &:only-child{
|
|
173
|
+
margin-right: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
.inner-focus-point {
|
|
177
|
+
&:before, &:after{
|
|
178
|
+
width: 3px;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.inner-focus-highlight {
|
|
183
|
+
background:rgba(255, 255, 255, 0.8);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.xgplayer-progress {
|
|
187
|
+
&.active {
|
|
188
|
+
.xgplayer-progress-outer {
|
|
189
|
+
height: 6px;
|
|
190
|
+
margin-bottom: 3px;
|
|
191
|
+
transition: height .3s ease, margin-bottom .3s ease;
|
|
192
|
+
// .xgplayer-progress-point {
|
|
193
|
+
// display: block;
|
|
194
|
+
// }
|
|
195
|
+
}
|
|
196
|
+
.xgplayer-progress-btn {
|
|
197
|
+
transform: translate(-50%, -50%) scale(1);
|
|
198
|
+
}
|
|
199
|
+
.inner-focus-point {
|
|
200
|
+
&:before, &:after{
|
|
201
|
+
width: 6px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// 进度条位于底部的时候
|
|
208
|
+
.xgplayer-progress-bottom {
|
|
209
|
+
.xgplayer-progress-outer {
|
|
210
|
+
top: 9px;
|
|
211
|
+
}
|
|
212
|
+
.xgplayer-progress-btn {
|
|
213
|
+
&:before {
|
|
214
|
+
height: 6px;
|
|
215
|
+
width: 6px;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&.xgplayer-mobile {
|
|
221
|
+
// 进度条位于底部的时候
|
|
222
|
+
.xgplayer-progress-bottom {
|
|
223
|
+
.xgplayer-progress-outer {
|
|
224
|
+
height: 4px;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
@media (prefers-color-scheme: dark) {
|
|
230
|
+
.xgplayer {
|
|
231
|
+
.xgplayer-progress {
|
|
232
|
+
.xgplayer-progress-inner {
|
|
233
|
+
background-color: $progressOuterBgColor;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.inner-focus-highlight {
|
|
237
|
+
background:rgba(255, 255, 255, 0.8);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.xgplayer-progress-btn {
|
|
241
|
+
background: rgba(255, 94, 94, 0.304093);
|
|
242
|
+
border: 0.5px solid rgba(255, 94, 94, 0.056545);
|
|
243
|
+
box-shadow: 0px 0px 1px rgba(255, 0, 0, 0.382897);
|
|
244
|
+
&:before {
|
|
245
|
+
background-color: #fff;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
.xgplayer-progress-played {
|
|
249
|
+
background-color: $progressPlayedBgImage
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.xgplayer-progress-cache {
|
|
253
|
+
background-color: $progressCacheBgColor
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.xg-mini-progress {
|
|
260
|
+
display: none;
|
|
261
|
+
position: absolute;
|
|
262
|
+
height: 2px;
|
|
263
|
+
left: 0;
|
|
264
|
+
right: 0;
|
|
265
|
+
bottom: 0px;
|
|
266
|
+
// background-color: red;
|
|
267
|
+
pointer-events: none;
|
|
268
|
+
xg-mini-progress-played, xg-mini-progress-cache{
|
|
269
|
+
height: 100%;
|
|
270
|
+
width: 0;
|
|
271
|
+
position:absolute;
|
|
272
|
+
top: 0;
|
|
273
|
+
left: 0;
|
|
274
|
+
border-radius: inherit;
|
|
275
|
+
}
|
|
276
|
+
xg-mini-progress-played {
|
|
277
|
+
background: $progressPlayedBgImage
|
|
278
|
+
}
|
|
279
|
+
xg-mini-progress-cache {
|
|
280
|
+
background: $progressCacheBgColor
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.xgplayer-inactive, .xgplayer-mini {
|
|
285
|
+
.xg-mini-progress {
|
|
286
|
+
display: block;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default class InnerList {
|
|
2
|
+
constructor(args: any);
|
|
3
|
+
fragments: any;
|
|
4
|
+
_callBack: any;
|
|
5
|
+
fragConfig: {
|
|
6
|
+
fragFocusClass: any;
|
|
7
|
+
fragAutoFocus: boolean;
|
|
8
|
+
fragClass: any;
|
|
9
|
+
};
|
|
10
|
+
style: any;
|
|
11
|
+
duration: number;
|
|
12
|
+
cachedIndex: number;
|
|
13
|
+
playedIndex: number;
|
|
14
|
+
focusIndex: number;
|
|
15
|
+
updateDuration(duration: any): void;
|
|
16
|
+
updateProgress(type?: string, data?: {
|
|
17
|
+
newIndex: number;
|
|
18
|
+
curIndex: number;
|
|
19
|
+
millisecond: number;
|
|
20
|
+
}): void;
|
|
21
|
+
updateFocus(data: any): void;
|
|
22
|
+
update(data: {
|
|
23
|
+
cached: number;
|
|
24
|
+
played: number;
|
|
25
|
+
}, duration: any): void;
|
|
26
|
+
findIndex(time: any, curIndex: any): any;
|
|
27
|
+
findHightLight(): {
|
|
28
|
+
dom: Element;
|
|
29
|
+
pos: DOMRect;
|
|
30
|
+
};
|
|
31
|
+
findFragment(index: any): {
|
|
32
|
+
dom: Element;
|
|
33
|
+
pos: DOMRect;
|
|
34
|
+
};
|
|
35
|
+
unHightLight(): void;
|
|
36
|
+
setHightLight(index: any): {
|
|
37
|
+
dom: Element;
|
|
38
|
+
pos: DOMRect;
|
|
39
|
+
};
|
|
40
|
+
destroy(): void;
|
|
41
|
+
progressList: any;
|
|
42
|
+
/**
|
|
43
|
+
* 重置当前
|
|
44
|
+
* @param {*} newOptions
|
|
45
|
+
*/
|
|
46
|
+
reset(newOptions: any): void;
|
|
47
|
+
render(): HTMLElement;
|
|
48
|
+
root: HTMLElement;
|
|
49
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { createClass as _createClass, classCallCheck as _classCallCheck } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import util from "../../utils/util.js";
|
|
3
|
+
import "../../utils/debug.js";
|
|
4
|
+
import "delegate";
|
|
5
|
+
var TPL = [{
|
|
6
|
+
tag: "xg-cache",
|
|
7
|
+
className: "xgplayer-progress-cache",
|
|
8
|
+
styleKey: "cachedColor"
|
|
9
|
+
}, {
|
|
10
|
+
tag: "xg-played",
|
|
11
|
+
className: "xgplayer-progress-played",
|
|
12
|
+
styleKey: "playedColor"
|
|
13
|
+
}];
|
|
14
|
+
var InnerList = /* @__PURE__ */ function() {
|
|
15
|
+
function InnerList2(args) {
|
|
16
|
+
_classCallCheck(this, InnerList2);
|
|
17
|
+
this.fragments = args.fragments || [];
|
|
18
|
+
if (this.fragments.length === 0) {
|
|
19
|
+
this.fragments.push({
|
|
20
|
+
percent: 1
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
this._callBack = args.actionCallback;
|
|
24
|
+
this.fragConfig = {
|
|
25
|
+
fragFocusClass: args.fragFocusClass || "inner-focus-point",
|
|
26
|
+
fragAutoFocus: !!args.fragAutoFocus,
|
|
27
|
+
fragClass: args.fragClass || ""
|
|
28
|
+
};
|
|
29
|
+
this.style = args.style || {
|
|
30
|
+
playedColor: "",
|
|
31
|
+
cachedColor: "",
|
|
32
|
+
progressColor: ""
|
|
33
|
+
};
|
|
34
|
+
this.duration = 0;
|
|
35
|
+
this.cachedIndex = 0;
|
|
36
|
+
this.playedIndex = 0;
|
|
37
|
+
this.focusIndex = -1;
|
|
38
|
+
}
|
|
39
|
+
_createClass(InnerList2, [{
|
|
40
|
+
key: "updateDuration",
|
|
41
|
+
value: function updateDuration(duration) {
|
|
42
|
+
var _this = this;
|
|
43
|
+
this.duration = duration;
|
|
44
|
+
var start = 0;
|
|
45
|
+
var fragments = this.fragments;
|
|
46
|
+
this.fragments = fragments.map(function(item) {
|
|
47
|
+
item.start = parseInt(start, 10);
|
|
48
|
+
item.end = parseInt(start + item.percent * _this.duration, 10);
|
|
49
|
+
item.duration = parseInt(item.percent * _this.duration, 10);
|
|
50
|
+
start += item.percent * _this.duration;
|
|
51
|
+
return item;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
key: "updateProgress",
|
|
56
|
+
value: function updateProgress() {
|
|
57
|
+
var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "played";
|
|
58
|
+
var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
59
|
+
newIndex: 0,
|
|
60
|
+
curIndex: 0,
|
|
61
|
+
millisecond: 0
|
|
62
|
+
};
|
|
63
|
+
var progressList = this.progressList, fragments = this.fragments;
|
|
64
|
+
if (progressList.length < 1) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
var newIndex = data.newIndex, curIndex = data.curIndex, millisecond = data.millisecond;
|
|
68
|
+
if (newIndex !== curIndex) {
|
|
69
|
+
progressList.map(function(item, index) {
|
|
70
|
+
if (index < newIndex) {
|
|
71
|
+
item[type].style.width = "100%";
|
|
72
|
+
} else if (index > newIndex) {
|
|
73
|
+
item[type].style.width = 0;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
var curPFrag = fragments[newIndex];
|
|
78
|
+
var per = millisecond === 0 ? 0 : (millisecond - curPFrag.start) / curPFrag.duration;
|
|
79
|
+
progressList[newIndex][type].style.width = per < 0 ? 0 : "".concat(per * 100, "%");
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "updateFocus",
|
|
83
|
+
value: function updateFocus(data) {
|
|
84
|
+
if (!this.fragConfig.fragAutoFocus || this.fragments.length < 2) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!data) {
|
|
88
|
+
if (this.focusIndex > -1) {
|
|
89
|
+
this.unHightLight(this.focusIndex);
|
|
90
|
+
var _data = {
|
|
91
|
+
index: -1,
|
|
92
|
+
preIndex: this.focusIndex,
|
|
93
|
+
fragment: null
|
|
94
|
+
};
|
|
95
|
+
this._callBack && this._callBack(_data);
|
|
96
|
+
this.focusIndex = -1;
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
var newPIndex = this.findIndex(data.currentTime * 1e3, this.focusIndex);
|
|
101
|
+
if (newPIndex >= 0 && newPIndex !== this.focusIndex) {
|
|
102
|
+
this.focusIndex > -1 && this.unHightLight(this.focusIndex);
|
|
103
|
+
this.setHightLight(newPIndex);
|
|
104
|
+
var _data2 = {
|
|
105
|
+
index: newPIndex,
|
|
106
|
+
preIndex: this.focusIndex,
|
|
107
|
+
fragment: this.fragments[this.focusIndex]
|
|
108
|
+
};
|
|
109
|
+
this.focusIndex = newPIndex;
|
|
110
|
+
this._callBack && this._callBack(_data2);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "update",
|
|
115
|
+
value: function update() {
|
|
116
|
+
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
117
|
+
cached: 0,
|
|
118
|
+
played: 0
|
|
119
|
+
};
|
|
120
|
+
var duration = arguments.length > 1 ? arguments[1] : void 0;
|
|
121
|
+
if (!this.duration || parseInt(duration * 1e3, 10) !== this.duration) {
|
|
122
|
+
if (!duration && duration !== 0) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
this.updateDuration(parseInt(duration * 1e3, 10));
|
|
126
|
+
}
|
|
127
|
+
var playedIndex = this.playedIndex, cachedIndex = this.cachedIndex;
|
|
128
|
+
if (util.typeOf(data.played) !== "Undefined") {
|
|
129
|
+
var newPIndex = this.findIndex(data.played * 1e3, playedIndex);
|
|
130
|
+
if (newPIndex < 0) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.updateProgress("played", {
|
|
134
|
+
newIndex: newPIndex,
|
|
135
|
+
curIndex: playedIndex,
|
|
136
|
+
millisecond: parseInt(data.played * 1e3, 10)
|
|
137
|
+
});
|
|
138
|
+
this.playedIndex = newPIndex;
|
|
139
|
+
}
|
|
140
|
+
if (util.typeOf(data.cached) !== "Undefined") {
|
|
141
|
+
var newCIndex = this.findIndex(data.cached * 1e3, cachedIndex);
|
|
142
|
+
if (newCIndex < 0) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.updateProgress("cached", {
|
|
146
|
+
newIndex: newCIndex,
|
|
147
|
+
curIndex: cachedIndex,
|
|
148
|
+
millisecond: parseInt(data.cached * 1e3, 10)
|
|
149
|
+
});
|
|
150
|
+
this.cachedIndex = newCIndex;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "findIndex",
|
|
155
|
+
value: function findIndex(time, curIndex) {
|
|
156
|
+
var fragments = this.fragments;
|
|
157
|
+
if (!fragments || fragments.length === 0) {
|
|
158
|
+
return -1;
|
|
159
|
+
}
|
|
160
|
+
if (fragments.length === 1) {
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
if (curIndex > -1 && curIndex < fragments.length && time > fragments[curIndex].start && time < fragments[curIndex].end) {
|
|
164
|
+
return curIndex;
|
|
165
|
+
}
|
|
166
|
+
if (time > fragments[fragments.length - 1].start) {
|
|
167
|
+
return fragments.length - 1;
|
|
168
|
+
}
|
|
169
|
+
for (var i = 0; i < fragments.length; i++) {
|
|
170
|
+
if (time > fragments[i].start && time <= fragments[i].end) {
|
|
171
|
+
curIndex = i;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return curIndex;
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
key: "findHightLight",
|
|
179
|
+
value: function findHightLight() {
|
|
180
|
+
var children = this.root.children;
|
|
181
|
+
for (var i = 0; i < children.length; i++) {
|
|
182
|
+
if (util.hasClass(children[i], this.fragConfig.fragFocusClass)) {
|
|
183
|
+
return {
|
|
184
|
+
dom: children[i],
|
|
185
|
+
pos: children[i].getBoundingClientRect()
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "findFragment",
|
|
192
|
+
value: function findFragment(index) {
|
|
193
|
+
var children = this.root.children;
|
|
194
|
+
if (index < 0 || index >= children.length) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
dom: children[index],
|
|
199
|
+
pos: children[index].getBoundingClientRect()
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}, {
|
|
203
|
+
key: "unHightLight",
|
|
204
|
+
value: function unHightLight() {
|
|
205
|
+
var children = this.root.children;
|
|
206
|
+
for (var i = 0; i < children.length; i++) {
|
|
207
|
+
util.removeClass(children[i], this.fragConfig.fragFocusClass);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, {
|
|
211
|
+
key: "setHightLight",
|
|
212
|
+
value: function setHightLight(index) {
|
|
213
|
+
var children = this.root.children;
|
|
214
|
+
if (index < children.length) {
|
|
215
|
+
util.addClass(children[index], this.fragConfig.fragFocusClass);
|
|
216
|
+
return {
|
|
217
|
+
dom: children[index],
|
|
218
|
+
pos: children[index].getBoundingClientRect()
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}, {
|
|
223
|
+
key: "destroy",
|
|
224
|
+
value: function destroy() {
|
|
225
|
+
this.progressList = null;
|
|
226
|
+
this.fragments = null;
|
|
227
|
+
this.root.innerHTML = "";
|
|
228
|
+
}
|
|
229
|
+
}, {
|
|
230
|
+
key: "reset",
|
|
231
|
+
value: function reset(newOptions) {
|
|
232
|
+
var _this2 = this;
|
|
233
|
+
Object.keys(this.fragConfig).forEach(function(key) {
|
|
234
|
+
if (newOptions[key] !== void 0) {
|
|
235
|
+
_this2.fragConfig[key] = newOptions[key];
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
if (newOptions.fragments) {
|
|
239
|
+
this.fragments = newOptions.fragments.length === 0 ? [{
|
|
240
|
+
percent: 1
|
|
241
|
+
}] : newOptions.fragments;
|
|
242
|
+
this.updateDuration(this.duration);
|
|
243
|
+
this.playedIndex = 0;
|
|
244
|
+
this.cachedIndex = 0;
|
|
245
|
+
if (this.root) {
|
|
246
|
+
var _c = this.root.children;
|
|
247
|
+
while (_c.length > 0) {
|
|
248
|
+
this.root.removeChild(_c[0]);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
this.render();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "render",
|
|
256
|
+
value: function render() {
|
|
257
|
+
var _this3 = this;
|
|
258
|
+
var progressColor = this.style.progressColor;
|
|
259
|
+
if (!this.root) {
|
|
260
|
+
this.root = util.createDom("xg-inners", "", {}, "progress-list");
|
|
261
|
+
}
|
|
262
|
+
if (this.fragments) {
|
|
263
|
+
var _this$fragConfig = this.fragConfig, fragClass = _this$fragConfig.fragClass, fragFocusClass = _this$fragConfig.fragFocusClass;
|
|
264
|
+
this.progressList = this.fragments.map(function(item) {
|
|
265
|
+
var inner = util.createDom("xg-inner", "", {
|
|
266
|
+
style: progressColor ? "background:".concat(progressColor, "; flex: ").concat(item.percent) : "flex: ".concat(item.percent)
|
|
267
|
+
}, "".concat(item.isFocus ? fragFocusClass : "", " xgplayer-progress-inner ").concat(fragClass));
|
|
268
|
+
_this3.root.appendChild(inner);
|
|
269
|
+
TPL.forEach(function(item2) {
|
|
270
|
+
inner.appendChild(util.createDom(item2.tag, "", {
|
|
271
|
+
style: item2.styleKey ? "background: ".concat(_this3.style[item2.styleKey], "; width:0;") : "width:0;"
|
|
272
|
+
}, item2.className));
|
|
273
|
+
});
|
|
274
|
+
return {
|
|
275
|
+
cached: inner.children[0],
|
|
276
|
+
played: inner.children[1]
|
|
277
|
+
};
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
return this.root;
|
|
281
|
+
}
|
|
282
|
+
}]);
|
|
283
|
+
return InnerList2;
|
|
284
|
+
}();
|
|
285
|
+
export { InnerList as default };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import "../../utils/util.js";
|
|
3
|
+
import "../../utils/debug.js";
|
|
4
|
+
import Plugin from "../../plugin/plugin.js";
|
|
5
|
+
var MiniProgress = /* @__PURE__ */ function(_Plugin) {
|
|
6
|
+
_inherits(MiniProgress2, _Plugin);
|
|
7
|
+
var _super = _createSuper(MiniProgress2);
|
|
8
|
+
function MiniProgress2() {
|
|
9
|
+
_classCallCheck(this, MiniProgress2);
|
|
10
|
+
return _super.apply(this, arguments);
|
|
11
|
+
}
|
|
12
|
+
_createClass(MiniProgress2, [{
|
|
13
|
+
key: "afterCreate",
|
|
14
|
+
value: function afterCreate() {
|
|
15
|
+
}
|
|
16
|
+
}, {
|
|
17
|
+
key: "update",
|
|
18
|
+
value: function update() {
|
|
19
|
+
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
20
|
+
cached: 0,
|
|
21
|
+
played: 0
|
|
22
|
+
};
|
|
23
|
+
var duration = arguments.length > 1 ? arguments[1] : void 0;
|
|
24
|
+
if (!duration || !this.root) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (data.cached) {
|
|
28
|
+
this.find("xg-mini-progress-cache").style.width = "".concat(data.cached / duration * 100, "%");
|
|
29
|
+
}
|
|
30
|
+
if (data.played) {
|
|
31
|
+
this.find("xg-mini-progress-played").style.width = "".concat(data.played / duration * 100, "%");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
key: "render",
|
|
36
|
+
value: function render() {
|
|
37
|
+
if (!this.playerConfig.progress || !this.playerConfig.miniprogress) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
return '<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>';
|
|
41
|
+
}
|
|
42
|
+
}], [{
|
|
43
|
+
key: "pluginName",
|
|
44
|
+
get: function get() {
|
|
45
|
+
return "MiniProgress";
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "defaultConfig",
|
|
49
|
+
get: function get() {
|
|
50
|
+
return {};
|
|
51
|
+
}
|
|
52
|
+
}]);
|
|
53
|
+
return MiniProgress2;
|
|
54
|
+
}(Plugin);
|
|
55
|
+
export { MiniProgress as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function initDotsAPI(plugin: any): void;
|