cdnbye 0.2.0 copy "cdnbye: ^0.2.0" to clipboard
cdnbye: ^0.2.0 copied to clipboard

discontinuedreplaced by: flutter_p2p_engine
outdated

CDNBye flutter P2P Engine scales live/vod video streaming by peer-to-peer network using bittorrent-like protocol. Powered by WebRTC Datachannel, this SDK can interconnect with the Web side plug-in of [...]

English | 简体中文

cdnbye logo

Live/VOD P2P Engine for Flutter

pub

Features #

  • Support iOS and Android platform
  • Support live and VOD streams over HLS protocol(m3u8)
  • Support encrypted HLS stream
  • Support cache to avoid repeating the download of TS file
  • Very easy to integrate with an existing flutter project
  • Support any flutter player
  • Efficient scheduling policies to enhance the performance of P2P streaming
  • Highly configurable
  • Use IP database to group up peers by ISP and regions

Installation #

Add cdnbye as a dependency in your pubspec.yaml file.

iOS #

Requirement: This library requires iOS 9.0+. NOTICE: This framework doesn’t support bitcode currently.
In order to allow the loading of distributed content via the local proxy, enable loading data from HTTP in your app by opening your info.plist file as source code and adding the following values below the tag:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

Android #

Requirement: Kitkat 4.4(API level >= 19)
Add relevant uses permissions in app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Starting with Android 9 (API level 28), cleartext support is disabled by default. There are 2 solutions:
(1) set targetSdkVersion under 27
(2) Add the attribute below in app/src/main/AndroidManifest.xml to indicate that the app intends to use cleartext HTTP:

<application
  ...
  android:usesCleartextTraffic="true"
  ...
    />

Example #

import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';
import 'package:cdnbye/cdnbye.dart';

// Init p2p engine
_initEngine();

// Start playing video
_loadVideo();

_initEngine() async {
    await Cdnbye.init(
      YOUR_TOKEN,
      config: P2pConfig.byDefault()
    );
}

_loadVideo() async {
    var url = YOUR_STREAM_URL;
    url = await Cdnbye.parseStreamURL(url);           // Parse your stream url
    player = VideoPlayerController.network(url);
    player.play();
}

Obtain Token #

See here

Consloe #

Register your AppId at https://oms.cdnbye.com, where you can view p2p-related information.

Issue & Feature Request #

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.

FAQ #

We have collected some frequently asked questions. Before reporting an issue, please search if the FAQ has the answer to your problem.

Contact Us #

Email:service@cdnbye.com

20
likes
0
pub points
0%
popularity

Publisher

verified publishercdnbye.com

CDNBye flutter P2P Engine scales live/vod video streaming by peer-to-peer network using bittorrent-like protocol. Powered by WebRTC Datachannel, this SDK can interconnect with the Web side plug-in of CDNBye, which greatly increases the number of nodes in the P2P network, breaking the gap between the browser and mobile application. Merely a few lines of codes are required to quickly integrate into existing flutter projects. As expected, it supports any flutter player!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on cdnbye