0%
Posted inNumérique

Development of referrer plugin

d71a876ab463922f105d212d0610fe9980892118 Development of referrer plugin

for context the referrer feature means that a user can add domains while uploading a video. And if this option is selected embedded videos will only play if the video is embedded in on of the domains added by the user.

I will be working on the « access through referrer » feature from now on. I have already spent some time getting familiar with the documentation and codebase of PeerTube. As suggested by you, in one of the emails, I am trying to implement this feature using a pluggin. I already have a general layout for the plugin that I think will work great for this feature. My general design involves an extra field added to the video-edit page where multiple domains/urls can be typed. These will be stored with the video and can be used on ‹ action:video-watch.init › to verify if the video should be loaded when comparing these stored domains to the current domain.

For the video-edit page I have already made the input field and stored the domains with the video. However I would like to add an extra option to the privacy dropdown to enable this feature. Something called « referrer ».

So my first question is how I can edit existing options within peertube using a plugin. All information I could find was about adding new fields not changing existing fields.

Besides this I am also having quite some trouble developing new features. I understand the usage of the hooks to trigger my own code but I am unsure how I should know what objects I have available at the time of the hook firing. So for example during « action:video-watch.player.loaded » there are at least these three objects (player, videojs, video) that can be used to influence peertubes behaviour. But so far I have been unable to find what objects are available for each hook or what objects even exists for this purpose. Should I be cross-referencing the peertube source code to find this out? Or am I missing something obvious?

Timo Boer

Source


Laisser un commentaire