Add other hooks to hello world plugin

This commit is contained in:
Chocobozzz
2020-08-21 14:45:18 +02:00
parent 76bd650ad0
commit 47a4d19252
4 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,12 @@
function register ({ registerHook, peertubeHelpers }) {
registerHook({
target: 'action:embed.player.loaded',
handler: () => alert('video loaded')
})
console.log(peertubeHelpers.translate('toto'))
}
export {
register
}

View File

@ -0,0 +1,20 @@
function register ({ registerVideoField }) {
console.log('loading video edit stuff')
{
const commonOptions = {
name: 'hello-world-field',
label: 'Super field',
type: 'input',
default: 'hello'
}
for (const type of [ 'upload', 'import-url', 'update' ]) {
registerVideoField(commonOptions, { type })
}
}
}
export {
register
}