tencent_live_flutter 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new44

tencent_live_flutter #

腾讯直播flutter插件
本插件基于腾讯直播基础版 实现,无连麦功能。

Getting Started #

dependencies:
  tencent_live_flutter: ^0.0.1

设置License #

Future<void> main() async {
  runApp(MyApp());
  await TencentLive.instance.init(
    licenseUrl: 'licenseUrl',
    licenseKey: 'licenseKey',
  );
}

创建拉流视图 #

TXCloudPullView(
    onTXCloudPullViewCreated: (controller) async {
        _livePullController = controller;
        // 拉流播放配置
        await _livePullController.setPlayConfig(TXLivePlayConfig());
        // 开始播放
        await _livePullController.startPlay(_testPullUrl);
    },
)  

创建推流视图 #

TXCloudPushView(
    onTXCloudPushViewCreated: (controller) async {
        _livePushController = controller;
        // 开始推流
        await _livePushController.startPush(_testPushUrl);
    },
)

iOS #

需要在info.plist增加io.flutter.embedded_views_preview=true,至关重要,不然无法显示。

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:tencent_live_flutter/tencent_live_flutter.dart';

import 'live_pull_page.dart';
import 'live_push_page.dart';
//import 'live_push_page.dart';

Future<void> main() async {
  runApp(MyApp());
  await TencentLive.instance.init(
    licenseUrl:
        'http://license.vod2.myqcloud.com/license/v1/abd67887172ec836092ebdc8bae7e659/TXLiveSDK.licence',
    licenseKey: '1ed3f8a788ab29d81ec79d63b09fcec1',
  );
}

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: _HomeScreen());
  }
}

class _HomeScreen extends StatefulWidget {
  const _HomeScreen({
    Key key,
  }) : super(key: key);

  @override
  __HomeScreenState createState() => __HomeScreenState();
}

class __HomeScreenState extends State<_HomeScreen> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[
          Center(
            child: RaisedButton(
              child: Text("Live push"),
              onPressed: (){
                pushPage(context, LivePushPage());
              },
            ),
          ),
          Center(
            child: RaisedButton(
              child: Text("Live pull"),
              onPressed: (){
                pushPage(context, LivePullPage());
              },
            ),
          )
        ],
      ),
    );
  }

  void pushPage(final BuildContext context, final Widget page){
    Navigator.push(context,
        MaterialPageRoute(builder: (context) {
          return page;
        }));
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  tencent_live_flutter: ^0.0.1

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:tencent_live_flutter/tencent_live_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:tencent_live_flutter/tencent_live_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:tencent_live_flutter/tencent_live_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:tencent_live_flutter/tencent_live_flutter.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:tencent_live_flutter/tencent_live_flutter.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [tencent_live_flutter] that is in a package requiring null.

Health suggestions

Format lib/src/tencent_live.dart.

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

Format lib/src/tx_beauty_manager.dart.

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

Format lib/src/tx_cloud_pull_view.dart.

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

Fix additional 8 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/tx_cloud_pull_view_controller.dart (Run flutter format to format lib/src/tx_cloud_pull_view_controller.dart.)
  • lib/src/tx_cloud_push_view.dart (Run flutter format to format lib/src/tx_cloud_push_view.dart.)
  • lib/src/tx_cloud_push_view_controller.dart (Run flutter format to format lib/src/tx_cloud_push_view_controller.dart.)
  • lib/src/tx_live_constants.dart (Run flutter format to format lib/src/tx_live_constants.dart.)
  • lib/src/tx_live_play_config.dart (Run flutter format to format lib/src/tx_live_play_config.dart.)
  • lib/src/tx_live_push_config.dart (Run flutter format to format lib/src/tx_live_push_config.dart.)
  • lib/src/tx_snapshot_channel.dart (Run flutter format to format lib/src/tx_snapshot_channel.dart.)
  • lib/tencent_live_flutter.dart (Run flutter format to format lib/tencent_live_flutter.dart.)

Maintenance issues and suggestions

The description contains too many non-ASCII characters. (-20 points)

The site uses English as its primary language. The value of the description field in your package's pubspec.yaml field should primarily contain characters used in English.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

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