mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 20:21:20 -08:00
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
This commit is contained in:
1 parent
987795503b
commit
0a9aadf543
71 files changed
+10851
-1945
No files matched your search
@@ -1,8 +1,8 @@
|
||||
# Example Events
|
||||
# Instance Events
|
||||
|
||||
Player events are divided into two types, one is the video's `native events` (prefix `video:`), the other is `custom events`
|
||||
Player events are divided into two types: `native events` from the video (prefixed with `video:`) and `custom events`.
|
||||
|
||||
Listening to events:
|
||||
Listen for events:
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ art.on('video:canplay', () => {
|
||||
});
|
||||
```
|
||||
|
||||
Listen to an event only once:
|
||||
Listen for an event only once:
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -63,14 +63,15 @@ const onReady = () => {
|
||||
art.on('ready', onReady);
|
||||
```
|
||||
|
||||
:::warning For a full list of events, please refer to the following address:
|
||||
:::warning For all events, please refer to the following address:
|
||||
|
||||
[artplayer/types/events.d.ts](https://github.com/zhw2590582/ArtPlayer/blob/master/packages/artplayer/types/events.d.ts)
|
||||
|
||||
:::
|
||||
|
||||
## `ready`
|
||||
|
||||
Triggered when the player is able to play for the first time
|
||||
Triggered when the player is ready for the first time
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -87,7 +88,7 @@ art.on('ready', () => {
|
||||
|
||||
## `restart`
|
||||
|
||||
Triggered when the player switches the address and is able to play
|
||||
Triggered when the player switches URL and is ready to play
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -105,6 +106,7 @@ art.on('restart', (url) => {
|
||||
console.info('restart', url);
|
||||
});
|
||||
```
|
||||
|
||||
## `pause`
|
||||
|
||||
Triggered when the player is paused
|
||||
@@ -141,7 +143,7 @@ art.on('play', () => {
|
||||
|
||||
## `hotkey`
|
||||
|
||||
Triggered when a hotkey on the player is pressed
|
||||
Triggered when a player hotkey is pressed
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -227,6 +229,7 @@ art.on('dblclick', (event) => {
|
||||
console.info('dblclick', event);
|
||||
});
|
||||
```
|
||||
|
||||
## `click`
|
||||
|
||||
Triggered when the player is clicked
|
||||
@@ -242,11 +245,10 @@ var art = new Artplayer({
|
||||
art.on('click', (event) => {
|
||||
console.info('click', event);
|
||||
});
|
||||
```
|
||||
|
||||
## `error`
|
||||
|
||||
Triggered when an error occurs while the player is loading the video
|
||||
Triggered when an error occurs while the player is loading a video
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -260,9 +262,10 @@ art.on('error', (error, reconnectTime) => {
|
||||
console.info(error, reconnectTime);
|
||||
});
|
||||
```
|
||||
|
||||
## `hover`
|
||||
|
||||
Triggered when the player is hovered or unhovered by the mouse
|
||||
Triggered when the mouse pointer enters or leaves the player
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -279,7 +282,7 @@ art.on('hover', (state, event) => {
|
||||
|
||||
## `mousemove`
|
||||
|
||||
Triggered when the mouse moves over the player
|
||||
Triggered when the mouse pointer moves over the player
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -293,9 +296,10 @@ art.on('mousemove', (event) => {
|
||||
console.info('mousemove', event);
|
||||
});
|
||||
```
|
||||
|
||||
## `resize`
|
||||
|
||||
Triggered when the player size changes
|
||||
Triggered when the player's dimensions change
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -312,7 +316,7 @@ art.on('resize', () => {
|
||||
|
||||
## `view`
|
||||
|
||||
Triggered when the player appears in the viewport
|
||||
Triggered when the player enters or leaves the viewport
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -329,7 +333,7 @@ art.on('view', (state) => {
|
||||
|
||||
## `lock`
|
||||
|
||||
On mobile, triggered when the locked state changes
|
||||
Triggered when the lock state changes on mobile devices
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -347,7 +351,7 @@ art.on('lock', (state) => {
|
||||
|
||||
## `aspectRatio`
|
||||
|
||||
Triggered when the aspect ratio of the player changes
|
||||
Triggered when the player's aspect ratio changes
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -366,7 +370,7 @@ art.on('aspectRatio', (aspectRatio) => {
|
||||
|
||||
## `autoHeight`
|
||||
|
||||
Triggered when the player automatically sets the height
|
||||
Triggered when the player automatically sets its height
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -387,7 +391,7 @@ art.on('autoHeight', (height) => {
|
||||
|
||||
## `autoSize`
|
||||
|
||||
Triggered when the player automatically sets the size
|
||||
Triggered when the player automatically adjusts its size
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -402,9 +406,10 @@ art.on('autoSize', () => {
|
||||
console.info('autoSize');
|
||||
});
|
||||
```
|
||||
|
||||
## `flip`
|
||||
|
||||
Triggered when the player flips
|
||||
Triggered when the player's video is flipped
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -423,7 +428,7 @@ art.on('flip', (flip) => {
|
||||
|
||||
## `fullscreen`
|
||||
|
||||
Triggered when the player goes into full screen
|
||||
Triggered when the player enters or exits fullscreen mode
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -441,7 +446,7 @@ art.on('fullscreen', (state) => {
|
||||
|
||||
## `fullscreenError`
|
||||
|
||||
Triggered when the player goes into full screen error
|
||||
Triggered when an error occurs during fullscreen mode transition
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -462,7 +467,7 @@ art.on('fullscreenError', (event) => {
|
||||
|
||||
## `fullscreenWeb`
|
||||
|
||||
Triggered when the player enters web fullscreen
|
||||
Triggered when the player enters or exits web page fullscreen mode
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -480,7 +485,7 @@ art.on('fullscreenWeb', (state) => {
|
||||
|
||||
## `mini`
|
||||
|
||||
Triggered when the player enters mini mode
|
||||
Triggered when the player enters or exits mini mode
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -498,9 +503,10 @@ art.on('mini', (state) => {
|
||||
console.info('mini', state);
|
||||
});
|
||||
```
|
||||
|
||||
## `pip`
|
||||
|
||||
Triggered when the player enters Picture-in-Picture mode
|
||||
Triggered when the player enters or exits picture-in-picture mode
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -518,7 +524,7 @@ art.on('pip', (state) => {
|
||||
|
||||
## `screenshot`
|
||||
|
||||
Triggered when the player takes a screenshot
|
||||
Triggered when the player captures a screenshot
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -533,9 +539,10 @@ art.on('screenshot', (dataUri) => {
|
||||
console.info('screenshot', dataUri);
|
||||
});
|
||||
```
|
||||
|
||||
## `seek`
|
||||
|
||||
Triggered when the player jumps in time
|
||||
Triggered when the player performs a time jump
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -552,7 +559,7 @@ art.on('seek', (currentTime) => {
|
||||
|
||||
## `subtitleOffset`
|
||||
|
||||
Triggered when the subtitle offset occurs in the player
|
||||
Triggered when subtitle offset changes
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -594,7 +601,7 @@ art.on('subtitleBeforeUpdate', (cues) => {
|
||||
|
||||
## `subtitleAfterUpdate`
|
||||
|
||||
Triggered when the subtitles are updated
|
||||
Triggered after subtitles are updated
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -614,7 +621,7 @@ art.on('subtitleAfterUpdate', (cues) => {
|
||||
|
||||
## `subtitleLoad`
|
||||
|
||||
Triggered when the subtitle loads
|
||||
Triggered when subtitles are loaded
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -634,7 +641,7 @@ art.on('subtitleLoad', (option, cues) => {
|
||||
|
||||
## `info`
|
||||
|
||||
Triggered when the information panel is shown or hidden
|
||||
Triggered when the info panel is shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -648,9 +655,10 @@ art.on('info', (state) => {
|
||||
console.log(state);
|
||||
});
|
||||
```
|
||||
|
||||
## `layer`
|
||||
|
||||
Triggered when a custom layer is shown or hidden
|
||||
Triggered when custom layers are shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -667,7 +675,7 @@ art.on('layer', (state) => {
|
||||
|
||||
## `loading`
|
||||
|
||||
Triggered when a loader is shown or hidden
|
||||
Triggered when the loading indicator is shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -684,7 +692,7 @@ art.on('loading', (state) => {
|
||||
|
||||
## `mask`
|
||||
|
||||
Triggered when a mask layer is shown or hidden
|
||||
Triggered when the mask layer is shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -714,11 +722,10 @@ var art = new Artplayer({
|
||||
art.on('subtitle', (state) => {
|
||||
console.log(state);
|
||||
});
|
||||
```
|
||||
|
||||
## `contextmenu`
|
||||
|
||||
Triggered when the right-click menu is shown or hidden
|
||||
Triggered when the context menu is shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -735,7 +742,7 @@ art.on('contextmenu', (state) => {
|
||||
|
||||
## `control`
|
||||
|
||||
Triggered when the controller is shown or hidden
|
||||
Triggered when the controls are shown or hidden
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -787,7 +794,7 @@ art.on('muted', (state) => {
|
||||
|
||||
## `keydown`
|
||||
|
||||
Listen to the `keydown` event from `document`
|
||||
Listens for the `keydown` event from `document`
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -804,11 +811,11 @@ art.on('keydown', (event) => {
|
||||
|
||||
## `video:canplay`
|
||||
|
||||
The browser can play the media file, but estimates there is not enough data to play through to the end without having to stop for further buffering
|
||||
The browser can start playing the media, but estimates that there isn't enough data to play through to the end without having to stop for further buffering
|
||||
|
||||
## `video:canplaythrough`
|
||||
|
||||
The browser estimates it can play the media through to the end without stopping for content buffering
|
||||
The browser estimates it can play the media through to the end without having to stop for buffering
|
||||
|
||||
## `video:complete`
|
||||
|
||||
@@ -820,15 +827,15 @@ Triggered when the value of the duration property changes
|
||||
|
||||
## `video:emptied`
|
||||
|
||||
The media content becomes empty; for example, when this media has been completely loaded (or partially loaded), this event is sent and the load() method is called to reload it
|
||||
The media has become empty; for example, this event is sent when the media has already been loaded (or partially loaded), and the load() method is called to reload it
|
||||
|
||||
## `video:ended`
|
||||
|
||||
The video has stopped because the media reached the end point
|
||||
Playback has stopped because the media has reached its end point
|
||||
|
||||
## `video:error`
|
||||
|
||||
An error occurred while fetching media data, or the resource type is not a supported media format
|
||||
An error occurred while fetching the media data, or the resource type is not a supported media format
|
||||
|
||||
## `video:loadeddata`
|
||||
|
||||
@@ -844,15 +851,15 @@ Playback has been paused
|
||||
|
||||
## `video:play`
|
||||
|
||||
Playback has started
|
||||
Playback has begun
|
||||
|
||||
## `video:playing`
|
||||
|
||||
Playback is ready to start following a pause or delay due to lack of data
|
||||
Playback is ready to start after having been paused or delayed due to lack of data
|
||||
|
||||
## `video:progress`
|
||||
|
||||
Periodically triggered while the browser is loading resources
|
||||
Fired periodically as the browser loads the resource
|
||||
|
||||
## `video:ratechange`
|
||||
|
||||
@@ -860,15 +867,15 @@ The playback rate has changed
|
||||
|
||||
## `video:seeked`
|
||||
|
||||
A seek (frame skipping) operation has completed
|
||||
A seek operation has completed
|
||||
|
||||
## `video:seeking`
|
||||
|
||||
A seek (frame skipping) operation has started
|
||||
A seek operation has begun
|
||||
|
||||
## `video:stalled`
|
||||
|
||||
The user agent is trying to fetch media data, but the data unexpectedly has not appeared
|
||||
The user agent is trying to fetch media data, but data is unexpectedly not forthcoming
|
||||
|
||||
## `video:suspend`
|
||||
|
||||
@@ -876,11 +883,12 @@ Media data loading has been suspended
|
||||
|
||||
## `video:timeupdate`
|
||||
|
||||
The time specified by the currentTime attribute has changed
|
||||
The time indicated by the currentTime attribute has been updated
|
||||
|
||||
## `video:volumechange`
|
||||
|
||||
Volume changed
|
||||
The volume has changed
|
||||
|
||||
## `video:waiting`
|
||||
|
||||
Playback has stopped due to temporarily missing data
|
||||
Playback has stopped because of a temporary lack of data
|
||||
Reference in new issue
Block a user