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

discontinued
outdated

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

example/lib/main.dart

import 'package:decorated_flutter/decorated_flutter.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=2ab1af963d0ce52ba9a1b5dad2478af0&txTime=5EA069FF';

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

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: Column(
        children: <Widget>[
          Flexible(
            child: 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(
                    pushUrl: _testPushUrl,
                    onLiveWidgetCreated: (controller) async {
                      _controller = controller;
                    },
                  );
                }
              },
            ),
          ),
          Flexible(
            child: DecoratedColumn(
              children: <Widget>[],
            ),
          ),
        ],
      ),
    );
  }
}
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