Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/docs/assets/example/index.js b/docs/assets/example/index.js
index 762f2cb4d..cd21000db 100644
--- a/docs/assets/example/index.js
+++ b/docs/assets/example/index.js
@@ -33,16 +33,32 @@ var art = new Artplayer({
settings: [
{
width: 200,
- html: 'Custom Selector',
- tooltip: 'Click This',
- icon: '',
+ html: 'Switch Subtitle',
+ tooltip: 'Bilingual',
+ icon: '
',
selector: [
{
- default: true,
- html: 'Setting 01',
+ html: 'Display',
+ switch: true,
+ tooltip: 'Show',
+ onSwitch: function (item) {
+ item.tooltip = item.switch ? 'Hide' : 'Show';
+ art.subtitle.show = !item.switch;
+ return !item.switch;
+ },
},
{
- html: 'Setting 02',
+ default: true,
+ html: 'Bilingual',
+ url: '/assets/sample/subtitle.srt',
+ },
+ {
+ html: 'Chinese',
+ url: '/assets/sample/subtitle.cn.srt',
+ },
+ {
+ html: 'Japanese',
+ url: '/assets/sample/subtitle.jp.srt',
},
{
html: 'Setting 03',
@@ -53,7 +69,9 @@ var art = new Artplayer({
},
],
onSelect: function (item) {
- console.info('You clicked on the custom selector', item.html);
+ art.subtitle.switch(item.url, {
+ name: item.html,
+ });
return item.html;
},
},
diff --git a/docs/assets/img/subtitle.svg b/docs/assets/img/subtitle.svg
new file mode 100644
index 000000000..3a6aadf86
--- /dev/null
+++ b/docs/assets/img/subtitle.svg
@@ -0,0 +1,4 @@
+
\ No newline at end of file
diff --git a/docs/document/404.html b/docs/document/404.html
index b454875ba..54e315bd2 100644
--- a/docs/document/404.html
+++ b/docs/document/404.html
@@ -5,13 +5,13 @@
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.