Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
gz_video_player
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
gz_video_player
Commits
b8879532
提交
b8879532
authored
9月 17, 2023
作者:
jungleiOS
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
替换旋转插件 修复iOS旋转后再次进入视频播放器后横屏幕
上级
45907799
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
352 行增加
和
109 行删除
+352
-109
gradle-wrapper.jar
android/gradle/wrapper/gradle-wrapper.jar
+0
-0
gradle-wrapper.properties
android/gradle/wrapper/gradle-wrapper.properties
+5
-0
gradlew
android/gradlew
+234
-0
gradlew.bat
android/gradlew.bat
+89
-0
Podfile.lock
example/ios/Podfile.lock
+6
-6
pubspec.lock
example/pubspec.lock
+10
-9
OrientationPlugin+Hook.h
ios/Classes/OrientationPlugin+Hook.h
+0
-16
OrientationPlugin+Hook.m
ios/Classes/OrientationPlugin+Hook.m
+0
-73
video.dart
lib/video.dart
+4
-4
pubspec.yaml
pubspec.yaml
+4
-1
没有找到文件。
android/gradle/wrapper/gradle-wrapper.jar
0 → 100644
浏览文件 @
b8879532
File added
android/gradle/wrapper/gradle-wrapper.properties
0 → 100644
浏览文件 @
b8879532
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
android/gradlew
0 → 100755
浏览文件 @
b8879532
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path
=
$0
# Need this for daisy-chained symlinks.
while
APP_HOME
=
${
app_path
%
"
${
app_path
##*/
}
"
}
# leaves a trailing /; empty if no leading path
[
-h
"
$app_path
"
]
do
ls
=
$(
ls
-ld
"
$app_path
"
)
link
=
${
ls
#*
' -> '
}
case
$link
in
#(
/
*
)
app_path
=
$link
;;
#(
*
)
app_path
=
$APP_HOME$link
;;
esac
done
APP_HOME
=
$(
cd
"
${
APP_HOME
:-
./
}
"
&&
pwd
-P
)
||
exit
APP_NAME
=
"Gradle"
APP_BASE_NAME
=
${
0
##*/
}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS
=
'"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD
=
maximum
warn
()
{
echo
"
$*
"
}
>
&2
die
()
{
echo
echo
"
$*
"
echo
exit
1
}
>
&2
# OS specific support (must be 'true' or 'false').
cygwin
=
false
msys
=
false
darwin
=
false
nonstop
=
false
case
"
$(
uname
)
"
in
#(
CYGWIN
*
)
cygwin
=
true
;;
#(
Darwin
*
)
darwin
=
true
;;
#(
MSYS
*
|
MINGW
*
)
msys
=
true
;;
#(
NONSTOP
*
)
nonstop
=
true
;;
esac
CLASSPATH
=
$APP_HOME
/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if
[
-n
"
$JAVA_HOME
"
]
;
then
if
[
-x
"
$JAVA_HOME
/jre/sh/java"
]
;
then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD
=
$JAVA_HOME
/jre/sh/java
else
JAVACMD
=
$JAVA_HOME
/bin/java
fi
if
[
!
-x
"
$JAVACMD
"
]
;
then
die
"ERROR: JAVA_HOME is set to an invalid directory:
$JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD
=
java
which java
>
/dev/null 2>&1
||
die
"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if
!
"
$cygwin
"
&&
!
"
$darwin
"
&&
!
"
$nonstop
"
;
then
case
$MAX_FD
in
#(
max
*
)
MAX_FD
=
$(
ulimit
-H
-n
)
||
warn
"Could not query maximum file descriptor limit"
esac
case
$MAX_FD
in
#(
''
|
soft
)
:
;;
#(
*
)
ulimit
-n
"
$MAX_FD
"
||
warn
"Could not set maximum file descriptor limit to
$MAX_FD
"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if
"
$cygwin
"
||
"
$msys
"
;
then
APP_HOME
=
$(
cygpath
--path
--mixed
"
$APP_HOME
"
)
CLASSPATH
=
$(
cygpath
--path
--mixed
"
$CLASSPATH
"
)
JAVACMD
=
$(
cygpath
--unix
"
$JAVACMD
"
)
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for
arg
do
if
case
$arg
in
#(
-
*
)
false
;;
# don't mess with options #(
/?
*
)
t
=
${
arg
#/
}
t
=
/
${
t
%%/*
}
# looks like a POSIX filepath
[
-e
"
$t
"
]
;;
#(
*
)
false
;;
esac
then
arg
=
$(
cygpath
--path
--ignore
--mixed
"
$arg
"
)
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift
# remove old arg
set
--
"
$@
"
"
$arg
"
# push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set
--
\
"-Dorg.gradle.appname=
$APP_BASE_NAME
"
\
-classpath
"
$CLASSPATH
"
\
org.gradle.wrapper.GradleWrapperMain
\
"
$@
"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval
"set --
$(
printf
'%s\n'
"
$DEFAULT_JVM_OPTS
$JAVA_OPTS
$GRADLE_OPTS
"
|
xargs
-n1
|
sed
' s~[^-[:alnum:]+,./:=@_]~\\&~g; '
|
tr
'\n'
' '
)
"
'"$@"'
exec
"
$JAVACMD
"
"
$@
"
android/gradlew.bat
0 → 100644
浏览文件 @
b8879532
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
example/ios/Podfile.lock
浏览文件 @
b8879532
...
@@ -3,9 +3,9 @@ PODS:
...
@@ -3,9 +3,9 @@ PODS:
- Flutter
- Flutter
- Reachability
- Reachability
- Flutter (1.0.0)
- Flutter (1.0.0)
- gz_
video_player
(0.0.1):
- gz_
orientation
(0.0.1):
- Flutter
- Flutter
-
orientation
(0.0.1):
-
gz_video_player
(0.0.1):
- Flutter
- Flutter
- Reachability (3.2)
- Reachability (3.2)
- screen_brightness_ios (0.1.0):
- screen_brightness_ios (0.1.0):
...
@@ -18,8 +18,8 @@ PODS:
...
@@ -18,8 +18,8 @@ PODS:
DEPENDENCIES:
DEPENDENCIES:
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- Flutter (from `Flutter`)
- Flutter (from `Flutter`)
- gz_orientation (from `.symlinks/plugins/gz_orientation/ios`)
- gz_video_player (from `.symlinks/plugins/gz_video_player/ios`)
- gz_video_player (from `.symlinks/plugins/gz_video_player/ios`)
- orientation (from `.symlinks/plugins/orientation/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
- screen_brightness_ios (from `.symlinks/plugins/screen_brightness_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
...
@@ -33,10 +33,10 @@ EXTERNAL SOURCES:
...
@@ -33,10 +33,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/connectivity/ios"
:path: ".symlinks/plugins/connectivity/ios"
Flutter:
Flutter:
:path: Flutter
:path: Flutter
gz_orientation:
:path: ".symlinks/plugins/gz_orientation/ios"
gz_video_player:
gz_video_player:
:path: ".symlinks/plugins/gz_video_player/ios"
:path: ".symlinks/plugins/gz_video_player/ios"
orientation:
:path: ".symlinks/plugins/orientation/ios"
screen_brightness_ios:
screen_brightness_ios:
:path: ".symlinks/plugins/screen_brightness_ios/ios"
:path: ".symlinks/plugins/screen_brightness_ios/ios"
video_player_avfoundation:
video_player_avfoundation:
...
@@ -47,8 +47,8 @@ EXTERNAL SOURCES:
...
@@ -47,8 +47,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
SPEC CHECKSUMS:
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
gz_orientation: 150ba27fd756b50212008ab53db4f4d5c3f62489
gz_video_player: ebc14497d390b6c08d115ab4f3aa27f282401a28
gz_video_player: ebc14497d390b6c08d115ab4f3aa27f282401a28
orientation: 6c9203efe86ce4cff379756910f18b2d745628c3
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
...
...
example/pubspec.lock
浏览文件 @
b8879532
...
@@ -128,6 +128,15 @@ packages:
...
@@ -128,6 +128,15 @@ packages:
description: flutter
description: flutter
source: sdk
source: sdk
version: "0.0.0"
version: "0.0.0"
gz_orientation:
dependency: transitive
description:
path: "."
ref: dev
resolved-ref: "35ad85697c505fe1fa3565857385df6bdb483e29"
url: "http://code.seevin.com/18223204110/gz_orientation.git"
source: git
version: "0.0.1"
gz_video_player:
gz_video_player:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -183,14 +192,6 @@ packages:
...
@@ -183,14 +192,6 @@ packages:
url: "https://pub.flutter-io.cn"
url: "https://pub.flutter-io.cn"
source: hosted
source: hosted
version: "1.9.1"
version: "1.9.1"
orientation:
dependency: transitive
description:
name: orientation
sha256: "16f229c87220a897db803456e0709364ffb25fc4405df0e3214bef99fa91d81c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
path:
path:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -405,5 +406,5 @@ packages:
...
@@ -405,5 +406,5 @@ packages:
source: hosted
source: hosted
version: "3.1.4"
version: "3.1.4"
sdks:
sdks:
dart: ">=3.0.
0-0
<4.0.0"
dart: ">=3.0.
1
<4.0.0"
flutter: ">=3.7.0"
flutter: ">=3.7.0"
ios/Classes/OrientationPlugin+Hook.h
deleted
100644 → 0
浏览文件 @
45907799
//
// OrientationPlugin+Hook.h
// Runner
//
// Created by 蒋俊 on 2023/9/13.
//
#import "OrientationPlugin.h"
NS_ASSUME_NONNULL_BEGIN
@interface
OrientationPlugin
(
Hook
)
@end
NS_ASSUME_NONNULL_END
ios/Classes/OrientationPlugin+Hook.m
deleted
100644 → 0
浏览文件 @
45907799
//
// OrientationPlugin+Hook.m
// Runner
//
// Created by 蒋俊 on 2023/9/13.
//
#import "OrientationPlugin+Hook.h"
#import <objc/runtime.h>
@implementation
OrientationPlugin
(
Hook
)
+
(
void
)
load
{
Method
originalMethod
=
class_getInstanceMethod
(
self
,
NSSelectorFromString
(
@"forceOrientation:"
));
Method
swizzledMethod
=
class_getInstanceMethod
(
self
,
@selector
(
hook_forceOrientation
:
));
method_exchangeImplementations
(
originalMethod
,
swizzledMethod
);
}
-
(
void
)
hook_forceOrientation
:
(
NSString
*
)
orientation
{
// 若想在 iOS 16 上强制旋转生效
// 1.请在 AppDelegate 中加入如下代码,允许所有旋转方向
// 2.在Xcode中,选中General> Targets下的“Requires Full Screen”复选框,
// - (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
//
// return UIInterfaceOrientationMaskAll;
// }
if
(
@available
(
iOS
16
.
0
,
*
))
{
UIWindowSceneGeometryPreferencesIOS
*
perference
=
[[
UIWindowSceneGeometryPreferencesIOS
alloc
]
init
];
if
([
orientation
isEqualToString
:
@"DeviceOrientation.portraitUp"
])
{
perference
.
interfaceOrientations
=
UIInterfaceOrientationMaskPortrait
;
[
self
requestGeometryUpdateWithPreferences
:
perference
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.portraitDown"
])
{
perference
.
interfaceOrientations
=
UIInterfaceOrientationMaskPortraitUpsideDown
;
[
self
requestGeometryUpdateWithPreferences
:
perference
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.landscapeLeft"
])
{
perference
.
interfaceOrientations
=
UIInterfaceOrientationMaskLandscapeLeft
;
[
self
requestGeometryUpdateWithPreferences
:
perference
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.landscapeRight"
])
{
perference
.
interfaceOrientations
=
UIInterfaceOrientationMaskLandscapeRight
;
[
self
requestGeometryUpdateWithPreferences
:
perference
];
}
else
{
perference
.
interfaceOrientations
=
UIInterfaceOrientationMaskPortrait
;
[
self
requestGeometryUpdateWithPreferences
:
perference
];
}
}
else
{
if
([
orientation
isEqualToString
:
@"DeviceOrientation.portraitUp"
])
{
[[
UIDevice
currentDevice
]
setValue
:
@
(
UIInterfaceOrientationPortrait
)
forKey
:
@"orientation"
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.portraitDown"
])
{
[[
UIDevice
currentDevice
]
setValue
:
@
(
UIInterfaceOrientationPortraitUpsideDown
)
forKey
:
@"orientation"
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.landscapeLeft"
])
{
[[
UIDevice
currentDevice
]
setValue
:
@
(
UIInterfaceOrientationLandscapeLeft
)
forKey
:
@"orientation"
];
}
else
if
([
orientation
isEqualToString
:
@"DeviceOrientation.landscapeRight"
])
{
[[
UIDevice
currentDevice
]
setValue
:
@
(
UIInterfaceOrientationLandscapeRight
)
forKey
:
@"orientation"
];
}
else
{
[[
UIDevice
currentDevice
]
setValue
:
@
(
UIInterfaceOrientationUnknown
)
forKey
:
@"orientation"
];
}
}
}
-
(
void
)
requestGeometryUpdateWithPreferences
:
(
UIWindowSceneGeometryPreferences
*
)
geometryPreferences
API_AVAILABLE
(
ios
(
16
.
0
)){
UIWindowScene
*
windowScene
=
(
UIWindowScene
*
)[[[
UIApplication
sharedApplication
]
connectedScenes
]
allObjects
].
firstObject
;
[
UIViewController
attemptRotationToDeviceOrientation
];
[
windowScene
requestGeometryUpdateWithPreferences
:
geometryPreferences
errorHandler
:
^
(
NSError
*
_Nonnull
error
)
{
NSLog
(
@"error--%@"
,
error
);
}];
UIWindow
*
keyWindow
=
[
UIApplication
sharedApplication
].
keyWindow
;
if
(
keyWindow
!=
NULL
)
{
[
keyWindow
.
rootViewController
setNeedsUpdateOfSupportedInterfaceOrientations
];
}
}
@end
lib/video.dart
浏览文件 @
b8879532
...
@@ -4,6 +4,7 @@ import 'dart:io';
...
@@ -4,6 +4,7 @@ import 'dart:io';
import
'package:connectivity/connectivity.dart'
;
import
'package:connectivity/connectivity.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:gz_orientation/gz_orientation.dart'
;
import
'package:gz_video_player/video_play_options.dart'
;
import
'package:gz_video_player/video_play_options.dart'
;
import
'package:gz_video_player/video_speed.dart'
;
import
'package:gz_video_player/video_speed.dart'
;
import
'package:gz_video_player/video_style.dart'
;
import
'package:gz_video_player/video_style.dart'
;
...
@@ -15,7 +16,6 @@ import 'package:gz_video_player/widget/video_loading_view.dart';
...
@@ -15,7 +16,6 @@ import 'package:gz_video_player/widget/video_loading_view.dart';
import
'package:gz_video_player/widget/video_speed_bar.dart'
;
import
'package:gz_video_player/widget/video_speed_bar.dart'
;
import
'package:gz_video_player/widget/video_top_bar.dart'
;
import
'package:gz_video_player/widget/video_top_bar.dart'
;
import
'package:gz_video_player/widget/volume.dart'
;
import
'package:gz_video_player/widget/volume.dart'
;
import
'package:orientation/orientation.dart'
;
import
'package:screen_brightness/screen_brightness.dart'
;
import
'package:screen_brightness/screen_brightness.dart'
;
import
'package:video_player/video_player.dart'
;
import
'package:video_player/video_player.dart'
;
import
'package:wakelock/wakelock.dart'
;
import
'package:wakelock/wakelock.dart'
;
...
@@ -251,7 +251,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
...
@@ -251,7 +251,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
///恢复设备竖屏
///恢复设备竖屏
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
OrientationPlugi
n
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
]);
GzOrientatio
n
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
]);
Wakelock
.
toggle
(
enable:
false
);
Wakelock
.
toggle
(
enable:
false
);
_subscription
.
cancel
();
_subscription
.
cancel
();
_brightness
.
dispose
();
_brightness
.
dispose
();
...
@@ -400,10 +400,10 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
...
@@ -400,10 +400,10 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
void
toggleFullScreen
()
{
void
toggleFullScreen
()
{
if
(
_fullScreened
)
{
if
(
_fullScreened
)
{
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
OrientationPlugi
n
.
forceOrientation
(
DeviceOrientation
.
portraitUp
);
GzOrientatio
n
.
forceOrientation
(
DeviceOrientation
.
portraitUp
);
}
else
{
}
else
{
// SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeRight]);
// SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeRight]);
OrientationPlugi
n
.
forceOrientation
(
DeviceOrientation
.
landscapeRight
);
GzOrientatio
n
.
forceOrientation
(
DeviceOrientation
.
landscapeRight
);
}
}
}
}
...
...
pubspec.yaml
浏览文件 @
b8879532
...
@@ -12,10 +12,13 @@ dependencies:
...
@@ -12,10 +12,13 @@ dependencies:
sdk
:
flutter
sdk
:
flutter
plugin_platform_interface
:
^2.0.2
plugin_platform_interface
:
^2.0.2
video_player
:
^2.7.0
video_player
:
^2.7.0
orientation
:
^1.3.0
connectivity
:
^3.0.6
connectivity
:
^3.0.6
screen_brightness
:
^0.2.2+1
screen_brightness
:
^0.2.2+1
wakelock
:
^0.6.2
wakelock
:
^0.6.2
gz_orientation
:
git
:
url
:
http://code.seevin.com/18223204110/gz_orientation.git
ref
:
dev
dev_dependencies
:
dev_dependencies
:
flutter_test
:
flutter_test
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论