SwarmCloud

vuePress-theme-reco SwarmCloud    2018 - 2023
P2P Streaming Engine P2P Streaming Engine

Choose mode

  • dark
  • auto
  • light
Documents
  • Introduction
  • Web SDK

    • HLS(m3u8)
    • Shaka-Player
    • Dash.js
    • MP4
    • Downloader
  • Android/AndroidTV SDK

    • v3
    • v2
  • iOS/tvOS/macOS SDK
Pricing
Contact Us
Partnership
Ecosystem
Globe
Dashboard
GitHub (opens new window)
語言
  • English
  • 中文

Documents
  • Introduction
  • Web SDK

    • HLS(m3u8)
    • Shaka-Player
    • Dash.js
    • MP4
    • Downloader
  • Android/AndroidTV SDK

    • v3
    • v2
  • iOS/tvOS/macOS SDK
Pricing
Contact Us
Partnership
Ecosystem
Globe
Dashboard
GitHub (opens new window)
語言
  • English
  • 中文
  • Introduction
  • FAQ
  • Tracking Service
  • Signaling Service
  • P2P Optimization
  • Dashboard

  • Web HLS SDK

  • Android SDK v3

  • Android SDK v2

  • iOS/tvOS/macOS SDK

  • Flutter SDK

  • Shaka-Player SDK

  • Dash.js SDK

    • Introduction
    • Usage
      • Register Domain
      • Integrate to HTML5 Players
      • Include
      • Usage
      • Electron
    • API & Config
    • Change Log
  • Hls.js SDK

  • Web MP4 SDK

  • Web Downloader

  • More

Usage

vuePress-theme-reco SwarmCloud    2018 - 2023

Usage


SwarmCloud

# 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