Skip to main content

Player

The Elastic Encoder Player enables visualization of processed content. The Player is an HTML5 application that can be embedded in a web or native application.

Programming Interface (APIs)

JWT request for access

Make an authenticated POST request command in /api/auth

POST https://api.elasticencoder.videolib.live/dev/auth

Headers to GET for /api/asset.

Header                          Value
Ocp-Apim-Subscription-Key microservice authorization key.
Content-Type application/json.

In the body of the request, send the JSON below:

{
"app":"application", // Application code (submitted for activation)
"key":"key",// Authentication key (sent for activation)
"userName":"User ID", // Source System User ID - Audience ID
"name":"Username", // Source System Username - Audience ID
"group":"100", // (Optional) Source System Group ID - Audience ID
"email":"uusuario@email.com.br", // (optional) email of the user from the source system - audience ID
"documentId":"Document Number - ex: cpf", // (optional) source system user document
"department":"Department Name", // (optional) Source System User Department
"timeoutMinutes":"20" // Token duration time
}

As a return of the command, the following JSON will be generated:

{
"token":"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyTmFtZSI6ImlkVXN1YXJvIiwibmFtZSI6Ik5vbWUgVXN1YXJpbyIsImRhdGFUb2tlbiI6IjIwMjQtMDEtMjdUMjI6MjI6MjcuOTI0NzU1LTAzOjAwIiwiZ3JvdXAiOiIxMDAiLCJlbWFpbCI6InV1c3VhcmlvQGVtYWlsLmNvbS5iciIsImRvY3VtZW50SWQiOiJudW0gZG9jdW1lbnRvIC0gZXg6IGNwZiIsImRlcGFydG1lbnQiOiJub21lIGRlcGFydGFtZW50byIsIm1hdGNoIjoiODAyYmVjOGZkNTMxODE5MmIwYTc1IiwiaWRVc2VyUXVldWUiOiIwRTQ5RDM2ODMxNEM0NUJBMjJBQzYxRDY3MzA0MDYwREU1RDhFODE1OENBRjlFRDM4RDIyMjY1NzMwOTBDRDA4Iiwicm9sZXMiOiJHZXN0b3IifQ.yChC56edU1zmCua7sodHGVCD-rrMp5SCeIerkeK2llI",
"dataToken":"2024-01-27T22:22:27.924755-03:00",
"userName":"User ID",
"name":"Username"
,"tokenType":"jwt",
"idUserQueue":"0E49D368314C45BA22AC61D67304060DE5D8E8158CAF9ED38D2226573090CD08",
"group":"100",
"roles":"",
"email":"uusuario@email.com.br",
"documentId":"Document Number - ex: cpf",
"department":"Department Name",
"status_ret":null,
"erro":null
}

where the token field corresponds to the authentication key that will be used in the jwt field in the player's opening route.

To watch a video

To watch a content, you should use the URL below, passing two parameters: the JWT key and the name of the original stored asset.

Example:
https://player.elasticencoder.videolib.live/player?token=mezanino-1&jwt=eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyTmFtZSI6ImlkVXN1YXJvIiwibmFtZSI6Ik5vbWUgVXN1YXJpbyIsImRhdGFUb2tlbiI6IjIwMjQtMDEtMjdUMjI6MjI6MjcuOTI0NzU1LTAzOjAwIiwiZ3JvdXAiOiIxMDAiLCJlbWFpbCI6InV1c3VhcmlvQGVtYWlsLmNvbS5iciIsImRvY3VtZW50SWQiOiJudW0gZG9jdW1lbnRvIC0gZXg6IGNwZiIsImRlcGFydG1lbnQiOiJub21lIGRlcGFydGFtZW50byIsIm1hdGNoIjoiODAyYmVjOGZkNTMxODE5MmIwYTc1IiwiaWRVc2VyUXVldWUiOiIwRTQ5RDM2ODMxNEM0NUJBMjJBQzYxRDY3MzA0MDYwREU1RDhFODE1OENBRjlFRDM4RDIyMjY1NzMwOTBDRDA4Iiwicm9sZXMiOiJHZXN0b3IifQ.yChC56edU1zmCua7sodHGVCD-rrMp5SCeIerkeK2llI

Where:

Player Url: 
https://player.elasticencoder.videolib.live/player

Parameters:
token: Name given to the original file asset
jwt: key generated in the auth API call (explained at the start of the session)

Player Videolib