cdnbye 0.6.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 78

English | 简体中文

cdnbye logo

Live/VOD P2P Engine for Flutter


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

Screenshot #

Environment Configuration #

See documentation

Example #

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

// Init p2p engine

// Start playing video

_initEngine() async {
    await Cdnbye.init(
      config: P2pConfig.byDefault()

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

Example using ijk_player. #


Obtain Token #

See here

Consloe #

Register your AppId at, 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.


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

Contact Us #

0.6.0 #


0.5.0 #

Update SDK version: iOS(1.0.0) Android(1.2.4) Fix bug: can't listen value changed in flutter.

0.3.0 #

Add new APIs

0.2.0 #

Update Android native SDK to 0.6.2

0.1.0 #

Formal release


import 'package:cdnbye_example/global/cdnByeListener.dart';
import 'package:cdnbye_example/pages/videoList.dart';
import 'package:cdnbye_example/pages/videoPage.dart';
import 'package:flutter/material.dart';
import 'package:cdnbye/cdnbye.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();

class _MyAppState extends State<MyApp> {
  _listen(Map info) {
    // 写入消息
    CdnByeListener().videoInfo.value = info;

  void initState() {
    // 初始化
    // Future.delayed( async {
      'free', // replace with your token
      config: P2pConfig(
        logLevel: P2pLogLevel.debug,
      infoListener: _listen,
    // });

  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      theme: ThemeData(
        scaffoldBackgroundColor: Color(0xFFf5f5f4),
      home: VideoList(),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  cdnbye: ^0.6.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:cdnbye/cdnbye.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jun 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev
  • Flutter: 1.17.1

Maintenance suggestions

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies