Commit Graph
116 Commits
Author SHA1 Message Date
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
Harvey Zack 0c0bcecb9e Add internationalization support and build process for multiple languages
- Implemented a build script to compile i18n files and copy them to the docs directory.
- Added compiled i18n files for Arabic, Czech, Spanish, Persian, French, Indonesian, Polish, Russian, Turkish, Vietnamese, and Traditional Chinese.
- Created an HTML file to demonstrate the usage of Artplayer with i18n support, including language options and a sample video.
2025-08-17 13:18:08 +08:00
Harvey Zack 41040e5ac1 feat: add danmuku plugin documentation and i18n setup guide
- Created a new documentation file for the danmuku plugin with code examples for usage.
- Added comprehensive language settings documentation, including default languages, importing languages, adding new languages, and modifying existing languages.
- Updated the i18n setup guide to reflect changes in language handling and provide code snippets for implementation.
2025-08-17 12:22:55 +08:00
Harvey Zack c911928166 feat: add danmuku plugin documentation and i18n setup
- Created a new documentation file for the danmuku plugin with interactive code execution.
- Added comprehensive i18n setup instructions, including default language settings, language imports, and examples for adding and modifying languages.
- Introduced a test file to verify the integration of the danmuku plugin.
2025-08-17 12:09:50 +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 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 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 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 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 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 73bafc988a feat: Fix dropdown menu bug in dev.js and build.js 2024-06-08 12:47:24 +08:00
Harvey Zack 502865ef65 Update create.js 2024-06-02 12:56:26 +08:00
Harvey Zack 924c3513e8 Update create.js 2024-06-02 12:45:54 +08:00
Harvey Zhao fac7d15726 Vast (#762)
* add artplayer-plugin-vast

* chore: Add create:plugin script to package.json

* chore: Remove deprecated artplayer-plugin-{{name}} and artplayer-plugin-vast types

* chore: Update artplayer-plugin-vast package description

* chore: Update Prettier configuration and dependencies
2024-06-02 12:28:17 +08:00
Harvey Zack c1457dd9ae chore: Update build.js to return compressedHtmlString instead of compressedCssString 2024-05-27 12:43:50 +08:00
Harvey Zack 774ca866d2 chore: Update build.js to return compressedHtmlString instead of compressedCssString 2024-05-27 12:30:30 +08:00
Harvey Zack e3a337d9ab chore: Remove unnecessary console.log statements 2024-05-27 10:01:40 +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
Harvey Zack a2b57495a2 Update build:docs and trans:docs scripts 2023-11-26 13:23:21 +08:00
Harvey Zack a2d3e20479 Fix build:docs script order in package.json 2023-11-26 11:42:11 +08:00
Harvey Zack b6a62f8dc5 Update language and demo links in plugin
documentation
2023-11-26 11:26:18 +08:00
Harvey Zack 69197312cc Update OpenAI translation engine and increase max
tokens limit
2023-11-26 11:19:13 +08:00
Harvey Zack bbbeca6e4c Update HLS, FLV, and DASH player configurations
Update progress bar height in Artplayer

Add dynamic layer, controller, menu, and setting item management

Update Changelog_CN

Update utils.js

Update package.json

Update built-in management in Artplayer

Update i18n documentation

Add support for new languages

Update language import and modification
2023-11-26 10:30:24 +08:00
Harvey Zack 2fc9d4d3e9 Dep (#601)
* init

* update dep
2023-08-26 16:48:19 +08:00
Harvey Zack c930bafd67 add tr.js 2023-08-26 13:32:51 +08:00
Harvey Zack e71a683dfd I18n (#600)
* update i18n

* update i18n
2023-08-26 13:22:19 +08:00
Harvey Zack 8ff35b5f6f update demo 2023-05-03 11:08:49 +08:00
Harvey Zack ddfce350ec update scripts 2023-04-26 10:25:02 +08:00
Harvey Zack 7b53de941d V5 (#500)
* update dep

* Update package.json

* update contextmenu

* update d.ts

* update onVttLoad

* build artplayer

* update style

* --art-theme

* update style

* update style

* update user-select

* add getIcon

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* update style

* add progress-hover

* update mini

* update style

* update style

* update style

* update style

* update style

* update volume

* update style

* add art-backdrop

* update style

* update style

* update style

* update currentLevel

* update artplayerPluginControl

* update artplayerPluginDanmuku

* Update package.json
2023-04-16 23:01:26 +08:00
Harvey Zack b97184bf48 build docs 2023-01-18 15:24:59 +08:00
Harvey Zack fa7954de0d Artplayer vitepress (#446)
* init

* init

* update

* update

* update

* update

* update

* update

* add i18n option

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update
2023-01-11 20:45:01 +08:00
Harvey Zack 1df2bd1def update build-ts 2022-12-31 21:40:57 +08:00
Harvey Zack c18739387a update scripts 2022-12-25 18:16:08 +08:00