]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - support/doc/plugins/guide.md
video: add video stranscoding_failed state
[github/Chocobozzz/PeerTube.git] / support / doc / plugins / guide.md
index 568c0662f8bd3eb00b27f3737c068218e291d4e2..072c7c6caebe4c9b7587c5b5e3aa550f033f9288 100644 (file)
@@ -180,6 +180,15 @@ function register (...) {
     type: 'input',
     // type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html'
 
+    // If type: 'select', give the select available options
+    options: [
+      { label: 'Label 1', value: 'value1' },
+      { label: 'Label 2', value: 'value2' }
+    ],
+
+    // If type: 'html', set the HTML that will be injected in the page
+    html: '<strong class="...">Hello</strong><br /><br />'
+
     // Optional
     descriptionHTML: 'The purpose of this field is...',
 
@@ -196,7 +205,7 @@ function register (...) {
   result['admin-name]
 
   settingsManager.onSettingsChange(settings => {
-    settings['admin-name])
+    settings['admin-name']
   })
 }
 ```
@@ -234,21 +243,29 @@ function register ({
 
 #### Update video constants
 
-You can add/delete video categories, licences or languages using the appropriate managers:
+You can add/delete video categories, licences or languages using the appropriate constant managers:
 
 ```js
-function register (...) {
-  videoLanguageManager.addLanguage('al_bhed', 'Al Bhed')
-  videoLanguageManager.deleteLanguage('fr')
+function register ({
+  videoLanguageManager,
+  videoCategoryManager,
+  videoLicenceManager,
+  videoPrivacyManager,
+  playlistPrivacyManager
+}) {
+  videoLanguageManager.addConstant('al_bhed', 'Al Bhed')
+  videoLanguageManager.deleteConstant('fr')
 
-  videoCategoryManager.addCategory(42, 'Best category')
-  videoCategoryManager.deleteCategory(1) // Music
+  videoCategoryManager.addConstant(42, 'Best category')
+  videoCategoryManager.deleteConstant(1) // Music
+  videoCategoryManager.resetConstants() // Reset to initial categories
+  videoCategoryManager.getConstants() // Retrieve all category constants
 
-  videoLicenceManager.addLicence(42, 'Best licence')
-  videoLicenceManager.deleteLicence(7) // Public domain
+  videoLicenceManager.addConstant(42, 'Best licence')
+  videoLicenceManager.deleteConstant(7) // Public domain
 
-  videoPrivacyManager.deletePrivacy(2) // Remove Unlisted video privacy
-  playlistPrivacyManager.deletePlaylistPrivacy(3) // Remove Private video playlist privacy
+  videoPrivacyManager.deleteConstant(2) // Remove Unlisted video privacy
+  playlistPrivacyManager.deleteConstant(3) // Remove Private video playlist privacy
 }
 ```