cdnbye 0.4.0 copy "cdnbye: ^0.4.0" to clipboard
cdnbye: ^0.4.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 [...]

example/lib/main.dart

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 {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    // 初始化
    Future.delayed(Duration.zero).then((_) async {
      Cdnbye.init(
        'free',                                 // replace with your token
        config: P2pConfig(
          logLevel: P2pLogLevel.info,
        ),
        infoListener: (Map info) {
          // 写入消息
          CdnByeListener().videoInfo.value = info;
        },
      );
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      theme: ThemeData(
        scaffoldBackgroundColor: Color(0xFFf5f5f4),
      ),
      home: VideoList(),
    );
  }
}
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 breaks the gap between the browser and mobile application. As expected, it supports any flutter player!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on cdnbye