Usage
# Register Domain
Register your domain to activate P2P service.
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 (opens new window)
# Include
# Script
Include the pre-built script of latest version:
<script src="https://cdn.jsdelivr.net/npm/cdnbye-dash@latest"></script>
# File
Click me (opens new window)
This needs to be included before your player code. You can either prepend it to your compiled code or include it in a <script>
before it.
# Browserify / Webpack
npm install --save cdnbye-dash
To include cdnbye-dash you need to require it in the player module:
var P2PEngineDash = require('cdnbye-dash');
If you are using ES6's import syntax:
import P2PEngineDash from 'cdnbye-dash';
# Usage
Create an instance of dashjs#MediaPlayer , then create P2PEngineDash instance passing player as parameter.
var player = dashjs.MediaPlayer().create()
if (P2PEngineDash.isSupported()) {
var p2pConfig = {
logLevel: 'debug',
// Other p2pConfig options if applicable
};
new P2PEngineDash(player, p2pConfig);
}
// Use dash.js just like your usual dash.js…
# Electron
CDNBye also supports Electron (opens new window), you just need to register AppId and get a token from CDNBye console:
p2pConfig: {
token: YOUR_TOKEN,
appName: YOUR_APP_NAME,
appId: YOUR_APP_ID,
// Other p2pConfig options if applicable
}
Learn more here