Commit Graph
100 Commits
Author SHA1 Message Date
Harvey Zack 52b38a48b2 Implement code changes to enhance functionality and improve performance 2025-08-16 21:28:49 +08:00
Harvey Zack 34fe45fa2d feat: update build:all script to include documentation build 2025-08-16 21:18:52 +08:00
Harvey Zack fa0961a9f9 refactor: update event handling in plugins and core
- Changed event handling from `art.proxy` to `art.on` for visibility change and pointer events in the ads and danmuku plugins to improve consistency and maintainability.
- Bumped version of the danmuku plugin from 5.1.8 to 5.1.9.
- Added pointer events to the global event initialization in the core to ensure proper event handling across the application.
2025-08-16 21:17:29 +08:00
Harvey Zack e834246641 feat: enforce browser environment for Artplayer initialization
- Added a check in the Artplayer constructor to throw an error if instantiated outside a browser environment.
- Updated the isBrowser utility to ensure both window and document are defined.
- Removed unused user agent checks for WeChat, IE, and Android from compatibility utilities.
- Updated TypeScript definitions to reflect the removal of unused properties.
- Added a basic test case for Artplayer initialization in SSR context.
2025-08-16 21:11:30 +08:00
Harvey Zack 3a2dcdb226 feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive language settings documentation, including default languages, importing languages, adding new languages, and modifying existing languages.
- Updated the structure of the i18n documentation to improve clarity and usability.
2025-08-16 20:51:26 +08:00
Harvey Zack 3cfc1c031c Remove outdated language files for Czech, Spanish, Persian, French, Indonesian, Polish, Russian, Turkish, Vietnamese, and Traditional Chinese from the Artplayer i18n package. 2025-08-16 20:48:55 +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 abd64e11f2 refactor: update references from $container to $player in Document Picture-in-Picture plugin 2025-08-16 18:05:32 +08:00
Harvey Zack 84c118855d fix: 更新 Document Picture-in-Picture 占位符样式类名以提高可读性 2025-08-16 17:56:50 +08:00
Harvey Zack 1f142ced9f feat: 添加 Document Picture-in-Picture 插件样式支持 2025-08-16 17:52:48 +08:00
Harvey Zack 596269bf3f Replace pip.svg icon with a new design featuring a more modern look and updated dimensions 2025-08-16 17:38:36 +08:00
Harvey Zack 657dd7e77c refactor: improve document Picture-in-Picture support checks and update type definitions
- Renamed variable `dpipOK` to `isSupported` for clarity in checking Document Picture-in-Picture support.
- Updated the `open` function to use the new `isSupported` variable.
- Removed redundant checks in the `close` function related to Document Picture-in-Picture support.
- Added `isSupported` and `isActive` properties to the plugin's result interface in TypeScript definitions.
- Cleaned up the code for better readability and maintainability.
2025-08-16 17:00:01 +08:00
Harvey Zack a7d77f4f70 chore: remove Document Picture-in-Picture plugin files from the repository 2025-08-16 16:45:09 +08:00
Harvey Zack 571a4c8e1d fix: update description in README and package.json for clarity 2025-08-16 16:43:05 +08:00
Harvey Zack 7d4175efbc feat: add Document Picture-in-Picture plugin for ArtPlayer
- Implemented the core functionality of the Document Picture-in-Picture plugin.
- Created main plugin file `artplayer-plugin-document-pip.js` with support for opening and closing the PIP window.
- Added legacy support in `artplayer-plugin-document-pip.legacy.js`.
- Defined plugin options in `package.json` and included necessary metadata.
- Developed the main logic in `src/index.js`, including style copying and event handling.
- Created TypeScript definitions in `types/artplayer-plugin-document-pip.d.ts` for better type safety.
2025-08-16 16:39:58 +08:00
Harvey Zack c23520a4a6 feat: add Picture-in-Picture plugin for ArtPlayer
- Introduced `artplayer-plugin-pip` to enable Picture-in-Picture functionality.
- Updated `artplayer.d.ts` to export new types related to the plugin.
- Added example usage of the plugin in `pip.js`.
- Created TypeScript definitions for the plugin in `artplayer-plugin-pip.d.ts`.
- Implemented the plugin logic in `index.js` with necessary styles and event handling.
- Updated documentation to include the new plugin and its usage.
- Added README and package.json for the new plugin.
2025-08-16 15:55:21 +08:00
Harvey Zack bd071b2d63 feat: enhance autoOrientation plugin for better fullscreen handling
- Refactored rotation logic for web fullscreen to use a dedicated function.
- Added checks to prevent race conditions when applying rotation.
- Improved handling of native fullscreen orientation locking.
- Simplified class management for orientation states.
- Updated state retrieval to use constants for class names.
2025-08-11 23:31:54 +08:00
Harvey Zack f1fcbd75fe chore: Update change log, add removal of svg default fill color value and direct import optimization of Option 2025-08-03 19:48:34 +08:00
Harvey Zack 4fa1730242 Refactor SVG icons to remove fill attributes
- Updated arrow-left.svg, arrow-right.svg, check.svg, and loading.svg to remove fill attributes from path elements for better flexibility in styling.
- Modified aspect-ratio.svg and config.svg to maintain consistency in SVG structure by removing unnecessary fill attributes.
- Ensured playback-rate.svg retains its structure while removing fill attributes for improved styling options.
2025-08-03 19:43:28 +08:00
Harvey Zack d9c84d2dbc refactor: update type exports and improve type usage in tests 2025-08-03 18:57:40 +08:00
Harvey Zack 8a87de6df3 refactor: update export syntax to default for ASR and VAST plugins 2025-08-03 18:49:06 +08:00
Harvey Zack 6f3363014f refactor: update export syntax to default for ASR and VAST plugins 2025-08-03 18:47:09 +08:00
Harvey Zack fa755b5f61 refactor: update import statements to use node built-in modules
chore: update lerna configuration formatting

chore: bump version in package.json to 6.0.0

fix: modify build scripts for improved readability and consistency

feat: enhance translation scripts with better error handling and progress tracking

chore: improve plugin creation script for better user experience

style: format svgo configuration for consistency
2025-08-03 18:34:30 +08:00
Harvey Zack 3540cd0cce style:统一代码风格,移除多余分号 2025-08-03 18:23:42 +08:00
Harvey Zack e947be8a8e feat: add danmuku plugin documentation and i18n setup instructions
- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive language settings documentation, including default languages, importing languages, adding new languages, and modifying existing languages.
- Updated the i18n setup examples to reflect the latest changes in language handling.
2025-08-03 18:21:59 +08:00
Harvey Zack 9d966bf696 refactor: update export syntax to default for multiple plugins and adjust package.json formatting 2025-08-03 17:19:12 +08:00
Harvey Zack f3c0a9a77d feat(danmuku): add unique identifier for danmuku items
- Introduced a new dataset attribute `data-id` to DOM elements for unique identification of danmuku items.
- Updated validation to include an optional `id` field for danmuku objects.
- Changed the property `$id` to `$index` for better clarity on its purpose as an index rather than a unique identifier.
- Ensured the `data-id` attribute is set for visibility control during hover interactions.
2025-08-03 14:32:26 +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 532dd67cfd Merge branch 'master' of https://github.com/zhw2590582/ArtPlayer 2025-08-03 12:06:26 +08:00
Harvey Zack 46ad399b2f fix: add missing newline at end of multiple package.json files and README.md 2025-08-03 11:54:36 +08:00
Harvey Zack 05ce97c6fd Refactor event path handling to use getComposedPath utility
- Replaced direct usage of event.composedPath() with a new utility function getComposedPath in Control component.
- Updated includeFromEvent function to utilize getComposedPath for better compatibility.
- Implemented getComposedPath function to ensure consistent event path retrieval across different browsers.
2025-08-03 11:43:01 +08:00
Harvey Zhao 603151af84 Update README.md 2025-08-02 17:21:18 +08:00
Harvey Zack 412b8e7fa7 Update CHANGELOG_CN.md 2025-08-01 15:37:24 +08:00
Harvey Zack 8d912c6c99 chore: bump version to 5.2.5 and remove unused exports from package.json 2025-08-01 15:32:32 +08:00
Harvey Zack ea392e0d60 feat: update version to 5.1.7 and add custom userAgent documentation 2025-08-01 09:57:50 +08:00
Harvey Zack 5337f9b075 feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin, detailing its usage and providing code examples.
- Added a comprehensive guide for language settings (i18n), including instructions for importing languages, setting default languages, and modifying language options.
- Included code snippets for initializing the Artplayer with different languages and examples for adding new languages.
2025-08-01 09:34:07 +08:00
Harvey Zack c1fe0e2b03 Delete sitemap.xml 2025-07-06 15:02:25 +08:00
Harvey Zack 11b59da2cf Create sitemap.xml 2025-07-06 14:57:56 +08:00
Harvey Zack 9932551352 Create googlebcdef0d1e9238554.html 2025-07-06 14:45:47 +08:00
Harvey Zack 84bc5a85bc Refactor code structure for improved readability and maintainability 2025-07-05 16:04:21 +08:00
Harvey Zack 012c73c202 refactor: simplify version function export in context menu 2025-06-20 11:08:57 +08:00
Harvey Zack e8a7e050c4 refactor: update version handling and remove placeholder injection
- Simplified version display in context menu and template by directly importing version from package.json.
- Removed static version and environment methods from Artplayer class, replacing them with dynamic imports.
- Eliminated placeholder injection logic from build and dev scripts, streamlining the build process.
- Cleaned up build and dev scripts for better readability and maintainability.
2025-06-20 11:04:29 +08:00
Harvey Zack e2e8e83e63 Refactor code structure for improved readability and maintainability 2025-06-20 10:26:07 +08:00
Harvey Zhao 1374d530a4 fix mini position restore and typo (#981) 2025-06-20 10:19:28 +08:00
Harvey Zack 7e7bd8c0ad Refactor version display in context menu and clean up versioning format
- Updated the context menu version function to dynamically append the application version to the link and include a ref parameter in the URL.
- Removed the build version log from the initialization logs in the Artplayer class.
- Cleaned up the version and environment getters to return unquoted strings.
2025-06-20 10:18:39 +08:00
Harvey Zack da94223721 bump version to 5.2.4 2025-06-20 10:00:27 +08:00
Harvey Zack 3715a36cde fix: correct spelling of "height" in icon HTML attributes across documentation 2025-06-20 09:56:18 +08:00
Harvey Zhao 68d00e0166 docs(en): fix typos and improve wording (#980) 2025-06-20 09:53:34 +08:00
Harvey Zack c81b1ec83b Update CHANGELOG_CN.md 2025-06-15 18:35:02 +08:00
Harvey Zack bf5a186375 fix: update config method to allow initialization flag
- Modified the config method to accept an initialization flag, allowing for configuration during the initial setup without triggering unnecessary updates.
- Updated the call to config in the constructor to pass the new initialization flag.
2025-06-15 18:15:48 +08:00
Harvey Zhao 20b62ad3e3 refactor(types): improve definitions (#971) 2025-06-13 20:38:14 +08:00
Harvey Zhao 1941da46d9 fix: correct typos in player modules (#970) 2025-06-13 20:31:54 +08:00
Harvey Zhao 078b595819 fix: correct typos in player modules (#969) 2025-06-13 20:31:27 +08:00
Harvey Zhao 169c6a318a docs: fix autoPlayback typo (#967) 2025-06-12 21:24:58 +08:00
Harvey Zhao 77eaba8de9 fix: correct siblings helper name (#966) 2025-06-12 21:17:56 +08:00
Harvey Zhao db58d759b5 Update README.md 2025-06-08 15:17:51 +08:00
Harvey Zack 1ae4d17372 Remove artplayer-proxy-webav package and its related files including package.json, index.js, and type definitions. 2025-05-31 17:08:31 +08:00
Harvey Zack e773e2c44f 更新 VAST 插件文档和类型定义,修复描述和版本号,增强广告播放器功能 2025-05-30 10:45:31 +08:00
Harvey Zack 19756e8224 Add volume change handling to ASR plugin
- Implemented an event listener for 'video:volumechange' to adjust the gain node's value based on the current volume of the artplayer instance.
- This enhancement ensures that the audio processing reflects the user's volume adjustments in real-time.
2025-05-25 11:37:06 +08:00
Harvey Zack 826abd8c7d Update index.html 2025-05-24 12:06:52 +08:00
Harvey Zack d02740bd94 Update asr.js 2025-05-24 10:50:27 +08:00
Harvey Zack 5602ac315c Update asr.js 2025-05-24 10:12:18 +08:00
Harvey Zack b2f88cdd94 Update asr.js 2025-05-23 14:28:42 +08:00
Harvey Zack 15067279e3 Update asr.js 2025-05-23 12:37:17 +08:00
Harvey Zack 0d0a6f5516 Update README.md 2025-05-23 10:32:24 +08:00
Harvey Zack 10337ddb1d feat: add WAV format support for audio chunks in artplayer-plugin-asr
- Implemented pcmToWav function to convert PCM audio data to WAV format.
- Updated onAudioChunk callback to receive both PCM and WAV buffers.
- Modified TypeScript definitions to reflect changes in onAudioChunk parameter and append method.
2025-05-23 10:23:27 +08:00
Harvey Zack 62835bb042 fix: add optional chaining for safe access to voice_text_str in ASR response 2025-05-23 10:12:29 +08:00
Harvey Zack 3f0a1bd433 Refactor ASR plugin options and improve audio processing
- Renamed `hideTimeout` to `autoHideTimeout` for clarity.
- Updated the default options destructuring for better readability.
- Removed unnecessary comments and cleaned up the audio processing logic.
- Ensured that the audio buffer is processed correctly before sending to the `onAudioChunk` callback.
2025-05-23 10:08:20 +08:00
Harvey Zack 1ece90c582 Refactor code structure for improved readability and maintainability 2025-05-23 09:58:16 +08:00
Harvey Zack 4bdad1675b fix: add stop method to AsrPluginInstance interface 2025-05-23 09:05:00 +08:00
Harvey Zack 9fdbdabd7c Update index.js 2025-05-23 00:32:08 +08:00
Harvey Zack 5d7710979d fix: rename cleanupTimeout to hideTimeout for consistency in ASR plugin
Refactor artplayerPluginAsr: Enhance audio capture and processing

- Introduced gainNode for audio output management.
- Added mediaStream and mediaStreamSource for fallback audio capture.
- Refactored startCapture and stopCapture functions for better clarity and error handling.
- Improved audio source setup with a dedicated function for capturing audio from video.
- Ensured proper disconnection of audio nodes and cleanup of resources on destroy.

feat: enhance ASR plugin with improved subtitle handling and styling

fix: rename autoClearTimer to hideTimer for consistency in ASR plugin

Update asr.js

feat: refactor ASR plugin to improve audio chunk handling and WebSocket management

Update asr.js

fix: rename autoClearTimeout to cleanupTimeout for consistency

Update asr.js

feat: refactor ASR handling and improve WebSocket management

Update index.js

feat: add append and clear functions to enhance audio chunk handling

Update asr.js

Update asr.js

feat: release version 2.0.0 of artplayer-plugin-asr

- Implemented core functionality for audio recording using AudioWorklet.
- Added support for configurable audio capture interval and sample rate.
- Introduced WAV encoding for recorded audio chunks.
- Created a new plugin structure with proper TypeScript definitions.
- Added legacy support for older environments.
- Updated package.json with necessary metadata and export configurations.
- Included comprehensive inline documentation for better maintainability.
2025-05-23 00:09:13 +08:00
Harvey Zack 6c4e9f7e78 fix: enhance user agent detection to support custom user agent 2025-05-17 22:16:08 +08:00
Harvey Zack dd57cc2a03 add sourceMap 2025-04-21 09:54:32 +08:00
Harvey Zack ab06749c15 remove sourceMap 2025-04-21 09:10:21 +08:00
Harvey Zack c3343ad74f Refactor code structure for improved readability and maintainability 2025-04-20 19:54:19 +08:00
Harvey Zack 2a7e3d5e03 add index.esm.html 2025-04-20 19:35:10 +08:00
Harvey Zack a64e13c9c1 fix: update translation API and increase character limit for requests 2025-04-20 14:10:17 +08:00
Harvey Zack 674c6420e9 Refactor progress event handling in progress.js
- Moved the 'video:progress' event listener to be consistent with the RAF and timeupdate events.
- Ensured 'setBar' for 'loaded' is emitted during both RAF and video:progress events.
- Cleaned up the structure for better readability and maintainability.
2025-04-20 11:21:21 +08:00
Harvey Zack 9bdaaa3b7d Update nodejs.yml 2025-04-20 10:15:56 +08:00
Harvey Zack 0aabb42db3 update deps 2025-04-20 10:12:14 +08:00
Harvey Zack 17ece4c0c8 Add Vietnamese localization for Artplayer 2025-04-20 09:55:38 +08:00
Harvey Zack 36865f1e7e feat: 新增手势配置项,支持移动端手势事件 2025-03-22 11:55:09 +08:00
Harvey Zack db5e9fc810 更新 artplayer-plugin-auto-thumbnail.js 版本至 1.0.1 2025-03-01 17:46:57 +08:00
Harvey Zack 4987579d92 Merge branch 'master' of https://github.com/zhw2590582/ArtPlayer 2025-03-01 17:45:58 +08:00
Harvey Zack b4e5c712f5 更新 artplayer-plugin-auto-thumbnail 版本至 1.0.1 2025-03-01 17:44:27 +08:00
Harvey Zack 4b4973eeb3 chore: 更新版本至 5.1.6,修复样式加载失败问题并优化样式插入逻辑 2025-01-19 20:50:26 +08:00
Harvey Zack c89b9e7871 chore: 更新版本至 5.1.5,修复多个问题并增强移动端支持 2025-01-19 17:34:40 +08:00
Harvey Zack fae71811db feat: 添加对 Chromecast 状态和会话变化的监听支持 2025-01-19 14:28:03 +08:00
Harvey Zack e7c31e55b3 feat: 添加对移动设备的支持并优化滑块事件处理 2025-01-18 16:44:04 +08:00
Harvey Zack 38ef03d31f Update dom.js 2024-12-16 14:51:02 +08:00
Harvey Zack ad0395fa37 Update artplayer-plugin-danmuku.d.ts 2024-12-16 10:43:21 +08:00
Harvey Zack 58b7eeb6e6 Update danmuku.md 2024-12-15 21:56:31 +08:00
Harvey Zack 9f4e6c3a1b chore: 将 artplayer-plugin-ambilight 的选项属性改为可选 2024-12-07 18:08:04 +08:00
Harvey Zack eb8cc22bf2 Update common.js 2024-11-30 10:42:28 +08:00
Harvey Zack 3a052a60e3 chore: 删除不再使用的 TypeScript 声明文件,并添加新的插件声明文件 2024-11-30 10:35:41 +08:00
Harvey Zack 57d6f25e5b Update main.js 2024-11-26 10:06:29 +08:00
Harvey Zack 13d4fc9210 chore: 更新 hls.js 版本至 1.5.17 2024-11-24 22:11:12 +08:00
Harvey Zhao 38054536ed Update index.js 2024-11-16 21:46:51 +08:00
Harvey Zhao 07de29c304 Update index.js 2024-11-12 23:26:28 +08:00