zegoliveroom_plugin 1.0.6

zegoliveroom_plugin pub package

即构科技(Zego)音视频Flutter SDK,提供视频直播以及实时音视频服务。


一、下载 Flutter SDK #

参考:Flutter SDK 下载

二、配置开发环境 #

  1. Android Studio:Preferences->Plugins,搜索Flutter插件进行下载,在插件中配置第一步下载好的Flutter SDK路径

  2. Visual Code: 在应用商店中搜索Flutter扩展并下载

以上任一开发环境配置好flutter环境之后,命令行执行flutter doctor,根据提示内容补全相关未下载的依赖项。

三、申请Zego App ID #

登录官网注册账号,根据自身实际业务需求选择场景,获取AppID与App Sign,用于初始化SDK。

四、导入 zegoliveroom_plugin #


  • 以pub形式依赖:
	sdk: flutter

  zegoliveroom_plugin: ^1.0.5
  • 以git形式依赖:
	sdk: flutter

      url: git://github.com/zegoim/zego-flutter-sdk.git

五、初始化 SDK #

import 'package:flutter/material.dart';
import 'package:zegoliveroom_plugin/zegoliveroom_plugin.dart';

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

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

class _MyAppState extends State<MyApp> {

  // 填入实际从即构官网获取到的AppID
  final int appID = 00000000;
  // 填入实际从即构官网获取到的AppSign
  final String appSign = '0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'

  String version = '';

  void initState() {

    // 获取SDK版本号
    ZegoLiveRoomPlugin.getSdkVersion().then((ver) {

        version = ver;


    // 初始化SDK
    ZegoLiveRoomPlugin.initSDK(appID, appSign);

  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Zego Plugin example app'),
        body: Center(
          child: Text('Version: $version'),


六、常见问题 #

1. 解决 iOS 平台下 ZegoLiveRoomApi-AudioIOaudio_in_output 模块编译错误问题:

打开 iOS 工程文件 Runner. xcworkspace -> Build Settings,将 Compile Sources As 改为 Objective-C++,重新编译

2. iOS 编译报错:ld: symbol(s) not found for architecture x86_64


3. iOS 使用 Platform View 时报错:[VERBOSE-2:platform_view_layer.cc(28)] Trying to embed a platform view but the PaintContext does not support embedding

打开需要使用 Platform View 的 iOS 工程,在Info.plist中添加字段io.flutter.embedded_views_preview,其值为YES

1.0.6 #

  1. fix some bug and crash
  2. add log system

1.0.5 #

  1. add peer to peer delay/package lost rate.
  2. add remote user's device state notification(on/off)
  3. add remote user's first frame notification
  4. update native sdk
  5. promote stability

1.0.4 #

  1. add sound-level module
  2. add error-code module
  3. update native sdk

1.0.3 #

Add Platform View API

1.0.2 #

  1. update native sdk
  2. fix crash
  3. refactor api structure

1.0.1 #


1.0.0 #



example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  zegoliveroom_plugin: ^1.0.6

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:zegoliveroom_plugin/zegoliveroom_plugin.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 Aug 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/src/zego_api_defines.dart.

Run flutter format to format lib/src/zego_api_defines.dart.

Format lib/src/zego_api_error_code.dart.

Run flutter format to format lib/src/zego_api_error_code.dart.

Format lib/src/zego_liveroom.dart.

Run flutter format to format lib/src/zego_liveroom.dart.

Fix additional 6 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/zego_liveroom_audio.dart (Run flutter format to format lib/src/zego_liveroom_audio.dart.)
  • lib/src/zego_liveroom_event_channel.dart (Run flutter format to format lib/src/zego_liveroom_event_channel.dart.)
  • lib/src/zego_liveroom_player.dart (Run flutter format to format lib/src/zego_liveroom_player.dart.)
  • lib/src/zego_liveroom_publisher.dart (Run flutter format to format lib/src/zego_liveroom_publisher.dart.)
  • lib/src/zego_media_side_info.dart (Run flutter format to format lib/src/zego_media_side_info.dart.)
  • lib/src/zego_sound_level.dart (Run flutter format to format lib/src/zego_sound_level.dart.)


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