Commit Graph
144 Commits
Author SHA1 Message Date
Harvey Zhao 0bb4e1acdb Refactor code structure for improved readability and maintainability 2026-01-01 19:50:00 +08:00
Harvey Zhao 01d8dc680c feat: add liquid glass plugin to the README 2025-12-13 17:08:10 +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 e28be64026 Update README.md 2025-09-11 16:21:23 +08:00
Harvey Zack 06c00906c2 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, including default languages, importing languages, adding new languages, and modifying existing languages.
- Updated the i18n documentation to reflect changes in language handling and provide code snippets for implementation.
2025-08-31 12:11:13 +08:00
Harvey Zhao ada6afca69 Update README.md 2025-08-16 21:34:31 +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 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 Zhao 603151af84 Update README.md 2025-08-02 17:21:18 +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 0d0a6f5516 Update README.md 2025-05-23 10:32:24 +08:00
Harvey Zack 0aabb42db3 update deps 2025-04-20 10:12:14 +08:00
Harvey Zack 13d4fc9210 chore: 更新 hls.js 版本至 1.5.17 2024-11-24 22:11:12 +08:00
Harvey Zack 0b75f1d132 Refactor Control class to update control option variables and element references 2024-10-21 17:22:52 +08:00
Harvey Zack 5dfe50c719 Add artplayer-plugin-ambilight package and demo 2024-10-19 13:53:36 +08:00
Harvey Zack edc33bb32f artplayer-plugin-vast@1.0.0 2024-10-12 16:58:23 +08:00
Harvey Zack a7599c41b5 docs: update README and config to include danmuku-mask plugin link 2024-10-08 12:00:40 +08:00
Harvey Zack d9bdc9bdeb feat: add danmuku mask plugin for ArtPlayer with initial implementation and documentation 2024-10-07 22:41:51 +08:00
Harvey Zack ef964c4bc0 feat: migrate from artplayer-plugin-hls-quality to artplayer-plugin-hls-control, update configurations and documentation 2024-09-22 12:46:59 +08:00
Harvey Zack 57725e8e27 feat: add initial implementation of artplayer-proxy-canvas with core functionality 2024-09-19 10:52:54 +08:00
Harvey Zack 0f60ea53ae chore: Update artplayer-proxy-canvas to support canvas proxy 2024-09-08 18:05:06 +08:00
Harvey Zack 4e2d68854a Update README.md 2024-09-01 12:07:00 +08:00
Harvey Zack a33df191a4 feat: Add artplayer-plugin-auto-thumbnail plugin 2024-09-01 12:05:08 +08:00
Harvey Zack 63223c8202 refactor: Remove unused libmedia proxy and related files 2024-08-25 14:44:11 +08:00
Harvey Zack 6dc6be5b9e refactor: Update library section heading in README and docs
The code changes update the heading for the library section in both the README and docs files. The heading is changed from "Library" to "Libraries" to provide a more accurate description of the content. This refactor improves the clarity and consistency of the documentation.
2024-08-18 21:46:11 +08:00
Harvey Zack 7f6c9c8ee1 refactor: Update video element in Artplayer to support custom canvas or video 2024-08-18 21:06:56 +08:00
Harvey Zack 219956cabd refactor: Update build timestamp in Artplayer 2024-08-17 21:02:39 +08:00
Harvey Zack c4fd5b1a5d Update README.md 2024-06-06 10:17:38 +08:00
Harvey Zack e0b351831e Update README.md 2022-11-05 09:23:53 +08:00
Harvey Zack 1593a4a528 add prettier 2022-11-04 20:55:17 +08:00
Harvey Zack 4c12972101 Update README.md 2022-05-15 13:12:54 +08:00
Harvey Zack e141163350 Create README.md 2022-04-29 18:11:36 +08:00
Harvey Zack f8abfabe17 Update README.md 2022-04-23 10:54:20 +08:00
Harvey Zack 8e995dd2b6 Update README.md 2022-04-23 10:49:27 +08:00
zhw2590582 59400eb3bf remove player object 2022-01-07 17:38:10 +08:00
Harvey Zack e5e7498a2b Update README.md 2021-12-10 15:24:38 +08:00
Harvey Zack 914668c2d0 Update README.md 2021-12-02 18:38:20 +08:00
Harvey 21f6c45aa0 Update README.md 2021-11-29 08:49:37 +08:00
zhw2590582 023391be4c update 2021-11-28 13:47:41 +08:00
zhw2590582 c79b41b224 update 2021-11-28 13:29:46 +08:00
zhw2590582 d72d816ef7 update 2021-11-28 11:10:24 +08:00
zhw2590582 482f02824d Update README.md 2021-11-28 10:27:55 +08:00
zhw2590582 c16dfc391a Update README.md 2021-11-28 10:27:45 +08:00
Harvey Zack bb1cfed332 Update README.md 2021-11-28 10:26:22 +08:00
zhw2590582 552806ad83 update 2021-11-28 10:09:23 +08:00
zhw2590582 e8030809fd Update README.md 2021-11-28 10:02:44 +08:00
Harvey Zack 709a8b20e2 Update README.md 2021-11-28 09:57:29 +08:00