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