直播常亮

master
laiiihz 5 years ago
parent e0cb35e886
commit 1c50ed0f47

@ -27,6 +27,7 @@ import 'package:tencent_im_plugin/message_node/group_system_message_node.dart';
import 'package:tencent_im_plugin/tencent_im_plugin.dart';
import 'package:tencent_live_fluttify/tencent_live_fluttify.dart';
import 'package:image_picker/image_picker.dart';
import 'package:wakelock/wakelock.dart';
class LivePage extends StatefulWidget {
LivePage({Key key}) : super(key: key);
@ -52,12 +53,13 @@ class _LivePageState extends State<LivePage> {
@override
void initState() {
super.initState();
Wakelock.enable();
_editingController.text = '${UserManager.instance.user.info.nickname}正在直播';
}
@override
void dispose() {
Wakelock.disable();
_livePusher?.stopPush();
_livePusher?.stopPreview();
_editingController?.dispose();
@ -485,9 +487,9 @@ class _LivePageState extends State<LivePage> {
print(customParams);
switch (customParams['type']) {
case 'UnExplain':
break;
break;
case 'Explain':
break;
break;
case 'LiveStop':
}
}

@ -22,6 +22,7 @@ import 'package:tencent_im_plugin/message_node/group_system_message_node.dart';
import 'package:tencent_im_plugin/message_node/text_message_node.dart';
import 'package:tencent_im_plugin/tencent_im_plugin.dart';
import 'package:tencent_live_fluttify/tencent_live_fluttify.dart';
import 'package:wakelock/wakelock.dart';
class LiveStreamViewPage extends StatefulWidget {
final int id;
@ -44,6 +45,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
@override
void initState() {
super.initState();
Wakelock.enable();
// Future.delayed(Duration(seconds: 10), () {
// _livePlayer?.pausePlay();
// CRoute.transparent(context, LiveBlurPage());
@ -164,6 +166,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
TencentImPlugin.logout();
_scrollController?.dispose();
DPrint.printLongJson('用户退出');
Wakelock.disable();
super.dispose();
}

@ -1139,7 +1139,7 @@ packages:
source: hosted
version: "0.2.7"
wakelock:
dependency: transitive
dependency: "direct main"
description:
name: wakelock
url: "https://pub.flutter-io.cn"

@ -181,6 +181,8 @@ dependencies:
#腾讯直播
tencent_live_fluttify: ^0.2.0+1
#腾讯IM
#TODO 已经将错误提交到上游代码,后期请使用新版本
#more at https://github.com/JiangJuHong/FlutterTencentImPlugin/pull/101
tencent_im_plugin:
git:
url: https://gitee.com/laiiihz/FlutterTencentImPlugin
@ -195,6 +197,8 @@ dependencies:
#点赞组件
many_like: ^0.0.3
wakelock:
dev_dependencies:

Loading…
Cancel
Save