Commit Graph
151 Commits
Author SHA1 Message Date
Harvey Zhao 13c898c149 refactor(audio): [PKG-AUDIO-04] migrate strict source and compatible type entries 2026-09-12 02:58:44 +08:00
Harvey Zhao 2f9bee4ee0 refactor(hls): [PKG-HLS-04] migrate modules and compatible types 2026-09-12 00:49:50 +08:00
Harvey Zhao 33f6d19b77 test(hls): [PKG-HLS-02] cover released contracts and real SDK playback 2026-09-11 23:53:16 +08:00
Harvey Zhao 5efc7f7699 build(tooling): [ENG-11] add module analysis without changing artifacts 2026-09-11 22:22:53 +08:00
Harvey Zhao 4a9a26d4fc test: [ENG-08] add verified TS coverage and paired performance reports 2026-09-11 22:01:48 +08:00
Harvey Zhao faaa3e8c2d refactor(core): [CORE-21] generate compatible public and editor declarations 2026-09-11 17:56:05 +08:00
Harvey Zhao ee895a558f refactor(core): [CORE-20] type entry and converge initialization 2026-09-11 16:07:06 +08:00
Harvey Zhao 9eb7c945ca refactor(core): CORE-12 type template resources and verify bundled notices 2026-09-11 03:50:33 +08:00
Harvey Zhao 5e31274f1d refactor(core): CORE-10 type playback properties and add compatible controls view 2026-09-11 02:51:55 +08:00
Harvey Zhao 874dac9f22 refactor(core): CORE-08 type plugin registration and guard closed instances 2026-09-11 02:09:36 +08:00
Harvey Zhao f9707bad71 refactor(types): CORE-07 reconcile public declarations and preserve legacy consumers 2026-09-11 01:42:32 +08:00
Harvey Zhao bab80ff886 fix(types): PKG-CHAPTER-04 preserve CJS ESM and legacy consumer contracts 2026-09-10 23:29:06 +08:00
Harvey Zhao 48660c4e12 refactor(chapter): PKG-CHAPTER-03 split runtime into typed lifecycle and view modules 2026-09-10 23:12:56 +08:00
Harvey Zhao a0286c4e95 test(packages): ENG-07 verify installed tarball contracts and browsers 2026-09-10 23:04:19 +08:00
Harvey Zhao b53461da1c build: ENG-06 support TS entries and preserve AMD globals 2026-09-10 21:47:10 +08:00
Harvey Zhao 771482426f build(types): ENG-04 add strict projects and legacy compiler checks 2026-09-10 21:21:39 +08:00
Harvey Zhao 833cc11674 ci(workspace): [ENG-02] add read-only checks and isolated Pages workflow 2026-09-10 19:22:24 +08:00
Harvey Zhao 9a6cfe5c6b build(workspace): [ENG-PM-01] use pinned Yarn with frozen installs 2026-09-10 19:09:26 +08:00
Harvey Zhao 3781e6bda1 build(workspace): [ENG-01] pin reproducible Node and npm toolchain 2026-09-10 18:52:58 +08:00
Harvey Zhao 740ac4cb24 Refactor styles in ArtPlayer components for improved readability and consistency
- Consolidated loading styles in loading.less for better structure.
- Updated mask styles in mask.less to enhance clarity.
- Refined mini popup styles in mini.less, adding transition effects.
- Improved mixins in mixins.less for consistent styling across components.
- Adjusted mobile styles in mobile.less for better responsiveness.
- Enhanced notice styles in notice.less for improved visibility.
- Streamlined plugin styles in plugins.less for better organization.
- Simplified poster styles in poster.less for clarity.
- Refined progress styles in progress.less, enhancing hover effects.
- Updated selector styles in selector.less for better interaction.
- Improved settings styles in setting.less for better usability.
- Enhanced subtitle styles in subtitle.less for better visibility.
- Updated variable definitions in variables.less for consistency.
- Refined video styles in video.less for improved layout.
- Enhanced volume control styles in volume.less for better user experience.
- Optimized rate limiting logic in build-llm.js and trans-docs.js for better performance.
2026-03-08 15:03:43 +08:00
Harvey Zhao 92f09a4290 Refactor documentation for clarity and consistency
- Updated descriptions and terminology across various component documentation files for improved clarity.
- Changed headings and section titles for better readability and consistency.
- Enhanced the language and structure of the documentation to provide clearer guidance on usage and configuration.
- Removed the `fix-docs.js` script as its functionality has been integrated into the translation process.
- Improved the translation script to handle Markdown code block issues and added retry logic for API calls.
2026-03-08 13:15:13 +08:00
Harvey Zhao 3adff76edf feat: Enhance DeepSeek API integration with retries and timeout handling
- Updated API key environment variable from DEEPL_API_KEY to DEEPSEEK_API_KEY
- Increased maximum text chunk length from 5000 to 8000 characters
- Implemented request timeout and retry logic for API calls
- Added handling for rate limiting responses (HTTP 429)
- Improved error handling for API responses
2026-03-08 13:00:57 +08:00
Harvey Zhao 562cfe18db refactor: remove .parcel-cache from .npmignore files across multiple plugins 2026-03-07 21:42:20 +08:00
Harvey Zhao 39a1fb1abd feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin, including code snippets for usage.
- Added a new i18n setup guide, detailing language settings, default languages, language imports, and how to add or modify languages.
- Included example code for initializing the Artplayer with different languages and importing language files.
2026-03-07 21:25:27 +08:00
Harvey Zhao 1dc8e9a4ff refactor: update global name handling in build scripts
- Replaced `toPascalCase` with `getGlobalName` in build and dev scripts to standardize global variable naming for packages.
- Added `toCamelCase` and `getGlobalName` utility functions in `utils.js` to handle naming conventions based on package type.
2026-03-07 20:41:11 +08:00
Harvey Zhao 1e60637b74 refactor: remove global window assignment for Artplayer and template export
- Removed the assignment of Artplayer to the global window object in index.js of the artplayer package.
- Eliminated the window export for the template plugin in index.js, streamlining the code and reducing global scope pollution.
2026-03-07 20:24:29 +08:00
Harvey Zhao 9cb7d6dc9f fix: improve regex for code block extraction and streamline match handling 2026-03-07 16:03:15 +08:00
Harvey Zhao 0f752260a4 fix: update test generation script to use Chinese documentation and exclude specific directories 2026-03-07 15:55:55 +08:00
Harvey Zhao 7bfee6c6dc feat: add build:test script and improve documentation code blocks
- Added a new script `build:test` to generate test cases from documentation code examples.
- Enhanced documentation files by ensuring proper code block formatting and adding missing closing backticks.
- Updated various markdown files to include new code blocks and fixed formatting issues.
2026-03-07 15:52:56 +08:00
Harvey Zhao 5cc8d14454 chore(i18n): remove outdated language files and update build script for i18n 2026-03-07 15:34:24 +08:00
Harvey Zhao 3bf0707faa fix(build): update cpy options to use flat for output directory 2026-03-07 15:32:38 +08:00
Harvey Zhao 699bf09577 feat: update changelog with Parcel to Vite refactor
feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin with code examples.
- Added a comprehensive guide for language settings (i18n) including default languages, importing languages, adding new languages, and modifying existing languages.
- Included code snippets for initializing the Artplayer with different language settings.

Add internationalization support for multiple languages in Artplayer

- Introduced Arabic (ar), Czech (cs), Spanish (es), Persian (fa), French (fr), Indonesian (id), Polish (pl), Russian (ru), Turkish (tr), Vietnamese (vi), and Traditional Chinese (zh-tw) translations.
- Created corresponding JavaScript and ES module files for each language containing translated strings for player controls and settings.
- Added a new documentation file for language settings in the project.

feat: add initial implementation of start option page with interactive code execution buttons

feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin, providing code examples for usage.
- Added a comprehensive guide for language settings, including default languages, importing languages, adding new languages, and modifying existing languages.
- Included code snippets for initializing the Artplayer with different language settings and importing language files.

refactor: update danmuku worker implementation and remove unused i18n files

- Changed the way the Danmuku class creates a Web Worker by using a worker loader instead of creating a blob.
- Removed Arabic, Czech, Spanish, Persian, French, Indonesian, Polish, Russian, Turkish, Vietnamese, and Traditional Chinese i18n files as they are no longer needed.
- Updated the Vite build configuration to disable banners for inline workers and added a plugin to remove worker banners from generated code.

feat: add danmuku plugin and i18n setup documentation

- Created a new documentation file for the danmuku plugin, providing code examples for usage.
- Added a new documentation file for language settings (i18n), detailing how to set default languages, import languages, and add new languages.
- Included code snippets for initializing the Artplayer with different language settings and examples for modifying existing languages.

feat: add danmuku plugin and i18n setup documentation

- Created a new documentation file for the danmuku plugin with code examples.
- Added a new documentation file for language settings (i18n) including import instructions and examples for setting default and custom languages.
- Updated the i18n documentation to include details on adding and modifying languages.

feat: add danmuku plugin and i18n setup documentation

- Created a new JavaScript file for the danmuku plugin documentation with multiple code execution buttons.
- Added a new JavaScript file for i18n (internationalization) setup documentation, including instructions for language settings, importing languages, and modifying language options.
- Included examples for setting default languages and adding new languages in the i18n documentation.

Refactor code structure for improved readability and maintainability
2026-03-07 15:21:34 +08:00
Harvey Zhao 0bdc59e446 chore: remove unused assets and sponsor page 2026-02-13 09:54:24 +08:00
Harvey Zhao 17042867fc feat: add danmuku plugin and i18n setup documentation
- Created a new documentation file for the danmuku plugin with code examples.
- Added a new documentation file for language settings (i18n) with detailed instructions on language imports, default languages, and how to add or modify languages.
2026-02-10 23:12:03 +08:00
Harvey Zhao 7dffd99cfd Refactor code structure for improved readability and maintainability
Remove debugging border from the websr plugin's styling

Enhance canvas sizing logic in artplayer-plugin-websr

- Updated canvas positioning to center it within the player.
- Introduced a new function to calculate canvas size based on the video aspect ratio.
- Adjusted canvas dimensions during initialization and on resize events to maintain aspect ratio.
- Ensured canvas styles are updated to reflect the calculated dimensions.

feat: add comparison mode to artplayer-plugin-websr

- Updated README.md to reflect new comparison feature and simplified content.
- Modified package.json to remove unnecessary keywords.
- Enhanced index.js to implement comparison functionality, allowing users to compare original and upscaled video.
- Added new methods for enabling, disabling, and toggling comparison mode, as well as setting and getting the comparison position.
- Updated TypeScript definitions to include new comparison options and methods.
2026-02-10 23:02:31 +08:00
Harvey Zhao 4a980971f7 feat: update libUris in common.js with dynamically built plugin file paths 2026-01-04 21:09:35 +08:00
Harvey Zhao fa2c69e83d feat: add React and Vue examples with Artplayer integration
- Implemented a React template with Vite, including ESLint configuration and necessary dependencies.
- Created a Vue template with Vite, including setup for Artplayer and plugins.
- Added internationalization support in both React and Vue examples.
- Included sample video and Danmuku plugin integration in both frameworks.
- Established project structure with appropriate configuration files and README documentation.
2026-01-03 14:08:31 +08:00
Harvey Zhao 99ad0d7b93 Update package.json
Remove options section from README for clarity

Add 'waiting' event emission during seeking in mediabunnyEngine

This change emits a 'waiting' event when the seeking process begins,
improving the event handling and allowing for better synchronization
during media playback.

fix(audioEngine): adjust audio context suspension timing for improved playback responsiveness

refactor(mediabunnyVideoShim): remove redundant width and height getters; enhance poster setter and add setAttribute method

feat: initialize artplayer-proxy-mediabunny with essential files and structure

feat: implement audio and video engines for mediabunny integration

- Added audioEngine.js to handle audio playback using MediaBunny.
- Created mediabunnyEngine.js to manage both audio and video playback.
- Implemented videoEngine.js for rendering video on a canvas.
- Introduced canvasProxy.js to create a canvas element and manage its methods.
- Developed mediabunnyVideoShim.js to bridge ArtPlayer and MediaBunny functionalities.
- Added videoEvents.js for custom event handling related to video playback.
- Included a utility function clamp.js for value clamping.

feat: add playback rate control to audio and video engines

- Introduced playback rate management in the audio engine, allowing dynamic adjustment of playback speed.
- Updated the mediabunny engine to expose the new setPlaybackRate method.
- Enhanced the mediabunny video shim to support playback rate adjustments, including getter and setter for playbackRate.
- Added event emission for rate changes to ensure proper handling in the application.

Enhance audio engine and video shim functionality

- Added a check to ensure the audio context is initialized before playing audio in the audio engine.
- Introduced a new 'playing' getter in the video shim to accurately reflect the playback state, indicating when the video is neither paused nor ended.

Refactor audio context initialization to handle errors and remove async/await

- Changed `ensureAudioContext` from async to synchronous to simplify error handling.
- Added a try-catch block to handle potential errors when creating the AudioContext with a specified sample rate.
- Updated calls to `ensureAudioContext` to remove unnecessary await statements.

Enhance Mediabunny Engine and Video Shim with State Management and Error Handling

- Added readyState, networkState, and error properties to the Mediabunny Engine for better state management.
- Implemented error handling during media loading, emitting appropriate events on error.
- Updated the Video Engine to emit a 'timeupdate' event for better synchronization.
- Extended the Mediabunny Video Shim to expose new properties (readyState, networkState, error) and methods for improved functionality.
- Added seekable property to the Video Shim to provide seekable range based on media duration.
- Implemented additional properties and methods in the Video Shim for autoplay, loop, controls, currentSrc, poster, preload, defaultMuted, and defaultPlaybackRate.
- Enhanced requestVideoFrameCallback and cancelVideoFrameCallback methods for better frame handling.

refactor: streamline audio and video engine implementations

- Updated audioEngine.js to improve readability and maintainability by using consistent formatting and simplifying function structures.
- Refactored mediabunnyEngine.js to enhance clarity and ensure consistent coding style.
- Enhanced videoEngine.js with improved async handling and clearer function definitions.
- Modified canvasProxy.js to maintain consistent formatting and improve readability.
- Updated mediabunnyVideoShim.js to streamline event handling and improve clarity.
- Refactored videoEvents.js for better readability and consistency in event listener management.
- Simplified clamp.js for improved readability.

feat: enhance audio and video loading with metadata callbacks

- Updated audioEngine to accept an optional onMetadata callback in the load function, which is triggered upon loading completion.
- Modified mediabunnyEngine to handle video and audio loading concurrently, emitting loadedmetadata and durationchange events only when both are ready.
- Enhanced videoEngine to include an onMetadata callback in the load function, ensuring metadata events are emitted appropriately.
- Implemented a throttling mechanism for the timeupdate event in videoEngine to reduce event emissions and improve performance.

feat: add seeking state and played property to mediabunny engine and video shim

- Introduced a `_seeking` state in the mediabunny engine to track seek operations.
- Emitted 'seeking' and 'seeked' events during seek operations.
- Added a `seeking` getter to expose the seeking state.
- Implemented a `played` property in the video shim to provide playback range information.
- Added `width` and `height` getters to the video shim for better video dimension access.
- Enhanced cross-origin handling in the video shim.

feat(audioEngine): enhance audio playback management with starvation detection

- Added an event emitter to notify when the audio context is waiting.
- Implemented a starvation check that suspends the audio context if playback is delayed.
- Introduced a mechanism to track the latest scheduled end time of audio buffers.
- Updated the handling of audio buffer playback to ensure proper state transitions.

refactor: remove unnecessary comments and streamline code in audio, video, and mediabunny engines

feat: add resize functionality to canvas proxy and update type definitions

- Implemented a resize function in canvasProxy.js to adjust canvas size based on player dimensions and video metadata.
- Updated TypeScript definitions for artplayer-proxy-mediabunny to include option and result types.
- Modified build-ts script to include all plugin type definitions.
- Added TypeScript definitions for artplayer-proxy-canvas and artplayer-proxy-mediabunny.

refactor: remove unused properties from Artplayer instance and make option parameter optional in artplayerProxyCanvas type definition

Enhance Mediabunny and Video Engine functionality

- Added event listener for 'ended' event in mediabunnyEngine to handle playback state.
- Modified seek function to check if playback should resume after seeking.
- Reset canvas dimensions to zero in videoEngine when video track is not available or cannot be decoded.
- Ensured canvas is cleared when video track is invalid to prevent rendering issues.

Emit 'waiting' event during loadstart in mediabunnyEngine

Refactor event emission in mediabunnyEngine and add sleep utility function

- Changed the event emission for 'loadstart' to be asynchronous using setTimeout.
- Introduced a new utility function 'sleep' to facilitate delayed execution in promises.

feat: enhance mediabunny proxy with new options and source handling

- Added options for event delay, load timeout, timeupdate interval, AV sync tolerance, poster, and source in README.
- Implemented source normalization in audio and video engines to support URL, Blob, and ReadableStream.
- Updated mediabunny engine to handle new options and improve load handling with timeout and error management.
- Enhanced video engine to draw a poster when no video source is available and manage playback rate.
- Modified shim to accept source option and integrate with the new engine options.
- Updated TypeScript definitions to reflect new options and source types.

feat: add dropLateFrames option to video and mediabunny engines

- Introduced dropLateFrames option in mediabunnyEngine and videoEngine to control frame dropping behavior.
- Updated videoEngine logic to handle frame rendering based on the dropLateFrames setting.
- Added type definition for dropLateFrames in TypeScript declaration file.

fix: delay loadstart event emission to ensure proper event handling

The 'loadstart' event emission is now wrapped in a setTimeout to ensure it is triggered after the current call stack is cleared. This change aims to improve the timing of event emissions and prevent potential issues with event handling in the mediabunny engine.

feat: add preflight range check and drop late frames option

- Updated README.md to include new options: dropLateFrames and preflightRange.
- Enhanced mediabunnyEngine to support new options with default values.
- Implemented preflight function in videoEngine to check server support for Range requests.
- Adjusted videoEngine to utilize preflight check before loading media.
- Updated TypeScript definitions to include preflightRange option.

Remove aspectRatio option from Artplayer configuration

Update README and mediabunny example URL for consistency

Refactor code structure for improved readability and maintainability

Update dependencies and fix play/seek state management in mediabunnyEngine

Refactor code structure for improved readability and maintainability

fix(types): update export syntax and formatting in TypeScript declaration files
2025-12-13 14:06:30 +08:00
Harvey Zhao 0a9aadf543 feat: add link to LLMs resource in README
Implement code changes to enhance functionality and improve performance

chore: add initial empty files for artplayer.d.ts, llm.txt, and build-llm.js

Refactor Artplayer examples for improved readability and consistency

- Updated mobile.js to enhance code formatting and structure.
- Refined mpegts.js for better readability and consistency in function usage.
- Improved multiple.subtitles.js with clearer structure and modern syntax.
- Enhanced setting.test.js for better organization and clarity in settings management.
- Streamlined thumbnail.js for consistent formatting.
- Updated vast.js for improved readability and consistency in plugin usage.
- Refined vtt.thumbnail.js for better code organization.
- Enhanced webtorrent.js for improved readability and consistency in async handling.
- Updated TypeScript definitions for various plugins to maintain consistency in export statements.
- Adjusted package.json linting script to include TypeScript files in the docs/assets/ts directory.
- Removed outdated types.test.js file to clean up the test suite.

refactor: remove outdated documentation files and update translation script

- Deleted i18n.md and option.md documentation files as they are no longer needed.
- Updated trans-docs.js to streamline the translation process and improve error handling.
- Adjusted plugin template package.json for consistency.
- Changed console.log to console.warn in various test files for better logging practices.

feat: add danmaku plugin documentation and i18n support

- Introduced comprehensive documentation for the Danmaku library, including installation, usage examples, and configuration options.
- Added language settings documentation, highlighting the need for manual language imports starting from version 5.1.0.
- Updated basic options documentation with detailed descriptions and examples for player configuration options.

Refactor documentation for clarity and consistency; update translation script to handle large Markdown chunks

refactor: improve documentation clarity and consistency across various components

- Updated property descriptions in layers.md and setting.md for better readability.
- Enhanced language and structure in index.md, danmuku.md, i18n.md, and option.md to ensure uniformity.
- Corrected minor grammatical errors and improved phrasing throughout the documentation.
- Ensured consistent formatting in tables and code snippets for better user experience.

feat: add build script for generating llm.txt and update translation source directories

Refactor build-llm.js to improve concurrency and enhance prompt clarity

- Introduced a MAX_CONCURRENT_REQUESTS constant to manage concurrent API requests.
- Added a runConcurrent function to handle task execution with a limit on concurrent requests.
- Updated the askDeepSeek function to include more informative logging.
- Enhanced prompts for summarizing documentation, TypeScript definitions, and JavaScript examples to improve clarity and maintain formatting.
- Modified the main function to fetch files concurrently and streamline the summarization process.

Increase text chunk size from 5000 to 8000 in summarizeSection function for improved processing of larger files.

fix: update lint script to include .js files in the scripts directory
2025-10-08 12:20:12 +08:00
Harvey Zack 92ff80d285 fix: add missing types export in package.json and correct interface syntax in TypeScript definition 2025-09-06 15:13:23 +08:00
Harvey Zack 5b1cebb334 feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Updated the structure and content of the i18n documentation to enhance clarity and usability.
2025-09-06 13:48:25 +08:00
Harvey Zack eccea444b0 refactor: remove redundant comments and improve code clarity in build scripts 2025-08-17 23:53:26 +08:00
Harvey Zack e8b01c357f feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin with code examples.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Updated the structure of the i18n documentation for clarity and usability.
2025-08-17 23:51:45 +08:00
Harvey Zack 79358663eb fix: improve indentation and formatting for style element creation in plugin 2025-08-17 18:43:57 +08:00
Harvey Zack 043947c9af feat: update .npmignore files to include src and package-lock.json; remove .npmrc files 2025-08-17 18:42:02 +08:00
Harvey Zack e7633ed49d fix: update window export syntax for plugin; ensure compatibility with global scope
feat: add example usage for artplayer-plugin-test in test.js
2025-08-17 18:30:23 +08:00
Harvey Zack abbecff472 refactor: update TypeScript definitions for Artplayer plugin; change export syntax and improve interface structure 2025-08-17 18:28:43 +08:00
Harvey Zack 50320bad5d feat: add module and exports fields in package.json; improve style handling in index.js 2025-08-17 18:25:52 +08:00
Harvey Zack 5cc6724f54 refactor: optimize component lifecycle and build process
- React: Removed unnecessary dependencies from useEffect in Artplayer component.
- Vue: Simplified instance emission in Artplayer component by removing nextTick.
- Build script: Added cpy to copy built i18n files to a new directory and set context to browser for Parcel.
2025-08-17 17:25:16 +08:00
Harvey Zack 4b55b97e9e update vue template 2025-08-17 14:32:17 +08:00