Skip to main content

Rotate DRM Key

Moves a DRM protected stream to its next content key. The stream picks the key up where the next segment of each track starts, so nothing is cut and viewers keep playing across the change.

The stream has to state a <KeyRotationPeriod> in the DRM info file. Stating 0 there asks for a stream that changes its key only through this API, while a period above 0 also changes it on its own and this API moves it on in between. A stream that has one key, or whose entry leaves the element out, keeps the key it has and says so in the server log.

Request

POST v1/vhosts/{vhost}/apps/{app}/streams/{stream}:rotateDrmKey
Authorization: Basic {credentials}

# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>

Body

{}

Responses

200 Ok

The request has succeeded

Header

Content-Type: application/json

Body

{
"statusCode": 200,
"message": "OK"
}

# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
"message": "[HTTP] Authorization header is required to call API (401)",
"statusCode": 401
}
404 Not Found

The given vhost name, app name or stream name could not be found.

Body

{
"statusCode": 404,
"message": "Could not find stream: [default/app/non-exists] (404)"
}
500 Internal Server Error

The stream could not be told to rotate its key.

Body

{
"statusCode": 500,
"message": "Internal Server Error - Could not inject RotateDrmKey event: [default/app/stream] (500)"
}