laiiihz 5 years ago
parent fb202691da
commit 2a68a03f77

@ -81,19 +81,19 @@ android {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
ndk { // ndk {
//SO // //SO
abiFilters 'armeabi-v7a', 'x86'//, 'arm64-v8a', 'x86', 'x86_64' // abiFilters "armeabi","armeabi-v7a","arm64-v8a"//, 'arm64-v8a', 'x86', 'x86_64'
} // }
} }
debug { debug {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
ndk { // ndk {
abiFilters "armeabi","armeabi-v7a","arm64-v8a", "x86" // abiFilters "armeabi","armeabi-v7a","arm64-v8a"
//SO // //SO
// abiFilters 'armeabi-v7a', 'x86'//, 'arm64-v8a', 'x86', 'x86_64' // // abiFilters 'armeabi-v7a', 'x86'//, 'arm64-v8a', 'x86', 'x86_64'
} // }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

@ -142,54 +142,54 @@ PODS:
- meiqia_plugin (0.0.1): - meiqia_plugin (0.0.1):
- Flutter - Flutter
- Meiqia (~> 3.5.0) - Meiqia (~> 3.5.0)
- mob_sharesdk (4.3.13.1): - mob_sharesdk (4.3.14):
- mob_sharesdk/ShareSDK (= 4.3.13.1) - mob_sharesdk/ShareSDK (= 4.3.14)
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDK (4.3.13.1): - mob_sharesdk/ShareSDK (4.3.14):
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKExtension (4.3.13.1): - mob_sharesdk/ShareSDKExtension (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/Douyin (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/Douyin (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/Facebook (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/Facebook (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/KuaiShou (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/KuaiShou (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/Line (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/Line (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/Oasis (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/Oasis (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/QQ (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/QQ (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/SinaWeibo (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/SinaWeibo (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/SnapChat (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/SnapChat (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/Twitter (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/Twitter (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/WatermelonVideo (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/WatermelonVideo (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/WeChatFull (4.3.13.1): - mob_sharesdk/ShareSDKPlatforms/WeChatFull (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKRestoreScene (4.3.13.1): - mob_sharesdk/ShareSDKRestoreScene (4.3.14):
- mob_sharesdk/ShareSDKExtension - mob_sharesdk/ShareSDKExtension
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKUI (4.3.13.1): - mob_sharesdk/ShareSDKUI (4.3.14):
- mob_sharesdk/ShareSDK - mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9) - MOBFoundation (>= 3.2.9)
- MOBFoundation (3.2.19) - MOBFoundation (3.2.21)
- mobile-ffmpeg-min (4.3.1.LTS) - mobile-ffmpeg-min (4.3.1.LTS)
- openinstall_flutter_plugin (0.0.1): - openinstall_flutter_plugin (0.0.1):
- Flutter - Flutter
@ -420,8 +420,8 @@ SPEC CHECKSUMS:
Mantle: 863ddda5376b35174cd7676e381d448aa52cc5e7 Mantle: 863ddda5376b35174cd7676e381d448aa52cc5e7
Meiqia: f4bb24e7a785e100957e6702d19853434dcb486e Meiqia: f4bb24e7a785e100957e6702d19853434dcb486e
meiqia_plugin: bff6743de1eb5e1f7c6b2142a5953e18c4abbbe7 meiqia_plugin: bff6743de1eb5e1f7c6b2142a5953e18c4abbbe7
mob_sharesdk: a83dd0b129a3f954c9a639d5c33fd3d2cd41e887 mob_sharesdk: 55e3cbbf594f1abf4a23e198922bcc11ce86ddbb
MOBFoundation: 606bc4c10ff4c6ac573c09f5081a39c75316bc7b MOBFoundation: 7b690d8d42c2c08e33bb3e4d38411bf761bf9f5f
mobile-ffmpeg-min: d5d22dcef5c8ec56f771258f1f5be245d914f193 mobile-ffmpeg-min: d5d22dcef5c8ec56f771258f1f5be245d914f193
openinstall_flutter_plugin: e6b8486f834eb60b336546442a8b747d4b664cf4 openinstall_flutter_plugin: e6b8486f834eb60b336546442a8b747d4b664cf4
package_info: 48b108e75b8802c2d5e126f208ef540561c98aef package_info: 48b108e75b8802c2d5e126f208ef540561c98aef

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:oktoast/oktoast.dart'; import 'package:oktoast/oktoast.dart';
import 'package:recook/constants/api.dart'; import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart'; import 'package:recook/constants/header.dart';
@ -53,7 +54,7 @@ class LivePage extends StatefulWidget {
_LivePageState createState() => _LivePageState(); _LivePageState createState() => _LivePageState();
} }
class _LivePageState extends State<LivePage> { class _LivePageState extends State<LivePage> with WidgetsBindingObserver {
LivePusher _livePusher; LivePusher _livePusher;
File _imageFile; File _imageFile;
TopicListModel _topicModel; TopicListModel _topicModel;
@ -79,13 +80,42 @@ class _LivePageState extends State<LivePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this);
Wakelock.enable(); Wakelock.enable();
_editingController.text = '${UserManager.instance.user.info.nickname}的直播'; _editingController.text = '${UserManager.instance.user.info.nickname}的直播';
} }
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (_isStream)
switch (state) {
case AppLifecycleState.inactive:
_livePusher.setPauseConfig(
300,
5,
AssetImage(R.ASSETS_LIVE_LIVE_ANIMAL_PNG),
ImageConfiguration(),
);
_livePusher.pausePush();
break;
case AppLifecycleState.resumed:
_livePusher.resumePush();
break;
case AppLifecycleState.paused:
print('paused');
break;
case AppLifecycleState.detached:
print('detached');
break;
}
super.didChangeAppLifecycleState(state);
}
@override @override
void dispose() { void dispose() {
WidgetsBinding.instance.removeObserver(this);
PickCart.picked.clear(); PickCart.picked.clear();
Wakelock.disable(); Wakelock.disable();
_livePusher?.stopPush(); _livePusher?.stopPush();
@ -116,6 +146,59 @@ class _LivePageState extends State<LivePage> {
onCloudVideoCreated: (controller) async { onCloudVideoCreated: (controller) async {
_livePusher = await LivePusher.create(); _livePusher = await LivePusher.create();
_livePusher.startPreview(controller); _livePusher.startPreview(controller);
_livePusher.setOnEventListener(
onWaringNetBusy: () {
print('');
},
onWaringReconnect: () {
print('');
},
onWaringHardwareAccelerationFail: () {
print('');
},
onWaringDNSFail: () {
print('');
},
onWaringServerConnFail: () {
print('');
},
onWaringShakeFail: () {
print('');
},
onWaringServerDisconnect: () {
print('');
},
onEventConnectSucc: () {
print('');
},
onEventPushBegin: () {
print('');
},
onEventOpenCameraSuccess: () {
print('');
},
onErrorOpenCameraFail: () {
showToast('相机打开失败');
},
onErrorOpenMicFail: () {
print('');
},
onErrorVideoEncodeFail: () {
print('');
},
onErrorAudioEncodeFail: () {
print('');
},
onErrorUnsupportedResolution: () {
print('');
},
onErrorUnsupportedSampleRate: () {
print('');
},
onErrorNetDisconnect: () {
print('');
},
);
_livePusher.setBeautyFilter( _livePusher.setBeautyFilter(
BeautyFilter.NATURE, BeautyFilter.NATURE,
whiteningLevel: 6, whiteningLevel: 6,

@ -1,4 +1,6 @@
import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:ui';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:many_like/many_like.dart'; import 'package:many_like/many_like.dart';
@ -71,9 +73,14 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
FocusNode _focusNode = FocusNode(); FocusNode _focusNode = FocusNode();
Timer _liveTimer;
bool _waitSignal = false;
int _livePauseTimeStamp = 0;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Wakelock.enable(); Wakelock.enable();
// Future.delayed(Duration(seconds: 10), () { // Future.delayed(Duration(seconds: 10), () {
// _livePlayer?.pausePlay(); // _livePlayer?.pausePlay();
@ -228,6 +235,14 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
); );
setState(() {}); setState(() {});
break; break;
case 'Play':
int holdTimeStamp = data['time'];
if (holdTimeStamp > _livePauseTimeStamp) {
setState(() {
_waitSignal = data['type'] == 'pause';
});
}
break;
} }
} }
} else { } else {
@ -289,8 +304,22 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
} }
} }
reconnectToLive() {
_liveTimer?.cancel();
_liveTimer = Timer(Duration(milliseconds: 5000), () {
_livePlayer.isPlaying().then((value) {
setState(() {
_waitSignal = !value;
});
});
// _livePlayer.push
_livePlayer.startPlay(_streamInfoModel.playUrl, type: PlayType.RTMP);
});
}
@override @override
void dispose() { void dispose() {
_liveTimer?.cancel();
_livePlayer?.stopPlay(); _livePlayer?.stopPlay();
TencentImPlugin.quitGroup(groupId: _streamInfoModel.groupId); TencentImPlugin.quitGroup(groupId: _streamInfoModel.groupId);
TencentImPlugin.removeListener(parseMessage); TencentImPlugin.removeListener(parseMessage);
@ -301,6 +330,47 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
super.dispose(); super.dispose();
} }
_buildWait() {
return _waitSignal
? BackdropFilter(
filter: ImageFilter.blur(
sigmaX: 5,
sigmaY: 5,
),
child: Container(
color: Colors.black54,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
R.ASSETS_LIVE_LIVE_ANIMAL_PNG,
height: rSize(107),
width: rSize(35),
),
rHBox(15),
Text(
'主播暂时离开',
style: TextStyle(
color: Colors.white,
fontSize: rSP(20),
),
),
rHBox(10),
Text(
'休息片刻,阿库陪你一起等待精彩',
style: TextStyle(
color: Color(0xFF999999),
fontSize: rSP(14),
),
),
],
),
),
)
: SizedBox();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -321,31 +391,58 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
await _livePlayer.setPlayerView(controller); await _livePlayer.setPlayerView(controller);
_livePlayer.startPlay(_streamInfoModel.playUrl, _livePlayer.startPlay(_streamInfoModel.playUrl,
type: PlayType.RTMP); type: PlayType.RTMP);
_livePlayer _livePlayer.setOnEventListener(
..setOnEventListener( onWarningReconnect: () {
onEventPlayEnd: () { reconnectToLive();
print('end'); },
}, onWarningVideoDecodeFail: () {
onEventPlayBegin: () { print('');
print('begin'); },
}, onWarningAudioDecodeFail: () {
onWarningServerConnFail: () { print('');
print('server conn fail'); },
}, onWarningRecvDataLag: () {
onWarningReconnect: () { print('');
print('reconn'); },
}, onWarningVideoPlayLag: () {
onWarningVideoPlayLag: () { print('');
print('video'); },
}, onWarningHwAccelerationFail: () {
onWarningRecvDataLag: () { print('');
print('data'); },
}, onWarningVideoDiscontinuity: () {
); print('');
},
onWarningDNSFail: () {
print('');
},
onWarningServerConnFail: () {
print('');
},
onWarningShakeFail: () {
print('');
},
onEventRcvFirstIFrame: () {
print('');
},
onEventPlayBegin: () {
print('1');
},
onEventPlayEnd: () {
print('`');
},
);
}, },
), ),
), ),
), ),
Positioned(
left: 0,
right: 0,
bottom: 0,
top: 0,
child: _buildWait(),
),
Positioned( Positioned(
left: 0, left: 0,
top: 0, top: 0,

@ -19,7 +19,7 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
List<GoodsWindowModel> models = []; List<GoodsWindowModel> models = [];
List<GoodsList> displayModels = []; List<GoodsList> displayModels = [];
List<int> _selectedIds = []; List<num> _selectedIds = [];
int page = 1; int page = 1;
bool _isManager = false; bool _isManager = false;
@ -129,12 +129,16 @@ class _GoodsWindowPageState extends State<GoodsWindowPage> {
}); });
}, },
onLoadMore: () { onLoadMore: () {
page++;
getGoodsWindowModels().then((model) { getGoodsWindowModels().then((model) {
setState(() { setState(() {
models.add(model); models.add(model);
displayModels.addAll(model.list); displayModels.addAll(model.list);
}); });
_controller.loadComplete(); if (model.list.isEmpty)
_controller.loadNoData();
else
_controller.loadComplete();
}).catchError((_) { }).catchError((_) {
_controller.loadFailed(); _controller.loadFailed();
}); });

@ -13,11 +13,13 @@ class UserActivityView extends StatefulWidget {
final int id; final int id;
final LiveBaseInfoModel userModel; final LiveBaseInfoModel userModel;
final bool initAttention; final bool initAttention;
final VoidCallback onRefresh;
UserActivityView( UserActivityView(
{Key key, {Key key,
@required this.id, @required this.id,
@required this.userModel, @required this.userModel,
@required this.initAttention}) @required this.initAttention,
this.onRefresh})
: super(key: key); : super(key: key);
@override @override
@ -51,6 +53,7 @@ class _UserActivityViewState extends State<UserActivityView>
controller: _controller, controller: _controller,
onRefresh: () { onRefresh: () {
_page = 1; _page = 1;
widget.onRefresh();
getActivityModels().then((models) { getActivityModels().then((models) {
setState(() { setState(() {
activityListModels = models; activityListModels = models;

@ -9,7 +9,9 @@ import 'package:recook/widgets/refresh_widget.dart';
class UserPlaybackView extends StatefulWidget { class UserPlaybackView extends StatefulWidget {
final int userId; final int userId;
UserPlaybackView({Key key, @required this.userId}) : super(key: key); final VoidCallback onRefresh;
UserPlaybackView({Key key, @required this.userId, this.onRefresh})
: super(key: key);
@override @override
_UserPlaybackViewState createState() => _UserPlaybackViewState(); _UserPlaybackViewState createState() => _UserPlaybackViewState();
@ -43,6 +45,7 @@ class _UserPlaybackViewState extends State<UserPlaybackView>
controller: _controller, controller: _controller,
onRefresh: () { onRefresh: () {
_page = 1; _page = 1;
widget.onRefresh();
getActivityVideoList().then((models) { getActivityVideoList().then((models) {
setState(() { setState(() {
_videoModels = models; _videoModels = models;

@ -216,8 +216,34 @@ class _UserHomePageState extends State<UserHomePage>
id: widget.userId, id: widget.userId,
userModel: model, userModel: model,
initAttention: selfFlag ? true : widget.initAttention, initAttention: selfFlag ? true : widget.initAttention,
onRefresh: () {
HttpManager.post(LiveAPI.baseInfo, {
'findUserId': widget.userId,
}).then((resultData) {
if (resultData?.data['data'] != null) {
setState(() {
model =
LiveBaseInfoModel.fromJson(resultData.data['data']);
});
}
});
},
),
UserPlaybackView(
userId: widget.userId,
onRefresh: () {
HttpManager.post(LiveAPI.baseInfo, {
'findUserId': widget.userId,
}).then((resultData) {
if (resultData?.data['data'] != null) {
setState(() {
model =
LiveBaseInfoModel.fromJson(resultData.data['data']);
});
}
});
},
), ),
UserPlaybackView(userId: widget.userId),
], ],
), ),
), ),

@ -2,7 +2,7 @@ name: recook
description: Recook Market App. description: Recook Market App.
publish_to: "none" publish_to: "none"
version: 1.3.0+190 version: 1.3.1+191
# sdk min version to 2.2.2 # sdk min version to 2.2.2
# to support ... feature # to support ... feature

Loading…
Cancel
Save