Add other hooks to hello world plugin
This commit is contained in:
		
							
								
								
									
										12
									
								
								peertube-plugin-hello-world/client/embed-client-plugin.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								peertube-plugin-hello-world/client/embed-client-plugin.js
									
									
									
									
									
										Normal 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 | ||||
| } | ||||
| @ -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 | ||||
| } | ||||
		Reference in New Issue
	
	Block a user