Skip to content

How to configure EngineCallbacks #432

Answered by DimaDemchenko
hkchenhongyi asked this question in Q&A
Discussion options

You must be logged in to vote

You can refer to the Core package API if you're building a custom integration. We have Hls.js and Shaka packages built on the Core package, but they don’t provide direct access to engine callbacks. However, core events provide sufficient information to calculate bandwidth independently. One simple method is to sum all incoming chunks and use a 1-second interval to calculate bandwidth by dividing the total bytes by elapsed time, then resetting the total for the next interval

Integration examples
Core API
Hls.js integration API
Shaka integration API

let totalBytes = 0;
const interval = 1000;

const config = {
    p2p: {
        core: {
            swarmId: "Optional custom swarm ID for stre…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hkchenhongyi
Comment options

@DimaDemchenko
Comment options

Answer selected by hkchenhongyi
@hkchenhongyi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #431 on November 05, 2024 13:30.