mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 18:41:20 -08:00
refactor(vtt-thumbnail): [PKG-VTT-THUMB-04] preserve legacy types and expose async runtime entry
This commit is contained in:
1 parent
7f2906ae52
commit
db358a3ae4
33 files changed
+3864
-98
No files matched your search
@@ -1,11 +1,12 @@
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { RuntimeFactory } from '../types/artplayer-plugin-vtt-thumbnail'
|
||||
import type { Option, Result } from './types'
|
||||
import createLifetime from './lifetime'
|
||||
import parseVtt from './parseVtt'
|
||||
import createPreview from './preview'
|
||||
import requestVtt from './request'
|
||||
|
||||
export default function artplayerPluginVttThumbnail(option: Option) {
|
||||
function artplayerPluginVttThumbnail(option: Option) {
|
||||
return async (art: Artplayer): Promise<Result> => {
|
||||
const { setStyle, isMobile, addClass } = (art.constructor as typeof Artplayer).utils
|
||||
const { $progress } = art.template
|
||||
@@ -47,3 +48,6 @@ export default function artplayerPluginVttThumbnail(option: Option) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Object.assign adds the alias to the same callable referenced by that alias.
|
||||
export default Object.assign(artplayerPluginVttThumbnail, { default: artplayerPluginVttThumbnail }) as RuntimeFactory
|
||||
@@ -1,14 +1,7 @@
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { Events, Utils } from 'artplayer'
|
||||
|
||||
export interface Option {
|
||||
vtt?: string
|
||||
style?: Partial<CSSStyleDeclaration>
|
||||
}
|
||||
|
||||
export interface Result {
|
||||
name: 'artplayerPluginVttThumbnail'
|
||||
}
|
||||
export type { Option, Result } from '../types/artplayer-plugin-vtt-thumbnail'
|
||||
|
||||
export interface Rectangle {
|
||||
x: string
|
||||
|
||||
Reference in new issue
Block a user