Skip to main content

Live Stream Player integration

To integrate the Dejacast player for a live stream into a website, follow these steps:

  1. Access the Embed Code:

Copy the following basic embed code structure and modify it by replacing the placeholders with the appropriate values.

<script type="text/javascript" src="https://app.dejacast.com/player/[PLAYER_SLUG]/live-[STREAM_SLUG].js?playbackURL=[LIVE_STREAM_URL]"></script>
  1. Understanding the Variables:

Each part of the embed code contains dynamic variables that you will need to replace with specific information related to your player and live stream.

[PLAYER_SLUG]: This is the unique identifier for the video player you want to use. You can obtain this from the Dejacast platform by navigating to Dashboard -> Settings -> Players, on the ID column. You can also click the player's name to open its settings, where the Player ID is displayed.

[STREAM_SLUG]: This represents the live stream slug (unique ID) for the stream you are broadcasting. You can find this in Publishers -> All Publishers. Click the publisher's name and look for the Stream Slug field in the Publisher Info tab.

[LIVE_STREAM_URL]: The live stream URL must be generated using the Dejacast API for each specific live stream session. The URL should be URL-encoded before using it in the embed code. Detailed instructions on generating the live stream URL can be found in the API documentation here.

  1. Generate the Live Stream URL:

To get the [LIVE_STREAM_URL], you’ll need to make a request to the Dejacast API. Follow the steps in the API documentation to retrieve the playback URL. Make sure the URL is encoded correctly before inserting it into the embed code.

  1. Embed the Code:

Once you have all the necessary values, replace the placeholders in the embed code with the actual values. For example:

<script type="text/javascript" src="https://app.dejacast.com/player/examplePlayer/live-exampleStream.js?playbackURL=https%3A%2F%2Fexample.com%2FliveStreamUrl"></script>
  1. Integrate the Embed Code on Your Website:

Paste the modified embed code into the HTML source of your website, where you want the live stream player to appear.

By following these steps, you’ll successfully integrate the Dejacast live stream player into your website. Make sure to check the live stream settings and test the player before going live.