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,34 @@
|
|
|
1
|
+
@import "../../style/variable";
|
|
2
|
+
|
|
3
|
+
.xgplayer-error {
|
|
4
|
+
background: $errorBgColor;
|
|
5
|
+
display: none;
|
|
6
|
+
position: absolute;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
width:100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
z-index: 6;
|
|
12
|
+
color: $errorColor;
|
|
13
|
+
text-align: center;
|
|
14
|
+
line-height: 100%;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
.xgplayer-error-refresh {
|
|
18
|
+
color: $errorRefreshColor;
|
|
19
|
+
padding: 0 3px;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
}
|
|
22
|
+
.xgplayer-error-text {
|
|
23
|
+
line-height: 18px;
|
|
24
|
+
margin: auto 6px;
|
|
25
|
+
display: block;
|
|
26
|
+
margin-bottom: 20px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.xgplayer-is-error {
|
|
31
|
+
.xgplayer-error {
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { {
|
|
3
|
+
* tick?: number,
|
|
4
|
+
* stuckCount?: number,
|
|
5
|
+
* disable?: boolean,
|
|
6
|
+
* reportFrame?: number
|
|
7
|
+
* } } IFullscreenConfig
|
|
8
|
+
*/
|
|
9
|
+
export default class FpsDetect extends BasePlugin {
|
|
10
|
+
static get defaultConfig(): {
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
tick: number;
|
|
13
|
+
stuckCount: number;
|
|
14
|
+
reportFrame: number;
|
|
15
|
+
};
|
|
16
|
+
timer: any;
|
|
17
|
+
_lastDecodedFrames: any;
|
|
18
|
+
_currentStuckCount: number;
|
|
19
|
+
_lastCheckPoint: number;
|
|
20
|
+
_payload: any[];
|
|
21
|
+
_startTick(): void;
|
|
22
|
+
_timer: NodeJS.Timeout;
|
|
23
|
+
_stopTick(): void;
|
|
24
|
+
_checkStuck(curDecodedFrames: any, totalVideoFrames: any, droppedVideoFrames: any, checkInterval: any): void;
|
|
25
|
+
_reset(): void;
|
|
26
|
+
_checkDecodeFPS(): void;
|
|
27
|
+
}
|
|
28
|
+
export type IFullscreenConfig = {
|
|
29
|
+
tick?: number;
|
|
30
|
+
stuckCount?: number;
|
|
31
|
+
disable?: boolean;
|
|
32
|
+
reportFrame?: number;
|
|
33
|
+
};
|
|
34
|
+
import BasePlugin from "../../plugin";
|
|
@@ -0,0 +1,149 @@
|
|
|
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 { PLAY, PAUSE, ENDED, EMPTIED, FPS_STUCK } from "../../events.js";
|
|
4
|
+
import "../../utils/debug.js";
|
|
5
|
+
import Plugin from "../../plugin/plugin.js";
|
|
6
|
+
var FpsDetect = /* @__PURE__ */ function(_BasePlugin) {
|
|
7
|
+
_inherits(FpsDetect2, _BasePlugin);
|
|
8
|
+
var _super = _createSuper(FpsDetect2);
|
|
9
|
+
function FpsDetect2() {
|
|
10
|
+
_classCallCheck(this, FpsDetect2);
|
|
11
|
+
return _super.apply(this, arguments);
|
|
12
|
+
}
|
|
13
|
+
_createClass(FpsDetect2, [{
|
|
14
|
+
key: "afterCreate",
|
|
15
|
+
value: function afterCreate() {
|
|
16
|
+
var _this = this;
|
|
17
|
+
var player = this.player, config = this.config;
|
|
18
|
+
this.timer = null;
|
|
19
|
+
this._lastDecodedFrames = 0;
|
|
20
|
+
this._currentStuckCount = 0;
|
|
21
|
+
this._lastCheckPoint = null;
|
|
22
|
+
this._payload = [];
|
|
23
|
+
if (config.disabled)
|
|
24
|
+
return;
|
|
25
|
+
var getVideoPlaybackQuality = player.media.getVideoPlaybackQuality;
|
|
26
|
+
if (!getVideoPlaybackQuality)
|
|
27
|
+
return;
|
|
28
|
+
this.on(PLAY, function() {
|
|
29
|
+
_this._startTick();
|
|
30
|
+
});
|
|
31
|
+
this.on(PAUSE, function() {
|
|
32
|
+
_this._stopTick();
|
|
33
|
+
});
|
|
34
|
+
this.on(ENDED, function() {
|
|
35
|
+
_this._stopTick();
|
|
36
|
+
});
|
|
37
|
+
this.on(EMPTIED, function() {
|
|
38
|
+
_this._stopTick();
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "_startTick",
|
|
43
|
+
value: function _startTick() {
|
|
44
|
+
var _this2 = this;
|
|
45
|
+
this._stopTick();
|
|
46
|
+
this._timer = setTimeout(function() {
|
|
47
|
+
_this2._checkDecodeFPS();
|
|
48
|
+
_this2._startTick();
|
|
49
|
+
}, this.config.tick);
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "_stopTick",
|
|
53
|
+
value: function _stopTick() {
|
|
54
|
+
clearTimeout(this._timer);
|
|
55
|
+
this._timer = null;
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "_checkStuck",
|
|
59
|
+
value: function _checkStuck(curDecodedFrames, totalVideoFrames, droppedVideoFrames, checkInterval) {
|
|
60
|
+
var media = this.player.media;
|
|
61
|
+
var hidden = document.hidden;
|
|
62
|
+
var paused = media.paused;
|
|
63
|
+
if (typeof hidden === "boolean" && !hidden && !paused) {
|
|
64
|
+
var curTime = media.currentTime;
|
|
65
|
+
var buffered = media.buffered;
|
|
66
|
+
var enoughBuffer = false;
|
|
67
|
+
var bufs = [];
|
|
68
|
+
for (var i = 0; i < buffered.length; i++) {
|
|
69
|
+
var start = buffered.start(i);
|
|
70
|
+
var end = buffered.end(i);
|
|
71
|
+
bufs.push({
|
|
72
|
+
start,
|
|
73
|
+
end
|
|
74
|
+
});
|
|
75
|
+
if (start <= curTime && curTime <= end - 1) {
|
|
76
|
+
enoughBuffer = true;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (media.readyState === 4 && enoughBuffer) {
|
|
81
|
+
if (this._currentStuckCount > this.config.stuckCount) {
|
|
82
|
+
this.emit(FPS_STUCK, this._payload);
|
|
83
|
+
this._reset();
|
|
84
|
+
} else {
|
|
85
|
+
if (curDecodedFrames <= this.config.reportFrame) {
|
|
86
|
+
this._currentStuckCount++;
|
|
87
|
+
this._payload.push({
|
|
88
|
+
bufs,
|
|
89
|
+
currentTime: media.currentTime,
|
|
90
|
+
curDecodedFrames,
|
|
91
|
+
totalVideoFrames,
|
|
92
|
+
droppedVideoFrames,
|
|
93
|
+
checkInterval
|
|
94
|
+
});
|
|
95
|
+
} else {
|
|
96
|
+
this._reset();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "_reset",
|
|
104
|
+
value: function _reset() {
|
|
105
|
+
this._payload = [];
|
|
106
|
+
this._currentStuckCount = 0;
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
key: "_checkDecodeFPS",
|
|
110
|
+
value: function _checkDecodeFPS() {
|
|
111
|
+
if (!this.player.media) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
var _this$player$media$ge = this.player.media.getVideoPlaybackQuality(), totalVideoFrames = _this$player$media$ge.totalVideoFrames, droppedVideoFrames = _this$player$media$ge.droppedVideoFrames;
|
|
115
|
+
var currTime = performance.now();
|
|
116
|
+
if (totalVideoFrames) {
|
|
117
|
+
if (this._lastCheckPoint) {
|
|
118
|
+
var curDecoded = totalVideoFrames - this._lastDecodedFrames;
|
|
119
|
+
var checkInterval = currTime - this._lastCheckPoint;
|
|
120
|
+
this._checkStuck(curDecoded, totalVideoFrames, droppedVideoFrames, checkInterval);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
this._lastDecodedFrames = totalVideoFrames;
|
|
124
|
+
this._lastCheckPoint = currTime;
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "destroy",
|
|
128
|
+
value: function destroy() {
|
|
129
|
+
this._stopTick();
|
|
130
|
+
}
|
|
131
|
+
}], [{
|
|
132
|
+
key: "pluginName",
|
|
133
|
+
get: function get() {
|
|
134
|
+
return "FpsDetect";
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "defaultConfig",
|
|
138
|
+
get: function get() {
|
|
139
|
+
return {
|
|
140
|
+
disabled: false,
|
|
141
|
+
tick: 1e3,
|
|
142
|
+
stuckCount: 3,
|
|
143
|
+
reportFrame: 0
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}]);
|
|
147
|
+
return FpsDetect2;
|
|
148
|
+
}(Plugin);
|
|
149
|
+
export { FpsDetect as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default class TopBackIcon extends Plugin {
|
|
2
|
+
static get defaultConfig(): {
|
|
3
|
+
position: string;
|
|
4
|
+
index: number;
|
|
5
|
+
};
|
|
6
|
+
onClick: (e: any) => void;
|
|
7
|
+
registerIcons(): {
|
|
8
|
+
screenBack: {
|
|
9
|
+
icon: any;
|
|
10
|
+
class: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
initIcons(): void;
|
|
14
|
+
show(): void;
|
|
15
|
+
render(): string;
|
|
16
|
+
}
|
|
17
|
+
import Plugin from "../../plugin";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, createClass as _createClass } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import util from "../../utils/util.js";
|
|
3
|
+
import "../../utils/debug.js";
|
|
4
|
+
import Plugin, { POSITIONS } from "../../plugin/plugin.js";
|
|
5
|
+
import BackSVG from "../assets/back.js";
|
|
6
|
+
var TopBackIcon = /* @__PURE__ */ function(_Plugin) {
|
|
7
|
+
_inherits(TopBackIcon2, _Plugin);
|
|
8
|
+
var _super = _createSuper(TopBackIcon2);
|
|
9
|
+
function TopBackIcon2() {
|
|
10
|
+
_classCallCheck(this, TopBackIcon2);
|
|
11
|
+
return _super.apply(this, arguments);
|
|
12
|
+
}
|
|
13
|
+
_createClass(TopBackIcon2, [{
|
|
14
|
+
key: "afterCreate",
|
|
15
|
+
value: function afterCreate() {
|
|
16
|
+
var _this = this;
|
|
17
|
+
this.initIcons();
|
|
18
|
+
this.onClick = function(e) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
e.stopPropagation();
|
|
21
|
+
_this.config.onClick(e);
|
|
22
|
+
};
|
|
23
|
+
this.bind(["click", "touchend"], this.onClick);
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "registerIcons",
|
|
27
|
+
value: function registerIcons() {
|
|
28
|
+
return {
|
|
29
|
+
screenBack: {
|
|
30
|
+
icon: BackSVG,
|
|
31
|
+
class: "xg-fullscreen-back"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "initIcons",
|
|
37
|
+
value: function initIcons() {
|
|
38
|
+
var icons = this.icons;
|
|
39
|
+
this.appendChild(this.root, icons.screenBack);
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "show",
|
|
43
|
+
value: function show() {
|
|
44
|
+
util.addClass(this.root, "show");
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "hide",
|
|
48
|
+
value: function hide() {
|
|
49
|
+
util.removeClass(this.root, "show");
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
return '<xg-icon class="xgplayer-back">\n </xg-icon>';
|
|
55
|
+
}
|
|
56
|
+
}], [{
|
|
57
|
+
key: "pluginName",
|
|
58
|
+
get: function get() {
|
|
59
|
+
return "topbackicon";
|
|
60
|
+
}
|
|
61
|
+
}, {
|
|
62
|
+
key: "defaultConfig",
|
|
63
|
+
get: function get() {
|
|
64
|
+
return {
|
|
65
|
+
position: POSITIONS.ROOT_TOP,
|
|
66
|
+
index: 0
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
return TopBackIcon2;
|
|
71
|
+
}(Plugin);
|
|
72
|
+
export { TopBackIcon as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.xgplayer .xgplayer-fullscreen .xg-exit-fullscreen {
|
|
2
|
+
display: none;
|
|
3
|
+
}
|
|
4
|
+
.xgplayer .xgplayer-fullscreen .xg-get-fullscreen {
|
|
5
|
+
display: block;
|
|
6
|
+
}
|
|
7
|
+
.xgplayer .xgplayer-fullscreen[data-state=full] .xg-exit-fullscreen {
|
|
8
|
+
display: block;
|
|
9
|
+
}
|
|
10
|
+
.xgplayer .xgplayer-fullscreen[data-state=full] .xg-get-fullscreen {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
.xgplayer .xg-top-bar .xgplayer-back {
|
|
14
|
+
position: relative;
|
|
15
|
+
left: 0;
|
|
16
|
+
top: 16px;
|
|
17
|
+
width: 34px;
|
|
18
|
+
height: 40px;
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
.xgplayer .xg-top-bar .xgplayer-back.show {
|
|
22
|
+
display: block;
|
|
23
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef { {
|
|
3
|
+
* position?: string,
|
|
4
|
+
* index?: number,
|
|
5
|
+
* useCssFullscreen?: boolean,
|
|
6
|
+
* rotateFullscreen?: boolean,
|
|
7
|
+
* switchCallback?: () => any,
|
|
8
|
+
* target?: null | HTMLElement,
|
|
9
|
+
* disable?: boolean,
|
|
10
|
+
* needBackIcon?: boolean,
|
|
11
|
+
* [propName: string]: any
|
|
12
|
+
* } } IFullscreenConfig
|
|
13
|
+
*/
|
|
14
|
+
export default class Fullscreen extends IconPlugin {
|
|
15
|
+
/**
|
|
16
|
+
* @type IFullscreenConfig
|
|
17
|
+
*/
|
|
18
|
+
static get defaultConfig(): IFullscreenConfig;
|
|
19
|
+
handleFullscreen: any;
|
|
20
|
+
topBackIcon: any;
|
|
21
|
+
/**
|
|
22
|
+
* @private
|
|
23
|
+
*/
|
|
24
|
+
private _onOrientationChange;
|
|
25
|
+
/**
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
private registerIcons;
|
|
29
|
+
initIcons(): void;
|
|
30
|
+
/**
|
|
31
|
+
* 切换全屏
|
|
32
|
+
* @param { Event } [e]
|
|
33
|
+
*/
|
|
34
|
+
toggleFullScreen(e?: Event): void;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* @param { boolean } isFullScreen
|
|
38
|
+
*/
|
|
39
|
+
animate(isFullScreen: boolean): void;
|
|
40
|
+
show(): void;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @returns
|
|
44
|
+
*/
|
|
45
|
+
private render;
|
|
46
|
+
}
|
|
47
|
+
export type IFullscreenConfig = {
|
|
48
|
+
[propName: string]: any;
|
|
49
|
+
position?: string;
|
|
50
|
+
index?: number;
|
|
51
|
+
useCssFullscreen?: boolean;
|
|
52
|
+
rotateFullscreen?: boolean;
|
|
53
|
+
switchCallback?: () => any;
|
|
54
|
+
target?: null | HTMLElement;
|
|
55
|
+
disable?: boolean;
|
|
56
|
+
needBackIcon?: boolean;
|
|
57
|
+
};
|
|
58
|
+
import IconPlugin from "../common/iconPlugin";
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, get as _get, getPrototypeOf as _getPrototypeOf } from "../../_virtual/_rollupPluginBabelHelpers.js";
|
|
2
|
+
import util from "../../utils/util.js";
|
|
3
|
+
import sniffer from "../../utils/sniffer.js";
|
|
4
|
+
import { FULLSCREEN_CHANGE } from "../../events.js";
|
|
5
|
+
import "../../utils/debug.js";
|
|
6
|
+
import { POSITIONS } from "../../plugin/plugin.js";
|
|
7
|
+
import { xgIconTips } from "../common/iconTools.js";
|
|
8
|
+
import Icon from "../common/iconPlugin.js";
|
|
9
|
+
import TopBackIcon from "./backicon.js";
|
|
10
|
+
import FullScreenSvg from "../assets/requestFull.js";
|
|
11
|
+
import ExitFullScreenSvg from "../assets/exitFull.js";
|
|
12
|
+
var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
13
|
+
_inherits(Fullscreen2, _IconPlugin);
|
|
14
|
+
var _super = _createSuper(Fullscreen2);
|
|
15
|
+
function Fullscreen2() {
|
|
16
|
+
var _this;
|
|
17
|
+
_classCallCheck(this, Fullscreen2);
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
22
|
+
_defineProperty(_assertThisInitialized(_this), "_onOrientationChange", function(e) {
|
|
23
|
+
if (_this.player.fullscreen && _this.config.rotateFullscreen) {
|
|
24
|
+
if (window.orientation === 90 || window.orientation === -90) {
|
|
25
|
+
_this.player.setRotateDeg(0);
|
|
26
|
+
} else {
|
|
27
|
+
_this.player.setRotateDeg(90);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return _this;
|
|
32
|
+
}
|
|
33
|
+
_createClass(Fullscreen2, [{
|
|
34
|
+
key: "afterCreate",
|
|
35
|
+
value: function afterCreate() {
|
|
36
|
+
var _this2 = this;
|
|
37
|
+
_get(_getPrototypeOf(Fullscreen2.prototype), "afterCreate", this).call(this);
|
|
38
|
+
var config = this.config, playerConfig = this.playerConfig;
|
|
39
|
+
if (config.disable) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (config.target) {
|
|
43
|
+
this.playerConfig.fullscreenTarget = this.config.target;
|
|
44
|
+
}
|
|
45
|
+
var fullEl = util.getFullScreenEl();
|
|
46
|
+
if (playerConfig.fullscreenTarget === fullEl) {
|
|
47
|
+
this.player.getFullscreen().catch(function(e) {
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
this.initIcons();
|
|
51
|
+
this.handleFullscreen = this.hook("fullscreenChange", this.toggleFullScreen, {
|
|
52
|
+
pre: function pre(e) {
|
|
53
|
+
var fullscreen = _this2.player.fullscreen;
|
|
54
|
+
_this2.emitUserAction(e, "switch_fullscreen", {
|
|
55
|
+
prop: "fullscreen",
|
|
56
|
+
from: fullscreen,
|
|
57
|
+
to: !fullscreen
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
this.bind(".xgplayer-fullscreen", ["touchend", "click"], this.handleFullscreen);
|
|
62
|
+
this.on(FULLSCREEN_CHANGE, function(isFullScreen) {
|
|
63
|
+
var tipsDom = _this2.find(".xg-tips");
|
|
64
|
+
tipsDom && _this2.changeLangTextKey(tipsDom, isFullScreen ? _this2.i18nKeys.EXITFULLSCREEN_TIPS : _this2.i18nKeys.FULLSCREEN_TIPS);
|
|
65
|
+
_this2.animate(isFullScreen);
|
|
66
|
+
});
|
|
67
|
+
if (this.config.needBackIcon) {
|
|
68
|
+
this.topBackIcon = this.player.registerPlugin({
|
|
69
|
+
plugin: TopBackIcon,
|
|
70
|
+
options: {
|
|
71
|
+
config: {
|
|
72
|
+
onClick: function onClick(e) {
|
|
73
|
+
_this2.handleFullscreen(e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
if (sniffer.device === "mobile") {
|
|
80
|
+
window.addEventListener("orientationchange", this._onOrientationChange);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "registerIcons",
|
|
85
|
+
value: function registerIcons() {
|
|
86
|
+
return {
|
|
87
|
+
fullscreen: {
|
|
88
|
+
icon: FullScreenSvg,
|
|
89
|
+
class: "xg-get-fullscreen"
|
|
90
|
+
},
|
|
91
|
+
exitFullscreen: {
|
|
92
|
+
icon: ExitFullScreenSvg,
|
|
93
|
+
class: "xg-exit-fullscreen"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "destroy",
|
|
99
|
+
value: function destroy() {
|
|
100
|
+
_get(_getPrototypeOf(Fullscreen2.prototype), "destroy", this).call(this);
|
|
101
|
+
this.unbind(".xgplayer-icon", sniffer.device === "mobile" ? "touchend" : "click", this.handleFullscreen);
|
|
102
|
+
if (sniffer.device === "mobile") {
|
|
103
|
+
window.removeEventListener("orientationchange", this._onOrientationChange);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "initIcons",
|
|
108
|
+
value: function initIcons() {
|
|
109
|
+
var icons = this.icons;
|
|
110
|
+
this.appendChild(".xgplayer-icon", icons.fullscreen);
|
|
111
|
+
this.appendChild(".xgplayer-icon", icons.exitFullscreen);
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "toggleFullScreen",
|
|
115
|
+
value: function toggleFullScreen(e) {
|
|
116
|
+
if (e) {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
e.stopPropagation();
|
|
119
|
+
}
|
|
120
|
+
var player = this.player, config = this.config;
|
|
121
|
+
var useCssFullscreen = config.useCssFullscreen === true || typeof config.useCssFullscreen === "function" && config.useCssFullscreen();
|
|
122
|
+
if (useCssFullscreen) {
|
|
123
|
+
if (player.fullscreen) {
|
|
124
|
+
player.exitCssFullscreen();
|
|
125
|
+
} else {
|
|
126
|
+
player.getCssFullscreen();
|
|
127
|
+
}
|
|
128
|
+
this.animate(player.fullscreen);
|
|
129
|
+
} else if (config.rotateFullscreen) {
|
|
130
|
+
if (player.fullscreen) {
|
|
131
|
+
player.exitRotateFullscreen();
|
|
132
|
+
} else {
|
|
133
|
+
player.getRotateFullscreen();
|
|
134
|
+
}
|
|
135
|
+
this.animate(player.fullscreen);
|
|
136
|
+
} else if (config.switchCallback && typeof config.switchCallback === "function") {
|
|
137
|
+
config.switchCallback(player.fullscreen);
|
|
138
|
+
} else {
|
|
139
|
+
if (player.fullscreen) {
|
|
140
|
+
player.exitFullscreen();
|
|
141
|
+
} else {
|
|
142
|
+
player.getFullscreen().catch(function(e2) {
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "animate",
|
|
149
|
+
value: function animate(isFullScreen) {
|
|
150
|
+
isFullScreen ? this.setAttr("data-state", "full") : this.setAttr("data-state", "normal");
|
|
151
|
+
if (this.topBackIcon) {
|
|
152
|
+
if (isFullScreen) {
|
|
153
|
+
this.topBackIcon.show();
|
|
154
|
+
this.hide();
|
|
155
|
+
} else {
|
|
156
|
+
this.topBackIcon.hide();
|
|
157
|
+
this.show();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, {
|
|
162
|
+
key: "show",
|
|
163
|
+
value: function show() {
|
|
164
|
+
_get(_getPrototypeOf(Fullscreen2.prototype), "show", this).call(this);
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "hide",
|
|
168
|
+
value: function hide() {
|
|
169
|
+
_get(_getPrototypeOf(Fullscreen2.prototype), "hide", this).call(this);
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
key: "render",
|
|
173
|
+
value: function render() {
|
|
174
|
+
if (this.config.disable) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
var langKey = "FULLSCREEN_TIPS";
|
|
178
|
+
return '<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n '.concat(xgIconTips(this, langKey, this.playerConfig.isHideTips), "\n </xg-icon>");
|
|
179
|
+
}
|
|
180
|
+
}], [{
|
|
181
|
+
key: "pluginName",
|
|
182
|
+
get: function get() {
|
|
183
|
+
return "fullscreen";
|
|
184
|
+
}
|
|
185
|
+
}, {
|
|
186
|
+
key: "defaultConfig",
|
|
187
|
+
get: function get() {
|
|
188
|
+
return {
|
|
189
|
+
position: POSITIONS.CONTROLS_RIGHT,
|
|
190
|
+
index: 0,
|
|
191
|
+
useCssFullscreen: false,
|
|
192
|
+
rotateFullscreen: false,
|
|
193
|
+
switchCallback: null,
|
|
194
|
+
target: null,
|
|
195
|
+
disable: false,
|
|
196
|
+
needBackIcon: false
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}]);
|
|
200
|
+
return Fullscreen2;
|
|
201
|
+
}(Icon);
|
|
202
|
+
export { Fullscreen as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.xgplayer {
|
|
2
|
+
.xgplayer-fullscreen {
|
|
3
|
+
.xg-exit-fullscreen {
|
|
4
|
+
display: none;
|
|
5
|
+
}
|
|
6
|
+
.xg-get-fullscreen {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&[data-state=full] {
|
|
11
|
+
.xg-exit-fullscreen {
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
.xg-get-fullscreen {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.xg-top-bar {
|
|
20
|
+
.xgplayer-back {
|
|
21
|
+
position: relative;
|
|
22
|
+
left: 0;
|
|
23
|
+
top: 16px;
|
|
24
|
+
width: 34px;
|
|
25
|
+
height: 40px;
|
|
26
|
+
display: none;
|
|
27
|
+
// svg {
|
|
28
|
+
// display: block;
|
|
29
|
+
// }
|
|
30
|
+
&.show {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare class GapJump extends BasePlugin {
|
|
2
|
+
static get defaultConfig(): {
|
|
3
|
+
useGapJump: boolean;
|
|
4
|
+
smallGapLimit: number;
|
|
5
|
+
gapDetectionThreshold: number;
|
|
6
|
+
};
|
|
7
|
+
hasPlayed: boolean;
|
|
8
|
+
seekingEventReceived: boolean;
|
|
9
|
+
isSafari: boolean;
|
|
10
|
+
onGapJump: () => void;
|
|
11
|
+
_getIndex(buffered: any, time: any, threshold: any): number;
|
|
12
|
+
_getBuffered(b: any): {
|
|
13
|
+
start: any;
|
|
14
|
+
end: any;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
declare namespace GapJump {
|
|
18
|
+
const BROWSER_GAP_TOLERANCE: number;
|
|
19
|
+
}
|
|
20
|
+
export default GapJump;
|
|
21
|
+
import BasePlugin from "../../plugin";
|