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.

Integrate to HTML5 Players

See Player Integration

Include

Script

<script src="https://cdn.jsdelivr.net/npm/cdnbye-shaka@latest"></script>

File

Click me

Browserify / Webpack

npm install --save cdnbye-shaka

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

var P2PEngineShaka = require('cdnbye-shaka');

If you are using ES6's import syntax:

import P2PEngineShaka from 'cdnbye-shaka';

Usage

var player = new shaka.Player(video);
if (P2PEngineShaka.isSupported()) {
new P2PEngineShaka(player, {
live: false, // set to true in live mode
// trackerZone: 'hk', // if using Hongkong tracker
// trackerZone: 'us', // if using USA tracker
// token: YOUR_TOKEN
});
}
player.load(play_url)

Electron

CDNBye also supports Electron, you just need to register AppId and get a token from CDNBye console:

new P2PEngineShaka(player, {
token: YOUR_TOKEN,
appName: YOUR_APP_NAME, // 应用的名称
appId: YOUR_APP_ID, // 需要与控制台输入的保持一致
// Other p2pConfig options if applicable
});

Learn more here