Skip to main content

Introduction

In this guide, we'll explain how you can manage access to your videos on the Wavestream platform using the accessType attribute in your video model, which allows you to define your video as public or private.

Understanding the accessType Attribute

Each video on Wavestream has an attribute called accessType. This attribute controls the accessibility of your video and can take two possible values: public or private.

accessType:
type: string
description: define the accessType of the video, if private the video URI can only be accessed with a signed url
enum:
- public
- private
default: public

By default, the accessType is set to public. If you set it to private, the video URI can only be accessed with a signed URL.

Updating Video accessType

To update the accessType of a video, a PUT request should be made to the /videos/:videoId endpoint. Here's an example using curl:

curl -X PUT "https://api.wavestream.com/videos/:videoId" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"accessType": "private"
}'

Remember to replace :videoId with the actual ID of the video and YOUR_API_KEY with your actual API key.

Accessing Private Videos

To access a private video, the content owner must be signed in to the Wavestream platform. After that, a GET request can be made to /videos/:videoId. The response will contain the destinationUri field which carries the signed URL for the private video.

curl -X GET "https://api.wavestream.com/videos/:videoId" \
-H "x-api-key: YOUR_API_KEY"

Which will give a response similar to this:

{
"id": "xxx",
"accessType": "private",
"appId": "xxx",
"createdAt": "2023-06-02T13:27:48.480079Z",
"destinationUri": "https://a-cdn.wave.stream/bcdn_token=xxxx&expires=1686043967&token_path=%2F/private/xxxx/myfile.mp4",
...
}

The signed URL, which is present in the destinationUri field of the response, will be valid for 3 hours by default.

Custom Integrations and TTL

If you require custom integrations or need to adjust the TTL for your signed URLs, please reach out to us through our support channel. We are dedicated to ensuring your needs are met.

With this guide, you can confidently manage and control the access to your video content on the Wavestream platform.