添加录播开关

master
laiiihz 5 years ago
parent f04e9d50a1
commit 6e0ed83332

@ -535,4 +535,6 @@ class LiveAPI {
///
static const String liveAgree = '/v1/live/live/agree';
static const String recordLive = '/v1/live/live/transcribe';
}

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:recook/constants/api.dart';
import 'package:recook/constants/header.dart';
@ -35,6 +36,7 @@ class LiveBlurPage extends StatefulWidget {
class _LiveBlurPageState extends State<LiveBlurPage> {
bool _isAttention = false;
bool _saveVideo = false;
@override
void initState() {
super.initState();
@ -142,7 +144,8 @@ class _LiveBlurPageState extends State<LiveBlurPage> {
endIndent: rSize(16),
),
GridView(
padding: EdgeInsets.symmetric(horizontal: rSize(54)),
padding: EdgeInsets.symmetric(
horizontal: rSize(54), vertical: 0),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3),
children: [
@ -157,7 +160,38 @@ class _LiveBlurPageState extends State<LiveBlurPage> {
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
),
rHBox(82),
Divider(
height: rSize(40),
thickness: rSize(1),
color: Colors.white.withOpacity(0.06),
indent: rSize(16),
endIndent: rSize(16),
),
Row(
children: [
Spacer(),
Text(
'直播保存',
style: TextStyle(
color: Colors.white,
fontSize: rSP(16),
),
),
rWBox(20),
CupertinoSwitch(
value: _saveVideo,
onChanged: (state) {
setState(() {
_saveVideo = !_saveVideo;
});
},
activeColor: Color(0xFFDB2D2D),
trackColor: Color(0x99D8D8D8),
),
rWBox(45),
],
),
rHBox(32),
MaterialButton(
height: rSize(40),
minWidth: rSize(209),
@ -169,6 +203,12 @@ class _LiveBlurPageState extends State<LiveBlurPage> {
),
),
onPressed: () {
if (_saveVideo)
HttpManager.post(LiveAPI.recordLive, {
'liveItemId': widget.streamModel.id,
}).then((result) {
print(result);
});
Navigator.pop(context);
},
color: Color(0xFFDB2D2D),
@ -256,6 +296,7 @@ class _LiveBlurPageState extends State<LiveBlurPage> {
_buildColumn(String title, String subTitle) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
title,

@ -689,12 +689,13 @@ class _LivePageState extends State<LivePage> {
if (resultData?.data['data'] == null)
Navigator.pop(context);
else {
CRoute.transparent(
CRoute.pushReplace(
context,
LiveBlurPage(
context: context,
isLive: true,
exitModel: LiveExitModel.fromJson(resultData.data['data']),
streamModel: _streamInfoModel,
));
}
});

Loading…
Cancel
Save