How to integrate your video assets into your streaming application?
After you upload a video on Assets, you are now ready to integrate your videos into your video streaming application.
Mlytics Stream provides an easy way to integrate your videos into your web app or mobile app through the Stream SDK.
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.
Stream SDK implements the following functionalities into the user’s streaming application:
- perform in-stream switching to dynamically select the best-performing CDN when delivering the video segments of your video;
- deliver the video segments of your video through P2P video delivery (if enabled);
- implement domain allowlist;
- collect CDN quality data when end users download each video segment (i.e. .ts file); and
- collect real-time video event data when end users play each video segment (i.e. .ts file).
Right after you upload the video on Assets, Mltyics Stream will auto-generate code snippets containing the SDK for this video. You can then copy the code snippets into your streaming application.
Generate the code snippet
To generate the code snippet, navigate to ‘ Stream’ > ‘Assets’.
On this page, and under the section ‘ Video List’, you can click the file name of your selected video, and by doing so, this will direct you to the video detail info page.
On the Video detail info page, Mlytics Stream will be providing the HLS manifest URL. You can choose your preferred video player on this page.
The system will automatically generate a code snippet containing all the configurations you set. The HLS manifest URL will be automatically copied into the code.
Copy the code snippet
After you finished the configuration, you may now access the generated code snippet on the ‘ Code Snippet’ tab.
You can click the ‘ Copy’ button to copy the code snippet into your video streaming app code.
You can also open the ‘ See our docs’ link, to check more detailed instructions on how to input the code snippet for different platforms (web, or iOS), different players (Video.js, HLS.js, or DPlayer), and JS frameworks (HTML, React, Vue).
Preview Video Stream
You may also select the ‘ Video preview’ tab to preview your video.
The preview also shows how Multi CDN performs when delivering your selected video. It shows which CDNs were used to deliver video segments and their corresponding download speed (performance).