diff --git a/peertube-plugin-hello-world/client/video-watch-client-plugin.js b/peertube-plugin-hello-world/client/video-watch-client-plugin.js index 9d77625..008fefc 100644 --- a/peertube-plugin-hello-world/client/video-watch-client-plugin.js +++ b/peertube-plugin-hello-world/client/video-watch-client-plugin.js @@ -35,6 +35,16 @@ function register ({ registerHook, peertubeHelpers }) { return result } }) + + registerHook({ + target: 'filter:internal.video-watch.player.build-options.result', + handler: (result, params) => { + console.log('Running player build options hook for video %s.', params.video.name) + result.playerOptions.common.inactivityTimeout = 10000 + + return result + } + }) } export { diff --git a/peertube-plugin-hello-world/main.js b/peertube-plugin-hello-world/main.js index 7da2f01..c47d0f9 100644 --- a/peertube-plugin-hello-world/main.js +++ b/peertube-plugin-hello-world/main.js @@ -19,6 +19,19 @@ async function register ({ handler: () => console.log('fake hook') }) + registerHook({ + target: 'filter:api.user.signup.allowed.result', + handler: (result, params) => { + if (result.allowed === false) return result + + if (params && params.body.email.includes('laposte.net')) { + return { allowed: false, errorMessage: 'laposte.net emails are not allowed on this instance' } + } + + return result + } + }) + registerSetting({ name: 'admin-name', label: 'Admin name', diff --git a/peertube-plugin-hello-world/package.json b/peertube-plugin-hello-world/package.json index a97b111..86c2260 100644 --- a/peertube-plugin-hello-world/package.json +++ b/peertube-plugin-hello-world/package.json @@ -1,6 +1,6 @@ { "name": "peertube-plugin-hello-world", - "version": "0.0.13", + "version": "0.0.14", "description": "Hello world PeerTube plugin example", "engine": { "peertube": ">=1.3.0"