Browse Source

视频缩放适配更改

ff_new
w-R 3 years ago
parent
commit
ca18b4a0fa
  1. 31
      lib/community/community_view/class_details.dart
  2. 2
      lib/settlement/settlement.dart
  3. 2
      lib/union/union_page.dart

31
lib/community/community_view/class_details.dart

@ -4,6 +4,7 @@ import 'package:chewie/chewie.dart';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
@ -395,9 +396,23 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
});
}
bool tempDelayedFlag = false;
Future<void> _fullScreenListener() async {
if (!chewieAudioController.isFullScreen) {
Future.delayed(Duration(seconds: 1), () {});
if (!chewieAudioController.isFullScreen && !tempDelayedFlag) {
tempDelayedFlag = true;
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
setState(() {});
SystemChrome.setPreferredOrientations(
[DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
Future.delayed(Duration(seconds: 1), () {
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
setState(() {
tempDelayedFlag = false;
});
});
}
}
@ -420,27 +435,25 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
width: width,
height: height,
)),
if(isShowImg)
if (isShowImg)
GestureDetector(
onTap: () {
setState(() {
isShowImg = false;
if(chewieAudioController != null)
if (chewieAudioController != null)
chewieAudioController.play();
});
},
child: Container(
width: width,
height: height,
height: width / 7 * 6,
color: Colors.black,
child: Stack(
children: [
Center(
child: MImage(
src,
width:width,
height: height,
fit: BoxFit.fill,
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
@ -501,7 +514,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
setState(() {
chapterIndex = position;
isShowImg = true;
if(chewieAudioController != null)
if (chewieAudioController != null)
chewieAudioController.pause();
initVideo(chapterList[position].content.fileUrl);
});

2
lib/settlement/settlement.dart

@ -333,7 +333,7 @@ class _Settlement extends State<Settlement> {
"id": orderId,
},
);
Navigator.of(context).pop();
// Navigator.of(context).pop();
}
@override

2
lib/union/union_page.dart

@ -234,7 +234,7 @@ class _UnionPage extends State<UnionPage>
PreferredSize(
preferredSize: Size(double.infinity, 52.h),
child: Container(
padding: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.only(top:15.h),
color: Color(0xFFFAFAFA),
child: ItemTitle(
text: S.of(context).jingbilianmenghuiyuandian,

Loading…
Cancel
Save