Videos on api.video can be tagged public or private.

By default, all videos uploaded have the public attribute set to “true.” This means that anyone with the video url can watch the video. If you’d like to make your videos private, simply toggle public to false, and each video will be served with a unique token good for one viewing.

Public videos at api.video have the format:

https://embed.api.video/vod/vi5gpofvrrzjNSdiOiMWYItj3

The value after VOD is the videoId. Anyone with this link can watch this video.

What if we set the video to private? Well, first off, the URL format looks different:

https://embed.api.video/vod/vitkytkieTnEvUjKE0VQpd2?token=c259790d-352b-46c3-b0d0-f5d043adefc11

This video can be watched by exactly one user. Once it is viewed, the token is invalid, and the link will throw a 404 error (and the player will say “video not available.” This token is valid for the browser window session.

The second part of this is that the user must re-authenticate to watch again. You can use the api.video analytics to determine if the user has watched the video. Use our dynamic metadata 3 to tag the session with your user’s ID.

When you authenticate the user - you can check “has userX watched this video?” If no results come back - then you can obtain the private video URL. If results come back - then your business logic can decide if they watched enough to block them for a 2nd view.

We do have many users using private videos in their applications with great success.

You can check out this great tutorial on how to handle private videos: https://api.video/blog/tutorials/tutorial-private-videos

Did this answer your question?