Commit Graph
272 Commits
Author SHA1 Message Date
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 48b78d0ad7 Delete test.js 2025-08-17 18:31:34 +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 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 3715a36cde fix: correct spelling of "height" in icon HTML attributes across documentation 2025-06-20 09:56:18 +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 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 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 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 17ece4c0c8 Add Vietnamese localization for Artplayer 2025-04-20 09:55:38 +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
Harvey Zack bb3fc27427 Refactor Control class to update control option variables and element references 2024-10-21 18:26:06 +08:00
Harvey Zack a01782732d Refactor Control class to update control option variables and element references 2024-10-21 17:32:48 +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 395747f88f Refactor Artplayer class to update video URLs with query parameters 2024-10-21 11:49:14 +08:00
Harvey Zack ed88c73ab2 Refactor Artplayer class to update import path for Component 2024-10-21 00:18:28 +08:00
Harvey Zack 191c7736c4 Refactor Setting class to update range values 2024-10-20 13:28:39 +08:00
Harvey Zack c84157e30b Refactor Setting class to update and append items 2024-10-20 12:21:18 +08:00
Harvey Zack 5dfe50c719 Add artplayer-plugin-ambilight package and demo 2024-10-19 13:53:36 +08:00
Harvey Zack bdecbffeeb add selfie_segmentation 2024-10-08 09:47:05 +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 b9878e43e0 feat: update HLS control example and improve audio/quality track selection logic 2024-09-22 14:37:01 +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 92654e911f feat: add picture-in-picture support and enhance event emission in artplayerProxyCanvas 2024-09-17 10:30:52 +08:00
Harvey Zack faa621c5be Update canvas.js 2024-09-17 10:11:44 +08:00
Harvey Zack 2a864ad97d Update canvas.js 2024-09-15 11:13:08 +08:00
Harvey Zack a74e7bbff4 feat: createImageBitmap 2024-09-15 10:56:51 +08:00
Harvey Zack 710f9477f8 feat: artplayerProxyCanvas 2024-09-15 10:39:11 +08:00
Harvey Zack 22dce779d1 update controls 2024-09-15 00:24:02 +08:00
Harvey Zack 2b11d897ff feat: 增加字幕相关属性和事件,优化字幕切换逻辑 2024-09-14 16:14:59 +08:00
Harvey Zack 7bf8a00a7d chore: Update artplayer-proxy-canvas to support canvas proxy 2024-09-08 18:46:02 +08:00
Harvey Zack 813528f916 chore: Update artplayer-proxy-canvas to support canvas proxy 2024-09-08 18:20:11 +08:00
Harvey Zack 0f60ea53ae chore: Update artplayer-proxy-canvas to support canvas proxy 2024-09-08 18:05:06 +08:00
Harvey Zack 69133015e9 chore: Update auto.thumbnail.js and index.js 2024-09-01 12:14:53 +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 9a4ebf7917 Update vast.js 2024-08-23 23:31:06 +08:00
Harvey Zack 87b0506f51 refactor: Update VAST plugin in Artplayer 2024-08-23 23:23:50 +08:00
Harvey Zack f9192ff852 refactor: Update VAST plugin in Artplayer 2024-08-23 22:42:04 +08:00
Harvey Zack 27f161be40 refactor: Update thumbnail scale and video element resizing logic in Artplayer and artplayer-proxy-webav 2024-08-23 12:37:32 +08:00
Harvey Zack 5764344aaf refactor: Update thumbnail scale in Artplayer 2024-08-23 12:05:06 +08:00