Commit Graph
172 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 52b38a48b2 Implement code changes to enhance functionality and improve performance 2025-08-16 21:28:49 +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 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 826abd8c7d Update index.html 2025-05-24 12:06:52 +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 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 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 0f60ea53ae chore: Update artplayer-proxy-canvas to support canvas proxy 2024-09-08 18:05:06 +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 2fe7a09aaf refactor: Update Q群 link in index.html 2024-08-24 23:03: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 883762ed42 feat: Add support for dynamic proxies in Artplayer
The code changes introduce new proxy options (`artplayer-proxy-webav` and `artplayer-proxy-libmedia`) in Artplayer, allowing for the use of third-party video and canvas proxies. This enhancement provides more flexibility in handling video playback and rendering, improving the overall performance and compatibility of Artplayer.
2024-08-18 21:17:28 +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 adff473f71 Update index.html 2024-08-06 15:03:55 +08:00
Harvey Zack 0bb99184ca feat: Add Google AdSense script for ads in index.html and config.js 2024-08-04 09:43:38 +08:00
Harvey Zack 245ce6c6b7 feat: Add Google AdSense meta tag to index.html and config.js 2024-08-04 09:38:25 +08:00
Harvey Zack 7414f4a86a Update index.html 2024-07-07 22:44:31 +08:00
Harvey Zack eef1d675df feat: Add support for video chapters in artplayer-plugin-chapter 2024-06-02 13:07:26 +08:00
Harvey Zack 0f7a3ce02c chore: Update window object property name to ArtplayerPluginVast 2024-06-02 12:37:30 +08:00
Harvey Zack a8151ba4fb chore: Update webtorrent.js link in navigation bar 2024-05-31 10:13:45 +08:00
Harvey Zack f260f3a9ec Update index.html 2024-05-30 21:42:08 +08:00
Harvey Zack 82d263bc6c chore: Update donation link in navigation bar 2024-05-30 21:28:27 +08:00
Harvey Zack 0d830e04d8 chore: Add donation link and QQ group to navigation bar 2024-05-30 20:32:05 +08:00
Harvey Zack c1edb1ac6e chore: Update checkbox labels and improve code editor functionality 2024-05-28 11:11:31 +08:00
Harvey Zack e53c051166 chore: Update plugin names to use proper capitalization 2024-05-27 11:37:27 +08:00
Harvey Zack aa5dbd0418 Add artplayer-plugin-chromecast to index.html 2024-04-16 00:45:26 +08:00
Harvey Zack 00f780a7dc Update index.html to remove QQ群•320881312 and add a new div for QQ群•320881312 in the tool section 2024-04-11 10:58:22 +08:00
Harvey Zack c47c39d13b Update index.html 2024-04-11 10:01:49 +08:00
Harvey Zack 5f694a7299 Update HTML files to improve language consistency and remove unused code 2024-04-10 22:13:01 +08:00
Harvey Zack 5f0e41ad40 Update donate link in index.html 2024-04-10 21:55:43 +08:00
Harvey Zack 5ae86a407f Update style.css to improve layout and design 2024-04-10 21:51:20 +08:00
Harvey Zack 04905ff44f Update Artplayer version and service worker registration 2024-03-17 18:55:47 +08:00
Harvey Zack 0a0b1593ae Update style.css and index.html files 2023-12-11 17:34:06 +08:00
Harvey Zack c1d86cc029 Update checkbox styling and add PRO checkbox 2023-12-11 16:50:28 +08:00
Harvey Zack 4360c1e695 Merge branch 'pr/654' 2023-11-26 14:51:34 +08:00
Harvey Zack d8720d3bcf Update artplayer plugin versions 2023-11-26 14:05:09 +08:00
Harvey Zack 2b18452644 Delete unnecessary files and update plugin names 2023-11-24 10:11:08 +08:00
Harvey Zack 89b8525f2f Add unescape utility function and
artplayerPluginMultipleSubtitles plugin
2023-11-23 23:23:51 +08:00
journey-ad 08ec5716f9 feat(subtitle): add artplayer-plugin-libass 2023-11-14 12:36:35 +08:00
Harvey Zack 4a088aebc4 update demo 2023-05-18 12:31:48 +08:00
Harvey Zack 77b96112fb Update index.html 2023-04-24 11:22:05 +08:00
Harvey Zack f472410a3b add artplayer-plugin-dash-quality 2023-02-18 13:06:23 +08:00