mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
Refactor utility functions for improved readability and consistency - Updated compatibility.js to use consistent line endings and formatting. - Refactored component.js for better readability and structure, including consistent use of arrow functions and binding. - Simplified dom.js functions with consistent formatting and improved readability. - Enhanced emitter.js with consistent formatting and arrow function usage. - Streamlined error.js for improved readability and consistency. - Refactored file.js to use consistent formatting and improved readability. - Improved format.js functions for better readability and consistency. - Updated index.js to maintain consistent export formatting. - Refactored property.js for improved readability and consistency. - Enhanced subtitle.js with consistent formatting and improved readability. - Refactored time.js for better readability and consistent formatting. fix: update lint script to target only source files for consistency Revert "fix: restore export statements for various plugins and update type definitions for better clarity" This reverts commit b5e969d81ec765cd8a34b06e6ef4f232ef25087f. fix: restore export statements for various plugins and update type definitions for better clarity Refactor type definitions to use interfaces instead of type aliases for better extensibility and clarity across i18n, icons, option, player, quality, setting, subtitle, template, and utils modules.
53 lines
834 B
TypeScript
53 lines
834 B
TypeScript
import type Artplayer from 'artplayer'
|
|
|
|
export = artplayerPluginAds
|
|
export as namespace artplayerPluginAds;
|
|
|
|
interface Option {
|
|
/**
|
|
* 广告源文本,支持视频链接、图片链接、HTML文本
|
|
*/
|
|
source: string
|
|
|
|
/**
|
|
* 知名广告的类型:'video' | 'image' | 'html'
|
|
*/
|
|
type: 'video' | 'image' | 'html'
|
|
|
|
/**
|
|
* 广告必看的时长,单位为秒
|
|
*/
|
|
playDuration?: number
|
|
|
|
/**
|
|
* 广告总的时长,单位为秒
|
|
*/
|
|
totalDuration?: number
|
|
|
|
/**
|
|
* 视频广告是否默认静音
|
|
*/
|
|
muted?: boolean
|
|
}
|
|
|
|
interface Ads {
|
|
name: 'artplayerPluginAds'
|
|
|
|
/**
|
|
* 跳过广告
|
|
*/
|
|
skip: () => void
|
|
|
|
/**
|
|
* 暂停广告
|
|
*/
|
|
pause: () => void
|
|
|
|
/**
|
|
* 播放广告
|
|
*/
|
|
play: () => void
|
|
}
|
|
|
|
declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads
|