tencent_live_fluttify 0.1.1 copy "tencent_live_fluttify: ^0.1.1" to clipboard
tencent_live_fluttify: ^0.1.1 copied to clipboard

discontinued
outdated

A `Tencent Live` flutter plugin, Powered by `Fluttify` engine.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:tencent_live_fluttify/tencent_live_fluttify.dart';

const _testPushUrl =
    'rtmp://live-push.tuobaye.cn/live/123456?txSecret=19e28b4566e0c7c365484d531fa04efd&txTime=5EDA6BFF';

Future<void> main() async {
  runApp(MyApp());
  await TencentLive.init(
    licenseUrl:
        'https://license.vod2.myqcloud.com/license/v1/bc8b7690d75d757e9a0fcfa0be01c96f/TXLiveSDK.licence',
    licenseKey: '26be8d6e80f07acc9ee8830d809de878',
  );
}

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> {
  TencentLiveController _controller;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: FutureBuilder<bool>(
        future: [
          Permission.camera,
          Permission.microphone,
        ].request().then((it) =>
            it.values.every((status) => status == PermissionStatus.granted)),
        builder: (context, snapshot) {
          if (!snapshot.hasData) {
            return CupertinoActivityIndicator();
          } else {
            return TencentLiveWidget(
              onLiveWidgetCreated: (controller) async {
                _controller = controller;
                _controller.startPush(_testPushUrl);
              },
            );
          }
        },
      ),
    );
  }
}
3
likes
0
pub points
0%
popularity

Publisher

verified publisherfluttify.com

A `Tencent Live` flutter plugin, Powered by `Fluttify` engine.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, foundation_fluttify

More

Packages that depend on tencent_live_fluttify