@xiping/react-components 1.0.45 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/_commonjsHelpers.js +1 -0
- package/dist/cjs/_virtual/delegate.js +1 -0
- package/dist/cjs/_virtual/download.js +1 -0
- package/dist/cjs/_virtual/download2.js +1 -0
- package/dist/cjs/_virtual/index.js +1 -0
- package/dist/cjs/_virtual/index2.js +1 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.d.ts +21 -0
- package/dist/cjs/components/subtitle-player/SubtitlePlayer.js +3 -3
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.d.ts +23 -0
- package/dist/cjs/components/video-subtitle-player/VideoSubtitlePlayer.js +1 -0
- package/dist/cjs/components/video-subtitle-player/index.d.ts +3 -0
- package/dist/cjs/components/video-subtitle-player/useVideoSubtitleStore.d.ts +61 -0
- package/dist/cjs/components/video-subtitle-player/useVideoSubtitleStore.js +1 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/node_modules/.pnpm/delegate@3.2.0/node_modules/delegate/src/closest.js +1 -0
- package/dist/cjs/node_modules/.pnpm/delegate@3.2.0/node_modules/delegate/src/delegate.js +1 -0
- package/dist/cjs/node_modules/.pnpm/downloadjs@1.4.7/node_modules/downloadjs/download.js +3 -0
- package/dist/cjs/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +2 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/constant.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/defaultConfig.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/error.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/events.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/index.umd.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/instManager.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/en.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/i18n.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/zh-cn.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/mediaProxy.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/player.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/basePlugin.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/hooksDescriptor.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/plugin.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/pluginsManager.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/preset.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/resizeObserver.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/back.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/download.js +15 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/exitFull.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/loading.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pause.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pipIcon.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +8 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/play.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/playNext.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/replay.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/requestFull.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/rotate.js +12 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/seekicon.js +7 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/iconPlugin.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/iconTools.js +3 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/optionList.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/optionsIcon.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/thumbnail.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/controls/index.js +9 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/definition/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/download/index.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/dynamicBg/index.js +2 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/enter/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/error/index.js +6 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fpsDetect/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +2 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fullscreen/index.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/gapJump/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/keyboard/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/loading/index.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/logger/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/miniScreen/index.js +13 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/mobile/index.js +19 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/mobile/touch.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/pc/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/pip/index.js +8 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/play/index.js +5 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/playNext/index.js +7 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/playbackRate/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/poster/index.js +2 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/index.js +7 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/innerList.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/miniProgress.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progressPreview/index.js +11 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/prompt/index.js +3 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/replay/index.js +3 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/rotate/index.js +6 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/screenShot/index.js +6 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/start/index.js +4 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/stats/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/testspeed/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/time/index.js +6 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/time/timesegments.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/volume/index.js +11 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/presets/default.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/state.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/stateClassMap.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/database.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/debug.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/draggabilly.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/sniffer.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/util.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +1 -0
- package/dist/cjs/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/version.js +1 -0
- package/dist/cjs/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/react.js +1 -0
- package/dist/cjs/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js +1 -0
- package/dist/cjs/packages/subtitle/lib/src/json-converter.js +1 -0
- package/dist/cjs/react-components.css +1 -1
- package/dist/es/_virtual/_commonjsHelpers.js +6 -0
- package/dist/es/_virtual/delegate.js +7 -0
- package/dist/es/_virtual/download.js +7 -0
- package/dist/es/_virtual/download2.js +4 -0
- package/dist/es/_virtual/index.js +8 -0
- package/dist/es/_virtual/index2.js +4 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.d.ts +21 -0
- package/dist/es/components/subtitle-player/SubtitlePlayer.js +274 -76
- package/dist/es/components/txt-editor/TxtEditor.js +4 -1
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.d.ts +23 -0
- package/dist/es/components/video-subtitle-player/VideoSubtitlePlayer.js +125 -0
- package/dist/es/components/video-subtitle-player/index.d.ts +3 -0
- package/dist/es/components/video-subtitle-player/useVideoSubtitleStore.d.ts +61 -0
- package/dist/es/components/video-subtitle-player/useVideoSubtitleStore.js +57 -0
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +60 -58
- package/dist/es/node_modules/.pnpm/delegate@3.2.0/node_modules/delegate/src/closest.js +21 -0
- package/dist/es/node_modules/.pnpm/delegate@3.2.0/node_modules/delegate/src/delegate.js +29 -0
- package/dist/es/node_modules/.pnpm/downloadjs@1.4.7/node_modules/downloadjs/download.js +77 -0
- package/dist/es/node_modules/.pnpm/eventemitter3@4.0.7/node_modules/eventemitter3/index.js +111 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/_virtual/_rollupPluginBabelHelpers.js +197 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/constant.js +7 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/defaultConfig.js +87 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/error.js +64 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/events.js +67 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/index.umd.js +45 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/instManager.js +101 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/en.js +79 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/i18n.js +75 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/lang/zh-cn.js +79 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/mediaProxy.js +466 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/player.js +1240 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/basePlugin.js +207 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/hooksDescriptor.js +130 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/plugin.js +366 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/pluginsManager.js +204 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/preset.js +14 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugin/resizeObserver.js +81 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/back.js +10 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/download.js +20 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/exitCssFull.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/exitFull.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/loading.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pause.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pipIcon.js +10 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/pipIconExit.js +13 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/play.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/playNext.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/replay.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/requestCssFull.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/requestFull.js +9 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/rotate.js +17 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/seekicon.js +12 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeLarge.js +10 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeMuted.js +10 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/assets/volumeSmall.js +10 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/iconPlugin.js +35 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/iconTools.js +12 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/optionList.js +79 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/optionsIcon.js +193 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/common/thumbnail.js +141 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/controls/index.js +171 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/cssFullScreen/index.js +105 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/definition/index.js +110 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/download/index.js +83 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/dynamicBg/index.js +232 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/enter/index.js +42 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/error/index.js +68 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fpsDetect/index.js +116 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fullscreen/backicon.js +68 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/fullscreen/index.js +150 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/gapJump/index.js +96 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/keyboard/index.js +299 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/loading/index.js +46 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/logger/index.js +171 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/miniScreen/index.js +169 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/miniScreen/miniScreenIcon.js +55 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/mobile/index.js +448 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/mobile/touch.js +138 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/pc/index.js +122 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/pip/index.js +216 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/play/index.js +102 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/playNext/index.js +78 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/playbackRate/index.js +100 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/poster/index.js +119 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/index.js +431 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/innerList.js +215 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progress/miniProgress.js +93 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progressPreview/dotsApi.js +175 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/progressPreview/index.js +292 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/prompt/index.js +86 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/replay/index.js +92 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/rotate/index.js +106 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/screenShot/index.js +134 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/start/index.js +222 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/stats/index.js +152 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/testspeed/index.js +134 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/time/index.js +164 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/time/timesegments.js +146 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/volume/index.js +206 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/plugins/waitingTimeoutJump/index.js +53 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/presets/default.js +61 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/state.js +13 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/stateClassMap.js +34 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/database.js +83 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/debug.js +34 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/draggabilly.js +271 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/sniffer.js +111 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/util.js +517 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/utils/xgplayerTimeRange.js +25 -0
- package/dist/es/node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/version.js +4 -0
- package/dist/es/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/react.js +19 -0
- package/dist/es/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js +14 -0
- package/dist/es/packages/subtitle/lib/src/json-converter.js +27 -0
- package/dist/es/react-components.css +1 -1
- package/package.json +19 -21
- package/dist/cjs/components/qr-code/index.d.ts +0 -103
- package/dist/cjs/components/qr-code/index.js +0 -1
- package/dist/es/components/qr-code/index.d.ts +0 -103
- package/dist/es/components/qr-code/index.js +0 -49
- /package/dist/cjs/{subtitle → packages/subtitle}/lib/src/parser.js +0 -0
- /package/dist/es/{subtitle → packages/subtitle}/lib/src/parser.js +0 -0
|
@@ -1,103 +1,301 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { parseSRT as
|
|
1
|
+
import { jsx as p, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as x, useRef as D, useState as G, useEffect as O, useCallback as R } from "react";
|
|
3
|
+
import { parseSRT as I, parseVTT as A } from "../../packages/subtitle/lib/src/parser.js";
|
|
4
|
+
import { srtToJson as U, vttToJson as X } from "../../packages/subtitle/lib/src/json-converter.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
6
|
+
function E(l) {
|
|
7
|
+
const c = l.replace(",", ".").split(":");
|
|
8
|
+
if (c.length !== 3)
|
|
8
9
|
return 0;
|
|
9
|
-
const
|
|
10
|
-
return
|
|
10
|
+
const h = parseInt(c[0], 10) || 0, g = parseInt(c[1], 10) || 0, i = parseFloat(c[2]) || 0;
|
|
11
|
+
return h * 3600 + g * 60 + i;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
function Y(l) {
|
|
14
|
+
const a = Math.floor(l / 3600), c = Math.floor(l % 3600 / 60), h = Math.floor(l % 60);
|
|
15
|
+
return a > 0 ? `${a.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}` : `${c.toString().padStart(2, "0")}:${h.toString().padStart(2, "0")}`;
|
|
16
|
+
}
|
|
17
|
+
function Z(l, a) {
|
|
18
|
+
for (const c of l) {
|
|
19
|
+
const h = E(c.startTime), g = E(c.endTime);
|
|
20
|
+
if (a >= h && a <= g)
|
|
21
|
+
return c;
|
|
17
22
|
}
|
|
18
23
|
return null;
|
|
19
24
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
function q(l, a, c, h, g) {
|
|
26
|
+
if (!a || a.length === 0)
|
|
27
|
+
return { nodes: l, nextWordIndex: c };
|
|
28
|
+
const i = [];
|
|
29
|
+
let d = 0;
|
|
30
|
+
for (let u = c; u < a.length; u++) {
|
|
31
|
+
const m = a[u], f = l.substring(d).indexOf(m);
|
|
32
|
+
if (f === -1)
|
|
33
|
+
return {
|
|
34
|
+
nodes: i.length > 0 ? i : l,
|
|
35
|
+
nextWordIndex: u
|
|
36
|
+
};
|
|
37
|
+
const b = d + f;
|
|
38
|
+
if (b > d) {
|
|
39
|
+
const S = l.substring(d, b);
|
|
40
|
+
S && i.push(
|
|
41
|
+
/* @__PURE__ */ p("span", { className: "subtitle-word-before", children: S }, `before-${h}-${u}`)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const y = g?.(m, u, h);
|
|
45
|
+
if (i.push(
|
|
46
|
+
/* @__PURE__ */ p(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
className: "subtitle-word",
|
|
50
|
+
"data-word": m,
|
|
51
|
+
onMouseEnter: y?.onMouseEnter,
|
|
52
|
+
onMouseLeave: y?.onMouseLeave,
|
|
53
|
+
children: m
|
|
54
|
+
},
|
|
55
|
+
`word-${h}-${u}`
|
|
56
|
+
)
|
|
57
|
+
), d = b + m.length, d >= l.length)
|
|
58
|
+
return { nodes: i, nextWordIndex: u + 1 };
|
|
59
|
+
}
|
|
60
|
+
if (d < l.length) {
|
|
61
|
+
const u = l.substring(d);
|
|
62
|
+
u && i.push(
|
|
63
|
+
/* @__PURE__ */ p("span", { className: "subtitle-word-after", children: u }, `after-${h}`)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
nodes: i.length > 0 ? i : l,
|
|
68
|
+
nextWordIndex: a.length
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const st = ({
|
|
72
|
+
subtitles: l,
|
|
73
|
+
currentTime: a,
|
|
74
|
+
mode: c = "current",
|
|
75
|
+
className: h = "",
|
|
76
|
+
style: g,
|
|
77
|
+
onWordHoverChange: i,
|
|
78
|
+
renderWordOverlay: d
|
|
26
79
|
}) => {
|
|
27
|
-
const
|
|
80
|
+
const u = x(
|
|
81
|
+
() => Array.isArray(l) ? l : [l],
|
|
82
|
+
[l]
|
|
83
|
+
), m = D(null), N = D(null), [f, b] = G(null), [y, S] = G([]);
|
|
84
|
+
O(() => {
|
|
85
|
+
let n = !0;
|
|
86
|
+
async function s() {
|
|
87
|
+
try {
|
|
88
|
+
const e = await Promise.all(
|
|
89
|
+
u.map(async (t) => {
|
|
90
|
+
try {
|
|
91
|
+
const r = t.language || "zh", o = t.type === "srt" ? await U(t.content, r) : await X(t.content, r);
|
|
92
|
+
return {
|
|
93
|
+
entries: JSON.parse(o),
|
|
94
|
+
label: t.label
|
|
95
|
+
};
|
|
96
|
+
} catch (r) {
|
|
97
|
+
return console.error("字幕解析失败:", r), {
|
|
98
|
+
entries: t.type === "srt" ? I(t.content) : A(t.content),
|
|
99
|
+
label: t.label
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
n && S(e);
|
|
105
|
+
} catch (e) {
|
|
106
|
+
if (console.error("加载字幕失败:", e), n) {
|
|
107
|
+
const t = u.map((r) => {
|
|
108
|
+
try {
|
|
109
|
+
return {
|
|
110
|
+
entries: r.type === "srt" ? I(r.content) : A(r.content),
|
|
111
|
+
label: r.label
|
|
112
|
+
};
|
|
113
|
+
} catch (o) {
|
|
114
|
+
return console.error("字幕解析失败:", o), {
|
|
115
|
+
entries: [],
|
|
116
|
+
label: r.label
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
S(t);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return s(), () => {
|
|
125
|
+
n = !1;
|
|
126
|
+
};
|
|
127
|
+
}, [u]);
|
|
128
|
+
const w = x(() => y.length > 0 ? y : u.map((n) => {
|
|
28
129
|
try {
|
|
29
130
|
return {
|
|
30
|
-
entries:
|
|
31
|
-
label:
|
|
131
|
+
entries: n.type === "srt" ? I(n.content) : A(n.content),
|
|
132
|
+
label: n.label
|
|
32
133
|
};
|
|
33
|
-
} catch (
|
|
34
|
-
return console.error("字幕解析失败:",
|
|
134
|
+
} catch (s) {
|
|
135
|
+
return console.error("字幕解析失败:", s), {
|
|
35
136
|
entries: [],
|
|
36
|
-
label:
|
|
137
|
+
label: n.label
|
|
37
138
|
};
|
|
38
139
|
}
|
|
39
|
-
}), [
|
|
40
|
-
entry:
|
|
41
|
-
label:
|
|
42
|
-
entries:
|
|
140
|
+
}), [y, u]), L = x(() => w.map(({ entries: n, label: s }) => ({
|
|
141
|
+
entry: Z(n, a),
|
|
142
|
+
label: s,
|
|
143
|
+
entries: n
|
|
43
144
|
// 保留所有条目用于歌词模式
|
|
44
|
-
})), [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
145
|
+
})), [w, a]), H = x(() => {
|
|
146
|
+
const n = [];
|
|
147
|
+
w.forEach(({ entries: t, label: r }) => {
|
|
148
|
+
t.forEach((o) => {
|
|
149
|
+
n.push({
|
|
150
|
+
entry: o,
|
|
151
|
+
label: r,
|
|
152
|
+
startTime: E(o.startTime),
|
|
153
|
+
endTime: E(o.endTime)
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}), n.sort((t, r) => t.startTime - r.startTime);
|
|
157
|
+
const s = [];
|
|
158
|
+
let e = [];
|
|
159
|
+
for (const t of n)
|
|
160
|
+
if (e.length === 0)
|
|
161
|
+
e.push(t);
|
|
162
|
+
else {
|
|
163
|
+
const r = e[e.length - 1];
|
|
164
|
+
t.startTime <= r.endTime ? e.push(t) : (s.push(e), e = [t]);
|
|
165
|
+
}
|
|
166
|
+
return e.length > 0 && s.push(e), s;
|
|
167
|
+
}, [w]);
|
|
168
|
+
O(() => {
|
|
169
|
+
if (c === "lyrics" && N.current && m.current) {
|
|
170
|
+
const n = m.current, s = N.current, e = s.offsetTop, t = n.clientHeight, r = s.clientHeight, o = e - t / 2 + r / 2;
|
|
171
|
+
n.scrollTo({
|
|
172
|
+
top: o,
|
|
52
173
|
behavior: "smooth"
|
|
53
174
|
});
|
|
54
175
|
}
|
|
55
|
-
}, [
|
|
176
|
+
}, [c, a]);
|
|
177
|
+
const P = R(
|
|
178
|
+
(n, s) => {
|
|
179
|
+
const e = n.currentTarget.getBoundingClientRect(), t = m.current?.getBoundingClientRect(), r = t !== void 0 ? new DOMRect(
|
|
180
|
+
e.left - t.left,
|
|
181
|
+
e.top - t.top,
|
|
182
|
+
e.width,
|
|
183
|
+
e.height
|
|
184
|
+
) : e, o = {
|
|
185
|
+
...s,
|
|
186
|
+
rect: r
|
|
187
|
+
};
|
|
188
|
+
b(o), i?.(o);
|
|
189
|
+
},
|
|
190
|
+
[i]
|
|
191
|
+
), j = R(() => {
|
|
192
|
+
b(null), i?.(null);
|
|
193
|
+
}, [i]), z = R(
|
|
194
|
+
(n, s) => (e, t, r) => ({
|
|
195
|
+
onMouseEnter: (o) => P(o, {
|
|
196
|
+
word: e,
|
|
197
|
+
wordIndex: t,
|
|
198
|
+
lineIndex: r,
|
|
199
|
+
entry: n,
|
|
200
|
+
label: s
|
|
201
|
+
}),
|
|
202
|
+
onMouseLeave: j
|
|
203
|
+
}),
|
|
204
|
+
[P, j]
|
|
205
|
+
), B = d && f ? /* @__PURE__ */ p(
|
|
56
206
|
"div",
|
|
57
207
|
{
|
|
58
|
-
className:
|
|
59
|
-
style:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
208
|
+
className: "subtitle-player-hover-overlay",
|
|
209
|
+
style: {
|
|
210
|
+
left: f.rect.x + f.rect.width / 2,
|
|
211
|
+
top: f.rect.y + f.rect.height
|
|
212
|
+
},
|
|
213
|
+
children: d(f)
|
|
214
|
+
}
|
|
215
|
+
) : null;
|
|
216
|
+
return c === "current" ? L.some(({ entry: s }) => s !== null) ? /* @__PURE__ */ $(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
ref: m,
|
|
220
|
+
className: `subtitle-player subtitle-player--current ${h}`,
|
|
221
|
+
style: g,
|
|
222
|
+
children: [
|
|
223
|
+
L.map(({ entry: s, label: e }, t) => s ? /* @__PURE__ */ $(
|
|
224
|
+
"div",
|
|
225
|
+
{
|
|
226
|
+
className: "subtitle-player-item",
|
|
227
|
+
"data-label": e || void 0,
|
|
228
|
+
children: [
|
|
229
|
+
e && /* @__PURE__ */ p("span", { className: "subtitle-player-label", children: e }),
|
|
230
|
+
/* @__PURE__ */ p("div", { className: "subtitle-player-text", children: (() => {
|
|
231
|
+
let r = 0;
|
|
232
|
+
return s.text.split(`
|
|
233
|
+
`).map((o, T) => {
|
|
234
|
+
if (!s.words || s.words.length === 0)
|
|
235
|
+
return /* @__PURE__ */ p("div", { className: "subtitle-player-line", children: o }, T);
|
|
236
|
+
const v = q(
|
|
237
|
+
o,
|
|
238
|
+
s.words,
|
|
239
|
+
r,
|
|
240
|
+
T,
|
|
241
|
+
d || i ? z(s, e) : void 0
|
|
242
|
+
);
|
|
243
|
+
return r = v.nextWordIndex, /* @__PURE__ */ p("div", { className: "subtitle-player-line", children: v.nodes }, T);
|
|
244
|
+
});
|
|
245
|
+
})() })
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
t
|
|
249
|
+
) : null),
|
|
250
|
+
(d || i) && /* @__PURE__ */ p("div", { className: "subtitle-player-hover-layer", children: B })
|
|
251
|
+
]
|
|
73
252
|
}
|
|
74
|
-
) : null : /* @__PURE__ */
|
|
253
|
+
) : null : /* @__PURE__ */ $(
|
|
75
254
|
"div",
|
|
76
255
|
{
|
|
77
|
-
ref:
|
|
78
|
-
className: `subtitle-player subtitle-player--lyrics ${
|
|
79
|
-
style:
|
|
80
|
-
children:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
256
|
+
ref: m,
|
|
257
|
+
className: `subtitle-player subtitle-player--lyrics ${h}`,
|
|
258
|
+
style: g,
|
|
259
|
+
children: [
|
|
260
|
+
H.map((n, s) => {
|
|
261
|
+
const e = n[0]?.startTime ?? 0, t = Y(e);
|
|
262
|
+
return /* @__PURE__ */ p("div", { className: "subtitle-player-group", children: n.map(({ entry: r, label: o, startTime: T, endTime: v }, F) => {
|
|
263
|
+
const J = a >= T && a <= v, K = a > v, Q = F === 0;
|
|
264
|
+
let V = 0;
|
|
265
|
+
return /* @__PURE__ */ $(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
ref: J ? N : null,
|
|
269
|
+
className: `subtitle-player-item ${J ? "subtitle-player-item--active" : ""} ${K ? "subtitle-player-item--past" : ""}`,
|
|
270
|
+
"data-label": o || void 0,
|
|
271
|
+
children: [
|
|
272
|
+
Q && /* @__PURE__ */ p("span", { className: "subtitle-player-time", children: t }),
|
|
273
|
+
o && /* @__PURE__ */ p("span", { className: "subtitle-player-label", children: o }),
|
|
274
|
+
/* @__PURE__ */ p("div", { className: "subtitle-player-text", children: r.text.split(`
|
|
275
|
+
`).map((W, M) => {
|
|
276
|
+
if (!r.words || r.words.length === 0)
|
|
277
|
+
return /* @__PURE__ */ p("div", { className: "subtitle-player-line", children: W }, M);
|
|
278
|
+
const k = q(
|
|
279
|
+
W,
|
|
280
|
+
r.words,
|
|
281
|
+
V,
|
|
282
|
+
M,
|
|
283
|
+
d || i ? z(r, o) : void 0
|
|
284
|
+
);
|
|
285
|
+
return V = k.nextWordIndex, /* @__PURE__ */ p("div", { className: "subtitle-player-line", children: k.nodes }, M);
|
|
286
|
+
}) })
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
`${s}-${F}`
|
|
290
|
+
);
|
|
291
|
+
}) }, s);
|
|
292
|
+
}),
|
|
293
|
+
(d || i) && /* @__PURE__ */ p("div", { className: "subtitle-player-hover-layer", children: B })
|
|
294
|
+
]
|
|
97
295
|
}
|
|
98
296
|
);
|
|
99
297
|
};
|
|
100
298
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
299
|
+
st as SubtitlePlayer,
|
|
300
|
+
st as default
|
|
103
301
|
};
|
|
@@ -15,7 +15,10 @@ const U = ({
|
|
|
15
15
|
onMount: s,
|
|
16
16
|
className: u
|
|
17
17
|
}) => {
|
|
18
|
-
const l = o !== void 0, g = P(
|
|
18
|
+
const l = o !== void 0, g = P(
|
|
19
|
+
() => d || o || "",
|
|
20
|
+
[d, o]
|
|
21
|
+
), e = M({
|
|
19
22
|
extensions: [
|
|
20
23
|
C.configure({
|
|
21
24
|
// 禁用大部分格式化功能,保持纯文本编辑体验
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SubtitleData, HoverTarget } from '../subtitle-player/SubtitlePlayer';
|
|
3
|
+
export interface VideoSubtitlePlayerProps {
|
|
4
|
+
/** 视频URL */
|
|
5
|
+
videoUrl: string;
|
|
6
|
+
/** 字幕数据 */
|
|
7
|
+
subtitles: SubtitleData[];
|
|
8
|
+
/** 视频封面图 */
|
|
9
|
+
poster?: string;
|
|
10
|
+
/** 自定义类名 */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** 自定义样式 */
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
/** 自定义详情获取函数,用于调用大模型API */
|
|
15
|
+
onFetchDetail?: (target: HoverTarget | null) => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 视频字幕播放器组件
|
|
19
|
+
* 左侧:上部分16:9视频播放器,下部分字幕显示
|
|
20
|
+
* 右侧:字幕详情(单词/短语的发音、解释等)
|
|
21
|
+
*/
|
|
22
|
+
export declare const VideoSubtitlePlayer: React.FC<VideoSubtitlePlayerProps>;
|
|
23
|
+
export default VideoSubtitlePlayer;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as x, useEffect as u, useCallback as C } from "react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { SubtitlePlayer as I } from "../subtitle-player/SubtitlePlayer.js";
|
|
5
|
+
import { useVideoSubtitleStore as R } from "./useVideoSubtitleStore.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import j from "../../node_modules/.pnpm/xgplayer@3.0.23_core-js@3.47.0/node_modules/xgplayer/es/index.umd.js";
|
|
8
|
+
const z = ({
|
|
9
|
+
videoUrl: p,
|
|
10
|
+
subtitles: o,
|
|
11
|
+
poster: m,
|
|
12
|
+
className: g = "",
|
|
13
|
+
style: P,
|
|
14
|
+
onFetchDetail: c
|
|
15
|
+
}) => {
|
|
16
|
+
const d = x(null), r = x(null), {
|
|
17
|
+
currentTime: s,
|
|
18
|
+
isPlaying: D,
|
|
19
|
+
setCurrentTime: v,
|
|
20
|
+
setIsPlaying: n,
|
|
21
|
+
setSubtitles: _,
|
|
22
|
+
currentDetail: l,
|
|
23
|
+
isLoadingDetail: w,
|
|
24
|
+
fetchDetail: y
|
|
25
|
+
} = R();
|
|
26
|
+
u(() => {
|
|
27
|
+
_(o);
|
|
28
|
+
}, [o, _]), u(() => {
|
|
29
|
+
if (!d.current) return;
|
|
30
|
+
const t = `video-subtitle-player-${Date.now()}`;
|
|
31
|
+
d.current && (d.current.id = t);
|
|
32
|
+
const i = new j({
|
|
33
|
+
id: t,
|
|
34
|
+
url: p,
|
|
35
|
+
poster: m,
|
|
36
|
+
autoplay: !1,
|
|
37
|
+
fluid: !0,
|
|
38
|
+
width: "100%",
|
|
39
|
+
height: "100%",
|
|
40
|
+
controls: !0
|
|
41
|
+
});
|
|
42
|
+
r.current = i;
|
|
43
|
+
const h = () => {
|
|
44
|
+
const T = i.currentTime || 0;
|
|
45
|
+
v(T);
|
|
46
|
+
}, f = () => {
|
|
47
|
+
n(!0);
|
|
48
|
+
}, b = () => {
|
|
49
|
+
n(!1);
|
|
50
|
+
}, N = () => {
|
|
51
|
+
n(!1);
|
|
52
|
+
};
|
|
53
|
+
return i.on("timeupdate", h), i.on("play", f), i.on("pause", b), i.on("ended", N), () => {
|
|
54
|
+
i.off("timeupdate", h), i.off("play", f), i.off("pause", b), i.off("ended", N), i.destroy(), r.current = null;
|
|
55
|
+
};
|
|
56
|
+
}, [p, m, v, n]), u(() => {
|
|
57
|
+
if (r.current) {
|
|
58
|
+
const t = r.current;
|
|
59
|
+
Math.abs(t.currentTime - s) > 0.5 && (t.currentTime = s);
|
|
60
|
+
}
|
|
61
|
+
}, [s]);
|
|
62
|
+
const S = C(
|
|
63
|
+
async (t) => {
|
|
64
|
+
c ? await c(t) : await y(t);
|
|
65
|
+
},
|
|
66
|
+
[c, y]
|
|
67
|
+
);
|
|
68
|
+
return /* @__PURE__ */ a(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: `video-subtitle-player ${g}`,
|
|
72
|
+
style: P,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ a("div", { className: "video-subtitle-player__left", children: [
|
|
75
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__video-container", children: /* @__PURE__ */ e(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref: d,
|
|
79
|
+
className: "video-subtitle-player__video"
|
|
80
|
+
}
|
|
81
|
+
) }),
|
|
82
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__subtitle-container", children: /* @__PURE__ */ e(
|
|
83
|
+
I,
|
|
84
|
+
{
|
|
85
|
+
subtitles: o,
|
|
86
|
+
currentTime: s,
|
|
87
|
+
mode: "current",
|
|
88
|
+
onWordHoverChange: S
|
|
89
|
+
}
|
|
90
|
+
) })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__right", children: /* @__PURE__ */ e("div", { className: "video-subtitle-player__detail", children: w ? /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-loading", children: [
|
|
93
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-loading-spinner" }),
|
|
94
|
+
/* @__PURE__ */ e("span", { children: "加载中..." })
|
|
95
|
+
] }) : l ? /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-content", children: [
|
|
96
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-word", children: l.word }),
|
|
97
|
+
l.pronunciation && /* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-pronunciation", children: l.pronunciation }),
|
|
98
|
+
l.partOfSpeech && /* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-pos", children: l.partOfSpeech }),
|
|
99
|
+
l.translation && /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-translation", children: [
|
|
100
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-label", children: "中文翻译" }),
|
|
101
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-text", children: l.translation })
|
|
102
|
+
] }),
|
|
103
|
+
l.definition && /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-definition", children: [
|
|
104
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-label", children: "英文解释" }),
|
|
105
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-text", children: l.definition })
|
|
106
|
+
] }),
|
|
107
|
+
l.examples && l.examples.length > 0 && /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-examples", children: [
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-label", children: "例句" }),
|
|
109
|
+
l.examples.map((t, i) => /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-example", children: [
|
|
110
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-example-en", children: t.sentence }),
|
|
111
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-example-zh", children: t.translation })
|
|
112
|
+
] }, i))
|
|
113
|
+
] })
|
|
114
|
+
] }) : /* @__PURE__ */ a("div", { className: "video-subtitle-player__detail-empty", children: [
|
|
115
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-empty-icon", children: "📖" }),
|
|
116
|
+
/* @__PURE__ */ e("div", { className: "video-subtitle-player__detail-empty-text", children: "将鼠标悬停在字幕单词上查看详情" })
|
|
117
|
+
] }) }) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
export {
|
|
123
|
+
z as VideoSubtitlePlayer,
|
|
124
|
+
z as default
|
|
125
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SubtitleData, HoverTarget } from '../subtitle-player/SubtitlePlayer';
|
|
2
|
+
/**
|
|
3
|
+
* 字幕详情信息
|
|
4
|
+
*/
|
|
5
|
+
export interface SubtitleDetail {
|
|
6
|
+
/** 单词或短语 */
|
|
7
|
+
word: string;
|
|
8
|
+
/** 发音(音标) */
|
|
9
|
+
pronunciation?: string;
|
|
10
|
+
/** 中文解释 */
|
|
11
|
+
translation?: string;
|
|
12
|
+
/** 英文解释 */
|
|
13
|
+
definition?: string;
|
|
14
|
+
/** 例句 */
|
|
15
|
+
examples?: Array<{
|
|
16
|
+
sentence: string;
|
|
17
|
+
translation: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** 词性 */
|
|
20
|
+
partOfSpeech?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 视频字幕播放器状态
|
|
24
|
+
*/
|
|
25
|
+
export interface VideoSubtitleState {
|
|
26
|
+
/** 播放进度(秒数) */
|
|
27
|
+
currentTime: number;
|
|
28
|
+
/** 是否正在播放 */
|
|
29
|
+
isPlaying: boolean;
|
|
30
|
+
/** 字幕数据 */
|
|
31
|
+
subtitles: SubtitleData[];
|
|
32
|
+
/** 当前hover的单词详情 */
|
|
33
|
+
currentDetail: SubtitleDetail | null;
|
|
34
|
+
/** 是否正在加载详情 */
|
|
35
|
+
isLoadingDetail: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 视频字幕播放器操作
|
|
39
|
+
*/
|
|
40
|
+
export interface VideoSubtitleActions {
|
|
41
|
+
/** 设置播放进度 */
|
|
42
|
+
setCurrentTime: (time: number) => void;
|
|
43
|
+
/** 设置播放状态 */
|
|
44
|
+
setIsPlaying: (playing: boolean) => void;
|
|
45
|
+
/** 设置字幕数据 */
|
|
46
|
+
setSubtitles: (subtitles: SubtitleData[]) => void;
|
|
47
|
+
/** 设置当前详情 */
|
|
48
|
+
setCurrentDetail: (detail: SubtitleDetail | null) => void;
|
|
49
|
+
/** 设置加载状态 */
|
|
50
|
+
setIsLoadingDetail: (loading: boolean) => void;
|
|
51
|
+
/** 根据hover目标获取详情(可以在这里调用大模型API) */
|
|
52
|
+
fetchDetail: (target: HoverTarget | null) => Promise<void>;
|
|
53
|
+
/** 重置状态 */
|
|
54
|
+
reset: () => void;
|
|
55
|
+
}
|
|
56
|
+
export type VideoSubtitleStore = VideoSubtitleState & VideoSubtitleActions;
|
|
57
|
+
/**
|
|
58
|
+
* 创建视频字幕播放器store
|
|
59
|
+
* @param fetchDetailFn 可选的详情获取函数,如果不提供则使用默认实现
|
|
60
|
+
*/
|
|
61
|
+
export declare const useVideoSubtitleStore: import('zustand').UseBoundStore<import('zustand').StoreApi<VideoSubtitleStore>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { create as r } from "../../node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/react.js";
|
|
2
|
+
const t = {
|
|
3
|
+
currentTime: 0,
|
|
4
|
+
isPlaying: !1,
|
|
5
|
+
subtitles: [],
|
|
6
|
+
currentDetail: null,
|
|
7
|
+
isLoadingDetail: !1
|
|
8
|
+
}, s = r((i, o) => ({
|
|
9
|
+
...t,
|
|
10
|
+
setCurrentTime: (e) => {
|
|
11
|
+
i({ currentTime: e });
|
|
12
|
+
},
|
|
13
|
+
setIsPlaying: (e) => {
|
|
14
|
+
i({ isPlaying: e });
|
|
15
|
+
},
|
|
16
|
+
setSubtitles: (e) => {
|
|
17
|
+
i({ subtitles: e });
|
|
18
|
+
},
|
|
19
|
+
setCurrentDetail: (e) => {
|
|
20
|
+
i({ currentDetail: e });
|
|
21
|
+
},
|
|
22
|
+
setIsLoadingDetail: (e) => {
|
|
23
|
+
i({ isLoadingDetail: e });
|
|
24
|
+
},
|
|
25
|
+
fetchDetail: async (e) => {
|
|
26
|
+
if (!e) {
|
|
27
|
+
i({ currentDetail: null, isLoadingDetail: !1 });
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
i({ isLoadingDetail: !0 });
|
|
31
|
+
try {
|
|
32
|
+
await new Promise((a) => setTimeout(a, 300));
|
|
33
|
+
const n = {
|
|
34
|
+
word: e.word,
|
|
35
|
+
pronunciation: `/${e.word.toLowerCase()}/`,
|
|
36
|
+
translation: `${e.word}的中文翻译`,
|
|
37
|
+
definition: `Definition of ${e.word}`,
|
|
38
|
+
examples: [
|
|
39
|
+
{
|
|
40
|
+
sentence: `This is an example sentence with ${e.word}.`,
|
|
41
|
+
translation: `这是一个包含${e.word}的例句。`
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
partOfSpeech: "noun"
|
|
45
|
+
};
|
|
46
|
+
i({ currentDetail: n, isLoadingDetail: !1 });
|
|
47
|
+
} catch (n) {
|
|
48
|
+
console.error("获取详情失败:", n), i({ currentDetail: null, isLoadingDetail: !1 });
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
reset: () => {
|
|
52
|
+
i(t);
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
export {
|
|
56
|
+
s as useVideoSubtitleStore
|
|
57
|
+
};
|