How to integrate your live streams into your streaming application?
After you set up live streams, you are now ready to integrate your live streams into your video streaming application.
Mlytics Stream provides an easy way to integrate your live streams 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 live stream 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 the end user plays each video segment (i.e. .ts file).
Right after you set up your live stream, Mltyics Stream will auto-generate code snippets containing the SDK for this live stream. You can then copy the code snippets into your streaming application.
Generate the code snippet
To generate the code snippet of your live stream, navigate to ‘ Stream’ > ‘Live Streams’.
On this page, and under the section ‘ Stream List’, you can click the stream name of your selected live stream, and by doing so, this will direct you to the Stream details page.
On the Stream details page, go to the ‘ Install & Test’ tab.
A. When you chose RTMP as the protocol
On the ‘Install & Test’ tab, Mlytics Stream will be providing the RTMP input URL, RTMP input key, and LL HLS output. You can choose your preferred video player on this page.
Copy the RTMP input URL and RTMP input key into your video streaming device. This will allow your video streaming device to push the live stream to the RTMP server’s input channel.
The system will automatically generate a code snippet containing all the configurations you set. The LL HLS output will be automatically copied into the code.
B. When you chose HLS as the protocol
On the ‘Install & Test’ tab, input the manifest (m3u8) URL of your target video under the ‘Playlist URL’ field. You can choose your preferred video player on this page.
The system will generate a code snippet containing all the configurations you set.
Copy the code snippet
After you finished the configuration on the ‘Install & Test’ (for both cases/protocol), you may now access the generated code snippets 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).