|
@@ -27,6 +27,7 @@ import 'package:liftmanager/internal/account/account_router.dart';
|
|
import 'package:flustars/flustars.dart' as FlutterStars;
|
|
import 'package:flustars/flustars.dart' as FlutterStars;
|
|
import 'package:liftmanager/common/common.dart';
|
|
import 'package:liftmanager/common/common.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter/services.dart';
|
|
|
|
+import 'package:orientation/orientation.dart';
|
|
|
|
|
|
class VideoDetail extends StatefulWidget {
|
|
class VideoDetail extends StatefulWidget {
|
|
VideoDetail(this.id);
|
|
VideoDetail(this.id);
|
|
@@ -43,8 +44,10 @@ class VideoDetailState extends State<VideoDetail> {
|
|
@override
|
|
@override
|
|
void initState() {
|
|
void initState() {
|
|
super.initState();
|
|
super.initState();
|
|
- getVideoDetail();
|
|
|
|
-
|
|
|
|
|
|
+ // getVideoDetail();
|
|
|
|
+ Future.delayed(Duration(milliseconds: 100),(){
|
|
|
|
+ getVideoDetail();
|
|
|
|
+ });
|
|
// SystemChrome.setPreferredOrientations([
|
|
// SystemChrome.setPreferredOrientations([
|
|
// DeviceOrientation.portraitUp,
|
|
// DeviceOrientation.portraitUp,
|
|
// ]);
|
|
// ]);
|
|
@@ -57,6 +60,7 @@ class VideoDetailState extends State<VideoDetail> {
|
|
VideoPlayerController _controller;
|
|
VideoPlayerController _controller;
|
|
|
|
|
|
Future getVideoDetail() async {
|
|
Future getVideoDetail() async {
|
|
|
|
+ print("-/-/-/-////////////////////////-----------");
|
|
await NewApiService().getVideoDetail(int.parse(widget.id), 1,
|
|
await NewApiService().getVideoDetail(int.parse(widget.id), 1,
|
|
onSuccess: (res) {
|
|
onSuccess: (res) {
|
|
if (res != null) {
|
|
if (res != null) {
|
|
@@ -172,13 +176,26 @@ class VideoDetailState extends State<VideoDetail> {
|
|
void dispose() {
|
|
void dispose() {
|
|
_controller.pause();
|
|
_controller.pause();
|
|
_controller.dispose();
|
|
_controller.dispose();
|
|
|
|
+ // SystemChrome.setPreferredOrientations([
|
|
|
|
+ // DeviceOrientation.portraitUp,
|
|
|
|
+ // ]);
|
|
|
|
+ OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp);
|
|
super.dispose();
|
|
super.dispose();
|
|
}
|
|
}
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
double width = MediaQuery.of(context).size.width;
|
|
double width = MediaQuery.of(context).size.width;
|
|
-
|
|
|
|
|
|
+ double height = MediaQuery.of(context).size.height;
|
|
|
|
+ print(width);
|
|
|
|
+ print(height);
|
|
|
|
+ print(12345678);
|
|
|
|
+ if(width < height){
|
|
|
|
+ // SystemChrome.setPreferredOrientations([
|
|
|
|
+ // DeviceOrientation.portraitUp,
|
|
|
|
+ // ]);
|
|
|
|
+ OrientationPlugin.forceOrientation(DeviceOrientation.portraitUp);
|
|
|
|
+ }
|
|
return Scaffold(
|
|
return Scaffold(
|
|
resizeToAvoidBottomPadding: false, //不让键盘弹上去
|
|
resizeToAvoidBottomPadding: false, //不让键盘弹上去
|
|
appBar: MyAppBar(
|
|
appBar: MyAppBar(
|
|
@@ -212,7 +229,7 @@ class VideoDetailState extends State<VideoDetail> {
|
|
looping: true,
|
|
looping: true,
|
|
// startAt: Duration(seconds: 1,minutes: 1),
|
|
// startAt: Duration(seconds: 1,minutes: 1),
|
|
showControls: true,
|
|
showControls: true,
|
|
- deviceOrientationsAfterFullScreen:[DeviceOrientation.portraitUp,],
|
|
|
|
|
|
+ deviceOrientationsAfterFullScreen:[DeviceOrientation.portraitUp],
|
|
// 占位图
|
|
// 占位图
|
|
// placeholder: Image.network(
|
|
// placeholder: Image.network(
|
|
// imgFontUrl+detailObj.cover,
|
|
// imgFontUrl+detailObj.cover,
|