diff options
Diffstat (limited to 'support/doc')
-rw-r--r-- | support/doc/plugins/guide.md | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index e30d95fc9..81999bf32 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md | |||
@@ -15,7 +15,7 @@ | |||
15 | - [Add custom routes](#add-custom-routes) | 15 | - [Add custom routes](#add-custom-routes) |
16 | - [Add external auth methods](#add-external-auth-methods) | 16 | - [Add external auth methods](#add-external-auth-methods) |
17 | - [Add new transcoding profiles](#add-new-transcoding-profiles) | 17 | - [Add new transcoding profiles](#add-new-transcoding-profiles) |
18 | - [Helpers](#helpers) | 18 | - [Server helpers](#server-helpers) |
19 | - [Client API (themes & plugins)](#client-api-themes--plugins) | 19 | - [Client API (themes & plugins)](#client-api-themes--plugins) |
20 | - [Plugin static route](#plugin-static-route) | 20 | - [Plugin static route](#plugin-static-route) |
21 | - [Notifier](#notifier) | 21 | - [Notifier](#notifier) |
@@ -26,6 +26,7 @@ | |||
26 | - [Get server config](#get-server-config) | 26 | - [Get server config](#get-server-config) |
27 | - [Add custom fields to video form](#add-custom-fields-to-video-form) | 27 | - [Add custom fields to video form](#add-custom-fields-to-video-form) |
28 | - [Register settings script](#register-settings-script) | 28 | - [Register settings script](#register-settings-script) |
29 | - [HTML placeholder elements](#html-placeholder-elements) | ||
29 | - [Publishing](#publishing) | 30 | - [Publishing](#publishing) |
30 | - [Write a plugin/theme](#write-a-plugintheme) | 31 | - [Write a plugin/theme](#write-a-plugintheme) |
31 | - [Clone the quickstart repository](#clone-the-quickstart-repository) | 32 | - [Clone the quickstart repository](#clone-the-quickstart-repository) |
@@ -424,7 +425,7 @@ async function register ({ | |||
424 | During live transcode input options are applied once for each target resolution. | 425 | During live transcode input options are applied once for each target resolution. |
425 | Plugins are responsible for detecting such situation and applying input options only once if necessary. | 426 | Plugins are responsible for detecting such situation and applying input options only once if necessary. |
426 | 427 | ||
427 | ### Helpers | 428 | #### Server helpers |
428 | 429 | ||
429 | PeerTube provides your plugin some helpers. For example: | 430 | PeerTube provides your plugin some helpers. For example: |
430 | 431 | ||
@@ -628,6 +629,21 @@ async function register ({ registerSettingsScript }) { | |||
628 | } | 629 | } |
629 | ``` | 630 | ``` |
630 | 631 | ||
632 | #### HTML placeholder elements | ||
633 | |||
634 | PeerTube provides some HTML id so plugins can easily insert their own element: | ||
635 | |||
636 | ``` | ||
637 | async function register (...) { | ||
638 | const elem = document.createElement('div') | ||
639 | elem.className = 'hello-world-h4' | ||
640 | elem.innerHTML = '<h4>Hello everybody! This is an element next to the player</h4>' | ||
641 | |||
642 | document.getElementById('plugin-placeholder-player-next').appendChild(elem) | ||
643 | } | ||
644 | ``` | ||
645 | |||
646 | See the complete list on https://docs.joinpeertube.org/api-plugins | ||
631 | 647 | ||
632 | ### Publishing | 648 | ### Publishing |
633 | 649 | ||