mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 12:01: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
@@ -2,16 +2,16 @@
|
||||
|
||||
## Configuration
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------- | ------------------- | ----------------------------|
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique name of the component, used for marking the class name |
|
||||
| `index` | `Number` | Component index, used for display priority |
|
||||
| `html` | `String`, `Element` | The DOM element of the component |
|
||||
| `style` | `Object` | Style object for the component |
|
||||
| `click` | `Function` | Click event for the component |
|
||||
| `mounted` | `Function` | Triggered after the component is mounted |
|
||||
| `tooltip` | `String` | Tooltip text for the component |
|
||||
| Property | Type | Description |
|
||||
| --------- | ------------------- | ------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique component name for CSS class |
|
||||
| `index` | `Number` | Component index for display priority |
|
||||
| `html` | `String`, `Element` | Component DOM element |
|
||||
| `style` | `Object` | Component style object |
|
||||
| `click` | `Function` | Component click event |
|
||||
| `mounted` | `Function` | Triggered after component mount |
|
||||
| `tooltip` | `String` | Component tooltip text |
|
||||
|
||||
## Creation
|
||||
|
||||
@@ -38,7 +38,8 @@ art.contextmenu.show = true;
|
||||
// Get the Element of contextmenu by name
|
||||
console.info(art.contextmenu['your-menu']);
|
||||
```
|
||||
## Add
|
||||
|
||||
## Addition
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -63,7 +64,7 @@ art.contextmenu.show = true;
|
||||
console.info(art.contextmenu['your-menu']);
|
||||
```
|
||||
|
||||
## Delete
|
||||
## Removal
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -87,13 +88,13 @@ art.contextmenu.show = true;
|
||||
|
||||
art.on('ready', () => {
|
||||
setTimeout(() => {
|
||||
// Delete the context menu by name
|
||||
// Delete the contextmenu by name
|
||||
art.contextmenu.remove('your-menu')
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
|
||||
## Updates
|
||||
## Update
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -123,5 +124,4 @@ art.on('ready', () => {
|
||||
html: 'Your New Menu',
|
||||
})
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
});
|
||||
@@ -1,20 +1,20 @@
|
||||
# Controller
|
||||
# Controllers
|
||||
|
||||
## Configuration
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | The unique name of the component for class identification |
|
||||
| `index` | `Number` | The index of the component, used for display priority |
|
||||
| `html` | `String`, `Element` | The component's DOM element |
|
||||
| `style` | `Object` | The style object for the component |
|
||||
| `click` | `Function` | Component click event |
|
||||
| `mounted` | `Function` | Triggered after the component is mounted |
|
||||
| `tooltip` | `String` | Tooltip text for the component |
|
||||
| `position` | `String` | `left` and `right` control the position of the controller |
|
||||
| `selector` | `Array` | An array of objects for the selection list |
|
||||
| `onSelect` | `Function` | Function triggered when an item from the selection list is clicked |
|
||||
| Property | Type | Description |
|
||||
| ----------- | ------------------- | ------------------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique component name for CSS class identification |
|
||||
| `index` | `Number` | Component index for display priority |
|
||||
| `html` | `String`, `Element` | Component DOM element |
|
||||
| `style` | `Object` | Component style object |
|
||||
| `click` | `Function` | Component click event |
|
||||
| `mounted` | `Function` | Triggered after component mounting |
|
||||
| `tooltip` | `String` | Component tooltip text |
|
||||
| `position` | `String` | `left` and `right` control controller placement |
|
||||
| `selector` | `Array` | Array of selector list objects |
|
||||
| `onSelect` | `Function` | Function triggered when selector item is clicked |
|
||||
|
||||
## Creation
|
||||
|
||||
@@ -66,7 +66,8 @@ var art = new Artplayer({
|
||||
console.info(art.controls['your-button']);
|
||||
console.info(art.controls['subtitle']);
|
||||
```
|
||||
## Adding
|
||||
|
||||
## Addition
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -96,7 +97,8 @@ art.controls.add({
|
||||
// Get the Element of control by name
|
||||
console.info(art.controls['button1']);
|
||||
```
|
||||
## Delete
|
||||
|
||||
## Removal
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -125,6 +127,7 @@ art.on('ready', () => {
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
|
||||
## Update
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
@@ -171,5 +174,4 @@ art.on('ready', () => {
|
||||
],
|
||||
});
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
});
|
||||
@@ -1,17 +1,17 @@
|
||||
# Layer
|
||||
# Business Layer
|
||||
|
||||
## Configuration
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------- | --------------------- | ---------------------------- |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique name of the component, used for marking class name |
|
||||
| `index` | `Number` | Component index, used for display priority |
|
||||
| `html` | `String`, `Element` | The DOM element of the component |
|
||||
| `style` | `Object` | Style object for the component |
|
||||
| `click` | `Function` | Click event for the component |
|
||||
| `mounted` | `Function` | Triggered after the component is mounted |
|
||||
| `tooltip` | `String` | Tooltip text for the component |
|
||||
| Property | Type | Description |
|
||||
| --------- | ------------------- | ------------------------------------ |
|
||||
| `disable` | `Boolean` | Whether to disable the component |
|
||||
| `name` | `String` | Unique component name for class marking |
|
||||
| `index` | `Number` | Component index for display priority |
|
||||
| `html` | `String`, `Element` | Component DOM element |
|
||||
| `style` | `Object` | Component style object |
|
||||
| `click` | `Function` | Component click event |
|
||||
| `mounted` | `Function` | Triggered after component mounting |
|
||||
| `tooltip` | `String` | Component tooltip text |
|
||||
|
||||
## Creation
|
||||
|
||||
@@ -24,9 +24,9 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'poster',
|
||||
name: 'potser',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
tooltip: 'Poster Tip',
|
||||
tooltip: 'Potser Tip',
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50px',
|
||||
@@ -43,9 +43,10 @@ var art = new Artplayer({
|
||||
});
|
||||
|
||||
// Get the Element of layer by name
|
||||
console.info(art.layers['poster']);
|
||||
console.info(art.layers['potser']);
|
||||
```
|
||||
## Add
|
||||
|
||||
## Addition
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -57,9 +58,9 @@ var art = new Artplayer({
|
||||
});
|
||||
|
||||
art.layers.add({
|
||||
name: 'poster',
|
||||
name: 'potser',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
tooltip: 'Poster Tip',
|
||||
tooltip: 'Potser Tip',
|
||||
style: {
|
||||
position: 'absolute',
|
||||
top: '50px',
|
||||
@@ -74,9 +75,10 @@ art.layers.add({
|
||||
});
|
||||
|
||||
// Get the Element of layer by name
|
||||
console.info(art.layers['poster']);
|
||||
console.info(art.layers['potser']);
|
||||
```
|
||||
## Delete
|
||||
|
||||
## Removal
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -87,7 +89,7 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'poster',
|
||||
name: 'potser',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
@@ -101,10 +103,11 @@ var art = new Artplayer({
|
||||
art.on('ready', () => {
|
||||
setTimeout(() => {
|
||||
// Delete the layer by name
|
||||
art.layers.remove('poster');
|
||||
art.layers.remove('potser');
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
|
||||
## Update
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
@@ -116,7 +119,7 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
layers: [
|
||||
{
|
||||
name: 'poster',
|
||||
name: 'potser',
|
||||
html: `<img style="width: 100px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
@@ -131,7 +134,7 @@ art.on('ready', () => {
|
||||
setTimeout(() => {
|
||||
// Update the layer by name
|
||||
art.layers.update({
|
||||
name: 'poster',
|
||||
name: 'potser',
|
||||
html: `<img style="width: 200px" src="${img}">`,
|
||||
style: {
|
||||
position: 'absolute',
|
||||
@@ -140,5 +143,4 @@ art.on('ready', () => {
|
||||
},
|
||||
});
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
});
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Built-in
|
||||
|
||||
First, open the settings panel, and then it comes with four built-in items: `flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`
|
||||
First, you need to open the settings panel. It comes with four built-in items: `flip`, `playbackRate`, `aspectRatio`, `subtitleOffset`
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ First, open the settings panel, and then it comes with four built-in items: `fli
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
setting: true,
|
||||
setting: true,
|
||||
flip: true,
|
||||
playbackRate: true,
|
||||
aspectRatio: true,
|
||||
@@ -20,13 +20,13 @@ var art = new Artplayer({
|
||||
|
||||
## Create - Button
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------- |
|
||||
| `html` | `String`, `Element` | Item DOM |
|
||||
| `icon` | `String`, `Element` | Item Icon |
|
||||
| `onClick` | `Function` | Click event |
|
||||
| `width` | `Number` | List Width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | Element DOM |
|
||||
| `icon` | `String`, `Element` | Element icon |
|
||||
| `onClick` | `Function` | Element click event |
|
||||
| `width` | `Number` | List width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -49,16 +49,16 @@ var art = new Artplayer({
|
||||
});
|
||||
```
|
||||
|
||||
## Create - Selection List
|
||||
## Create - Selector List
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------- |
|
||||
| `html` | `String`, `Element` | Item DOM |
|
||||
| `icon` | `String`, `Element` | Item Icon |
|
||||
| `selector` | `Array` | Item selector |
|
||||
| `onSelect` | `Function` | Click event |
|
||||
| `width` | `Number` | List Width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | -------------------- |
|
||||
| `html` | `String`, `Element` | Element DOM |
|
||||
| `icon` | `String`, `Element` | Element icon |
|
||||
| `selector` | `Array` | Element list |
|
||||
| `onSelect` | `Function` | Element click event |
|
||||
| `width` | `Number` | List width |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -118,7 +118,7 @@ var art = new Artplayer({
|
||||
});
|
||||
```
|
||||
|
||||
## Creating - Nested Lists
|
||||
## Create - Nested List
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -167,16 +167,16 @@ var art = new Artplayer({
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Create - Toggle Button
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ---------------------- |
|
||||
| `html` | `String`, `Element` | Element's DOM element |
|
||||
| `icon` | `String`, `Element` | Element's icon |
|
||||
| `switch` | `Boolean` | Button's default state |
|
||||
| `onSwitch` | `Function` | Button toggle event |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element of the item |
|
||||
| `icon` | `String`, `Element` | Icon of the item |
|
||||
| `switch` | `Boolean` | Default state of the button |
|
||||
| `onSwitch` | `Function` | Button toggle event |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -202,16 +202,17 @@ var art = new Artplayer({
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Create - Range Slider
|
||||
|
||||
| Attribute | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------------- |
|
||||
| `html` | `String`, `Element` | The element's DOM element |
|
||||
| `icon` | `String`, `Element` | The element's icon |
|
||||
| `range` | `Array` | Default state array |
|
||||
| `onRange` | `Function` | Event triggered upon completion |
|
||||
| `onChange` | `Function` | Event triggered on change |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
| Property | Type | Description |
|
||||
| ---------- | ------------------- | ------------------------- |
|
||||
| `html` | `String`, `Element` | DOM element of the item |
|
||||
| `icon` | `String`, `Element` | Icon of the item |
|
||||
| `range` | `Array` | Default state array |
|
||||
| `onRange` | `Function` | Event triggered on completion |
|
||||
| `onChange` | `Function` | Event triggered on change |
|
||||
| `tooltip` | `String` | Tooltip text |
|
||||
|
||||
```js
|
||||
const range = [5, 1, 10, 1];
|
||||
@@ -220,6 +221,7 @@ const min = range[1];
|
||||
const max = range[2];
|
||||
const step = range[3];
|
||||
```
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
```js
|
||||
@@ -241,6 +243,7 @@ var art = new Artplayer({
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## Add
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
@@ -262,7 +265,7 @@ art.setting.add({
|
||||
});
|
||||
```
|
||||
|
||||
## Delete
|
||||
## Remove
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -292,7 +295,8 @@ art.on('ready', () => {
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
## Updates
|
||||
|
||||
## Update
|
||||
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
@@ -325,5 +329,4 @@ art.on('ready', () => {
|
||||
switch: false,
|
||||
});
|
||||
}, 3000);
|
||||
});
|
||||
```
|
||||
});
|
||||
Reference in new issue
Block a user