Skip to main content

Usage

Register Domain

Register your domain to activate P2P service.

tip

Localhost is always whitelisted. This means that you do not have to configure anything to perform tests locally.

Demo

See Player Demo

Include

Script

<script src="https://cdn.jsdelivr.net/npm/@swarmcloud/bitmovin@latest"></script>

File

Click me

Browserify / Webpack

npm install --save @swarmcloud/bitmovin

To include p2p engine you need to require it in the player module:

var P2pEngineBitmovin = require('@swarmcloud/bitmovin');

If you are using ES6's import syntax:

import P2pEngineBitmovin from '@swarmcloud/bitmovin';

Usage

var conf = {
key: YOUR_BITMOVIN_LICENSE_KEY,
playback: {
preferredTech: [
{player: 'html5', streaming: 'hls'}
]
},
live:{
lowLatency:{
targetLatency: 30
}
},
};
var engine = new P2pEngineBitmovin({
// trackerZone: 'hk', // if using Hongkong tracker
// trackerZone: 'us', // if using USA tracker
// token: YOUR_TOKEN
});
conf.network = engine.getNetworkConfig();
var player = new bitmovin.player.Player(document.getElementById('player'), conf);
engine.setPlayer(player);
player.load(play_url);

File Explanation

@swarmcloud/bitmovin/

├── dist/
├── bitmovin-p2p-engine.min.d.ts # Typescript type information
├── bitmovin-p2p-engine.min.js # P2pEngine that supports both Dash and Hls
└── bitmovin-p2p-engine.dash.min.js # P2pEngine that supports Dash only
└── bitmovin-p2p-engine.hls.min.js # P2pEngine that supports Hls only