1. Home
  2. Docs
  3. Embedding Rali
  4. Generating Embed Links
  5. Generating the Embed Video Player

Generating the Embed Video Player

The following shows how to use the video player with your site.  The instructions can be used below to generate your own embed links to the Rali Video Player.

Conversational Video Player

The player is located at the following url:

https://rali.io/player/src

There are a few minimum http parameters that are needed for the embedded player:

URL ParamsDescription
api-key API Key, provided by Rali. See Getting Started
urlVideo URL that needs to be URL encoded
userAuthenticated user object, this is required if allow-anonymous is not set to true.  See User Object for formatting.

Example `src` attribute for an iframe using the player:

https://rali.io/player/src?api-key=334389048b872a533002b34d73f8c29fd09efc50&url=http://site-with-videos.herokuapp.com/bushes.mp4

Secured Video Player

The secured video allows for signing the data passed to the video player.  The player is located at the following url:

https://rali.io/player/src

There are a few minimum http parameters that are needed for the embedded player

URL ParamsDescription
api-key API Key, provided by Rali. See Getting Started
urlVideo URL that needs to be URL encoded
dataEncrypted JWT data

Example `src` attribute for an iframe using the player:

https://rali.io/player/src?api-key=334389048b872a533002b34d73f8c29fd09efc50&url=http://site-with-videos.herokuapp.com/bushes.mp4&data=JTdCJTIyaWQlMjIlM0ElMjJ4eHgteXl5LXp6eiUyMiUyQyUyMmRpc3BsYXlOYW1lJTIyJTNBJTIyTXIuJTIwQWRhbXMlMjIlMkMlMjJpbWFnZSUyMiUzQSUyMmh0dHBzJTNBJTJGJTJGY2RuLmZpbGVzdGFja2NvbnRlbnQuY29tJTJGU2RZY0dJZ0JRb0s1T29pamJ3YjUlMjIlN0Q=

In order to generate the JWT data, the following Rali values must be used:

API Key – ex. ONQ-XXXXXXXXXXXXXXXX
API Secret – ex. xxxxxxxxxxxxxxxxxxxxxxxxxxx

The API key and secret can be found in the Admin section of the Rali tenant. See Getting Started

JWT Format

AttributeDescriptionRequiredExample
issIssuer, this is the site that is issuing the tokenYeshttps://yoursite.com
subSubject, Logged in userYesuser@yoursite.com
expExpiration, Time token will expire (minimum 10 mins)Yes1356999524
iatIssued at time, Time token was createdYes1356999524
audAudience, Rali tenant urlYeshttps://rali.io
keyRali tenant Client API KeyYesONQ-XXXXXXXXXXX
userBase64 encoded user objectYesSee User Object for formatting
referrerUrl where the link is renderedYeshttps://yoursite.com/page1

Sample Code

PHP:

$secret = "xxxxxxxxxxxxxxxxxx"; // API Secret
$token = array(
  "iss" => "https://yoursite.com",
  "aud" => https://rali.io,
  "sub" => "engageoq.can@yoursite.com",
  "iat" => 1356999524,
  "exp" => 1356999524,
  "user" => $user,
  "referrer" => window.location,
);

$data = JWT::encode($token, $secret);
Was this article helpful to you? Yes No

How can we help?