Merge branch 'feature-media_kit'
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -16,11 +17,15 @@ import 'package:media_kit/media_kit.dart'; // Provides [Player], [Media], [Playl
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
await GStrorage.init();
|
||||
runApp(const MyApp());
|
||||
await Request.setCookie();
|
||||
await Data.init();
|
||||
await GStrorage.lazyInit();
|
||||
SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown])
|
||||
.then((_) async {
|
||||
await GStrorage.init();
|
||||
runApp(const MyApp());
|
||||
await Request.setCookie();
|
||||
await Data.init();
|
||||
await GStrorage.lazyInit();
|
||||
});
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
@ -504,12 +504,14 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final double dy = details.delta.dy;
|
||||
const double threshold = 7.0; // 滑动阈值
|
||||
if (dy > _distance && dy > threshold) {
|
||||
if (!_.isFullScreen.value) {
|
||||
if (_.isFullScreen.value) {
|
||||
// 下滑退出全屏
|
||||
await triggerFullScreen();
|
||||
}
|
||||
_distance = 0.0;
|
||||
} else if (dy < _distance && dy < -threshold) {
|
||||
if (_.isFullScreen.value) {
|
||||
if (!_.isFullScreen.value) {
|
||||
// 上滑进入全屏
|
||||
await triggerFullScreen();
|
||||
}
|
||||
_distance = 0.0;
|
||||
|
@ -144,7 +144,7 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
|
||||
() => ComBtn(
|
||||
icon: Icon(
|
||||
_.isFullScreen.value
|
||||
? FontAwesomeIcons.a
|
||||
? FontAwesomeIcons.compress
|
||||
: FontAwesomeIcons.expand,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
|
Reference in New Issue
Block a user