腾讯直播flutter插件
本插件基于腾讯直播基础版 实现,无连麦功能。
dependencies:
tencent_live_flutter: ^0.0.1
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);
},
)
需要在info.plist增加io.flutter.embedded_views_preview=true,至关重要,不然无法显示。