diff --git a/docs/assets/example/chapter.js b/docs/assets/example/chapter.js
new file mode 100644
index 000000000..be7841496
--- /dev/null
+++ b/docs/assets/example/chapter.js
@@ -0,0 +1,12 @@
+// npm i artplayer-plugin-chapter
+// import artplayerPluginChapter from 'artplayer-plugin-chapter';
+
+var art = new Artplayer({
+ container: '.artplayer-app',
+ url: '/assets/sample/video.mp4',
+ plugins: [
+ artplayerPluginChapter({
+ //
+ }),
+ ],
+});
\ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index fd520c6a1..08ec09c40 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -65,6 +65,10 @@
artplayer-plugin-vast
+
+ artplayer-plugin-chapter
+
- Library
diff --git a/packages/artplayer-plugin-chapter/README.md b/packages/artplayer-plugin-chapter/README.md
new file mode 100644
index 000000000..e5bfba426
--- /dev/null
+++ b/packages/artplayer-plugin-chapter/README.md
@@ -0,0 +1,11 @@
+# artplayer-plugin-chapter
+
+chapter plugin for ArtPlayer
+
+## Demo
+
+[https://artplayer.org](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-chapter/index.js&example=chapter)
+
+## License
+
+MIT © Harvey Zack
diff --git a/packages/artplayer-plugin-chapter/package.json b/packages/artplayer-plugin-chapter/package.json
new file mode 100644
index 000000000..18bd88fcb
--- /dev/null
+++ b/packages/artplayer-plugin-chapter/package.json
@@ -0,0 +1,24 @@
+{
+ "license": "MIT",
+ "version": "1.0.0",
+ "name": "artplayer-plugin-chapter",
+ "types": "types/artplayer-plugin-chapter.d.ts",
+ "description": "chapter plugin for ArtPlayer",
+ "main": "dist/artplayer-plugin-chapter.js",
+ "legacy": "dist/artplayer-plugin-chapter.legacy.js",
+ "author": "Harvey Zack ",
+ "browserslist": "last 1 Chrome version",
+ "homepage": "https://artplayer.org",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/zhw2590582/ArtPlayer.git"
+ },
+ "bugs": {
+ "url": "https://github.com/zhw2590582/ArtPlayer/issues"
+ },
+ "keywords": [
+ "html5",
+ "video",
+ "player"
+ ]
+}
diff --git a/packages/artplayer-plugin-chapter/src/index.js b/packages/artplayer-plugin-chapter/src/index.js
new file mode 100644
index 000000000..df6b52a9b
--- /dev/null
+++ b/packages/artplayer-plugin-chapter/src/index.js
@@ -0,0 +1,26 @@
+import style from 'bundle-text:./style.less';
+
+export default function artplayerPluginChapter(option) {
+ return (art) => {
+ return {
+ name: 'artplayerPluginChapter',
+ };
+ };
+}
+
+if (typeof document !== 'undefined') {
+ const id = 'artplayer-plugin-chapter';
+ const $style = document.getElementById(id);
+ if ($style) {
+ $style.textContent = style;
+ } else {
+ const $style = document.createElement('style');
+ $style.id = id;
+ $style.textContent = style;
+ document.head.appendChild($style);
+ }
+}
+
+if (typeof window !== 'undefined') {
+ window['artplayerPluginChapter'] = artplayerPluginChapter;
+}
diff --git a/packages/artplayer-plugin-chapter/src/style.less b/packages/artplayer-plugin-chapter/src/style.less
new file mode 100644
index 000000000..cd3289e27
--- /dev/null
+++ b/packages/artplayer-plugin-chapter/src/style.less
@@ -0,0 +1,3 @@
+.artplayer-plugin-chapter {
+ //
+}
diff --git a/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts b/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts
new file mode 100644
index 000000000..53666ece5
--- /dev/null
+++ b/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts
@@ -0,0 +1,14 @@
+import type Artplayer from 'artplayer';
+
+export = artplayerPluginChapter;
+export as namespace artplayerPluginChapter;
+
+type Option = {
+ //
+};
+
+type Result = {
+ name: 'artplayerPluginChapter';
+};
+
+declare const artplayerPluginChapter: (option: Option) => (art: Artplayer) => Result;
diff --git a/packages/artplayer-vitepress/docs/.vitepress/config.js b/packages/artplayer-vitepress/docs/.vitepress/config.js
index b236487b0..3bba88eb2 100644
--- a/packages/artplayer-vitepress/docs/.vitepress/config.js
+++ b/packages/artplayer-vitepress/docs/.vitepress/config.js
@@ -74,7 +74,8 @@ const config = {
{ text: '多重字幕', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-multiple-subtitles/index.js&example=multiple.subtitles'},
{ text: 'Ass 字幕', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-libass/index.js&example=libass'},
{ text: 'Chromecast', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-chromecast/index.js&example=chromecast'},
- { text: 'Vast', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-vast/index.js&example=vast'},
+ { text: 'Vast 广告', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-vast/index.js&example=vast'},
+ { text: '视频章节', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-chapter/index.js&example=chapter'},
]
},
{
@@ -133,7 +134,8 @@ const config = {
{ text: 'Multiple Subtitles', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-multiple-subtitles/index.js&example=multiple.subtitles'},
{ text: 'Ass Subtitle', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-libass/index.js&example=libass'},
{ text: 'Chromecast', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-chromecast/index.js&example=chromecast'},
- { text: 'Vast', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-vast/index.js&example=vast'},
+ { text: 'Vast', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-vast/index.js&example=vast'},
+ { text: 'Video Chapters', link: 'https://artplayer.org/?libs=./uncompiled/artplayer-plugin-chapter/index.js&example=chapter'},
]
},
{