How to Automatically Unlock Password Protected Videos for Specific Users?

Hello PeerTube community. This is my first post on this forum, so please be kind to me. I have tried to follow all the guidelines.

My Question

Is it possible to automatically unlock password protected videos for specific users on PeerTube (is such logic implemented and how can I use it)? If not, what would be the best approach to achieve such functionality?

Some Background

Since PeerTube v6 it is possible to password protect videos. This is a great feature and I want to make a business model out of it in the sense that I want to make some premium content available to some users before everyone gets it a week later. I know that I can set as many video passwords as I want using the REST API. This allows me to deauthenticate non-paying accounts by setting and updating video passwords on a per-user basis. I also know there’s the embed API, but I’m not entirely sure if that’s necessary if I’m not embedding, but using my PeerTube instance directly.

With all that said, let me get back to my question: With video passwords set via the REST API, how can I automatically unlock videos for specific users? In other words, can I automatically share video passwords with users?

Docs

Hi,

Only moderators can access password protected videos without the password. So I think the best way to handle your use case is to use the REST API and the Embed API. You can also try to develop a plugin, I know there are some of them trying to deal with premium content like https://www.npmjs.com/package/peertube-plugin-premium-users (but I have not tested it).

1 « J'aime »

Thanks for your reply. I checked out the plugin. However, I am not quite sure how to manage premium (password protected) videos within PeerTube. My follow-up questions are:

  1. How is a password protected video displayed to users before they enter the video password? Are the thumbnail, title and description visible? Are they blurred?
  2. How is the embed API used within the PeerTube instance interface? Is the embed API part of a default PeerTube instance?

They are not visible

Yes, it’s part of PeerTube. See: PeerTube Embed API | PeerTube documentation

1 « J'aime »

I am familiar with the Embed API documentation. My question is, how do I use it? If I deploy PeerTube, how do I use it? Do I need to run a second application or do I add code to PeerTube before deploying the Docker setup?

The embed API is meant to be used on another website that embeds PeerTube videos to communicate and manage the video :slight_smile:

1 « J'aime »

There is no way to enable such a feature directly on the PeerTube instance player?

Hum I don’t think so. Can you detail how you would imagine your use case? We can add some plugin features in PeerTube if it can help

Thanks for your reply! Let me describe and clarify what I am looking for. I really like the design and features of the PeerTube instance (playlists, live streams, thumbnails, different quality levels, etc.). What I would like to have is a way to control premium content so that you can see the thumbnail, maybe even play a teaser (20 seconds of the video). But then a user needs to be authenticated to access the full video. Maybe PeerTube is not what I am looking for, are there other alternatives?

Thanks! PeerTube cannot handle this specific use case in its official client. But you can create another website that would embed PeerTube videos and unblock them depending on the user subscription using the password API :slight_smile:

1 « J'aime »