How to setup the SDK into your video streaming application?
An SDK (Software Development Kit) is a collection of software development tools in one installable package. It is a toolkit that facilitates the creation of applications for a specific platform, system, or programming language.
After creating a stream source, Stream will auto-generate code snippets for the SDK which will be used to implement all the Stream functionalities into user’s streaming services, namely:
- play HLS videos into user’s video player;
- utilize Stream Monitoring service to collect real-time CDN quality data when downloading every video segment (i.e. .ts file);
- utilize Stream Monitoring service to collect real-time video event data when playing every video segment (i.e. .ts file);
- utilize Stream Orchestrator to dynamically switch to the best-performing CDN (within the CDNs on the Stream Source);
- utilize Stream Orchestrator to deliver video through P2P video delivery (if enabled); and
- implement domain allowlist.
To setup the SDK into your video stream application, follow these simple steps:
Step 1: Insert playlist URL (optional)
Users can optionally input their playlist URL in order to integrate a video playlist directly into the code snippets.
The playlist URL must be a URL that contains the m3u8 file (based on HTTP Live Streaming - HLS - protocol).
Step 2: Copy the code snippets into your video streaming application
First, choose a video player:
Next, copy these code snippets and insert them into your HTML <head> block.
Finally, copy these code snippets and insert them into your HTML <body> block.
These code snippets are mandatory and will link the user’s video player with the Stream platform (via the video player plugin). Once the code snippets are copied into the user’s HTML code, this will implement all the Stream functionalities into the user’s streaming services.
If the user did not input the playlist URL, this will leave a placeholder in the code snippet such as “$PLAYLIST_URL” which the user can manually replace with their desired playlist URL.
Users may view the sample page source code, by clicking the “Sample page source code” button.
Preview Video Stream
Users may also test the video streaming quality by playing its preview directly on Stream. To play the preview, you just need to input your playlist URL.