直播常亮

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_im_plugin/tencent_im_plugin.dart';
import 'package:tencent_live_fluttify/tencent_live_fluttify.dart'; import 'package:tencent_live_fluttify/tencent_live_fluttify.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:wakelock/wakelock.dart';
class LivePage extends StatefulWidget { class LivePage extends StatefulWidget {
LivePage({Key key}) : super(key: key); LivePage({Key key}) : super(key: key);
@ -52,12 +53,13 @@ class _LivePageState extends State<LivePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Wakelock.enable();
_editingController.text = '${UserManager.instance.user.info.nickname}正在直播'; _editingController.text = '${UserManager.instance.user.info.nickname}正在直播';
} }
@override @override
void dispose() { void dispose() {
Wakelock.disable();
_livePusher?.stopPush(); _livePusher?.stopPush();
_livePusher?.stopPreview(); _livePusher?.stopPreview();
_editingController?.dispose(); _editingController?.dispose();
@ -485,9 +487,9 @@ class _LivePageState extends State<LivePage> {
print(customParams); print(customParams);
switch (customParams['type']) { switch (customParams['type']) {
case 'UnExplain': case 'UnExplain':
break; break;
case 'Explain': case 'Explain':
break; break;
case 'LiveStop': 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/message_node/text_message_node.dart';
import 'package:tencent_im_plugin/tencent_im_plugin.dart'; import 'package:tencent_im_plugin/tencent_im_plugin.dart';
import 'package:tencent_live_fluttify/tencent_live_fluttify.dart'; import 'package:tencent_live_fluttify/tencent_live_fluttify.dart';
import 'package:wakelock/wakelock.dart';
class LiveStreamViewPage extends StatefulWidget { class LiveStreamViewPage extends StatefulWidget {
final int id; final int id;
@ -44,6 +45,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Wakelock.enable();
// Future.delayed(Duration(seconds: 10), () { // Future.delayed(Duration(seconds: 10), () {
// _livePlayer?.pausePlay(); // _livePlayer?.pausePlay();
// CRoute.transparent(context, LiveBlurPage()); // CRoute.transparent(context, LiveBlurPage());
@ -164,6 +166,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
TencentImPlugin.logout(); TencentImPlugin.logout();
_scrollController?.dispose(); _scrollController?.dispose();
DPrint.printLongJson('用户退出'); DPrint.printLongJson('用户退出');
Wakelock.disable();
super.dispose(); super.dispose();
} }

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

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

Loading…
Cancel
Save