Commit Graph
37 Commits
Author SHA1 Message Date
Harvey Zhao 4681a8bc7a feat: enhance Artplayer type definitions and improve component interfaces
- Updated Artplayer class to specify environment as 'development' | 'production'.
- Refined template query method to return specific element types.
- Improved event proxy method to handle multiple event names.
- Enhanced storage get method to support both key retrieval and full record retrieval.
- Modified i18n interface to include language initialization and partial language records.
- Adjusted notice interface to provide a getter for show state and a setter for messages.
- Updated layers, controls, and contextmenu to allow undefined elements.
- Enhanced subtitle interface with initialization method.
- Refined hotkey methods to use KeyboardEvent instead of Event.
- Updated setting methods to return updated settings instead of arrays.
- Improved plugin method to return a promise.
- Added new events for video handling and refined existing event parameters.
- Enhanced option interface for proxy and plugins to support promises.
- Updated player interface to include reset method.
- Refined setting props to allow optional values.
- Enhanced template interface with additional control elements.
- Improved utils methods for querying and manipulating DOM elements.

fix: update type definitions for notice and subtitle properties, and refine event types

fix: remove unnecessary console warnings in event listener error handling

fix: refactor event listener management to use Set for better performance and error handling
2025-11-29 21:41:52 +08:00
Harvey Zack 8041de8411 fix: move hotkey initialization inside option check for better control 2025-09-13 17:48:56 +08:00
Harvey Zack 8af6f7c322 feat: Refactor global event handling in ArtPlayer
- Introduced a new globalInit function to manage document and window events.
- Replaced direct event proxies with a unified bindGlobalEvents method.
- Updated event handling in various modules to utilize the new global event system.
- Removed the deprecated documentInit module.
- Bumped version to 5.2.6 in package.json.
2025-08-16 20:45:19 +08:00
Harvey Zack 35ad9883af build all
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.
2025-08-03 13:17:33 +08:00
Harvey Zack b6df6a6148 Refactor Artplayer class to add keydown event listener 2024-10-20 16:21:34 +08:00
Harvey Zack 699135afcf Danmuku (#759)
* chore: Bump artplayer-plugin-danmuku version to 5.1.0

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Refactor getDanmuTop function to handle additional cases

* chore: Refactor getDanmuTop function to handle additional cases

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Refactor danmuku plugin to always create a new Setting instance

* Refactor danmuku plugin to always create a new Setting instance

* Refactor danmuku plugin to always create a new Setting instance

* Update danmuku.js

* Update danmuku.js

* Refactor danmuku plugin to include a new Setting instance

* Refactor danmuku plugin to include a new Setting instance

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* chore: Update package.json files

* Refactor danmuku plugin to remove unnecessary whitespace in the setting template

* chore: Remove ESLint configuration files and update npm dependencies

* chore: Update ESLint configuration to disable console warnings and fix unused variable warnings

* chore: Update ESLint configuration to fix quotes rule

* Update package.json

* Update package.json

* Update setting.js

* chore: Compress CSS code in build script

* chore: Update build script to compress JavaScript code

* chore: Update build script to compress JavaScript code

* chore: Refactor setting.js to improve code organization and remove unused variables

* chore: Add isHover flag to Control component for better control hiding behavior

* chore: Update Control component to use $bottom instead of $controls for better control hiding behavior

* Update package.json

* Update package.json

* Update package.json

* chore: Update lerna.json to use independent versioning and yarn as npm client

* refactor: Update Danmuku class to support configurable modes and visibility

* refactor: Update Danmuku styles for better visibility and configurability

* feat: Update font weight in Danmuku styles for better readability

* refactor: Update Danmuku class to support configurable modes and visibility

* refactor: Add opacity, area, font, and speed sliders to Danmuku settings

* refactor: Initialize sliders for opacity, area, font, and speed in Danmuku settings

* feat: Add slider UI for opacity, area, and speed in Danmuku settings

* feat: Update slider styles in Danmuku settings for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* refactor: Update slider styles in Danmuku settings for better visibility and configurability

* refactor: Update margin slider initialization in Danmuku settings

* refactor: Update slider styles and initialization in Danmuku settings

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* add lock

* refactor: Add lock and unlock methods to Danmuku settings

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* Update artplayer-plugin-danmuku.d.ts

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings event listeners

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability
2024-05-26 14:57:22 +08:00
WeidiDeng 773618a177 not trigger shortcuts when ctrl or command key is pressed (#668)
* not trigger shortcuts when ctrl or command key is pressed

* exclude alt and shift keys from event trigger
2023-11-27 09:31:45 +08:00
Harvey 92ad45b976 add Artplayer.SEEK_STEP 2022-09-20 14:43:18 +08:00
Harvey f160d8eb61 remove art.once('video:loadedmetadata') 2022-05-18 11:29:05 +08:00
zhw2590582 c0321f660c 4.3.2 2022-03-16 22:49:04 +08:00
Harvey c9a9e8e6e7 remove mobile hotkey 2022-01-10 09:49:40 +08:00
zhw2590582 455e2189a7 forEach => for 2022-01-07 22:11:48 +08:00
zhw2590582 b70a804591 4.2.0 2022-01-07 20:13:44 +08:00
zhw2590582 938e8718bc add attrMix.js 2022-01-07 18:35:05 +08:00
zhw2590582 1438ce5e82 add themeMix 2022-01-07 18:05:28 +08:00
zhw2590582 59400eb3bf remove player object 2022-01-07 17:38:10 +08:00
Harvey d919471838 Add more valid 2021-12-10 11:05:44 +08:00
Harvey 9ed840b194 add event to hotkey callback 2021-12-03 09:17:24 +08:00
Harvey 69563e818b update ts 2021-12-01 14:16:43 +08:00
Harvey c5c4cf73eb 规范化play方法 2021-11-24 12:24:01 +08:00
Harvey 956c77c376 Update hotkey.js 2020-09-21 09:35:52 +08:00
Harvey 4cbefa172d 优化ready事件 2020-05-15 12:01:43 +08:00
Harvey 7b3913e318 优化移动端UI 2020-05-15 11:39:10 +08:00
Harvey 48b81536a8 Update hotkey.js 2019-11-22 17:48:13 +08:00
Harvey ee90291897 压缩字符 2019-11-22 17:32:09 +08:00
Harvey a6816d68fa 添加ready事件 2019-10-10 11:33:24 +08:00
Harvey 6c98b91aa5 修正热键的值 2019-09-19 15:36:56 +08:00
Harvey Zack cadfa4efe5 build all packages 2019-06-12 15:24:34 +08:00
Harvey Zack 52b6693da2 简化player接口 2019-06-06 10:37:57 +08:00
zhw2590582 89fecf5488 build all packages 2019-05-13 06:07:33 +08:00
Harvey Zack fa585e536a 调整整体样式 2019-04-30 15:10:30 +08:00
Harvey Zack 487e865017 优化整体结构 2019-04-30 13:06:24 +08:00
Harvey Zack 203ad0d3a0 格式化 2018-11-21 19:45:44 +08:00
Harvey Zack 16586d8d7e 变更事件名称 2018-11-21 14:13:37 +08:00
Harvey Zack 5c037ad08f 优化svg 2018-11-21 11:19:46 +08:00
Harvey Zack 157a0e7048 bugfix 2018-11-15 14:44:55 +08:00
Harvey Zack 0aa018db6d 修改包管理 2018-11-07 17:12:42 +08:00