Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
gz_video_player
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
gz_video_player
Commits
45907799
提交
45907799
authored
9月 16, 2023
作者:
jungleiOS
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
旋转方向调用插件旋转
上级
e5b70717
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
50 行增加
和
48 行删除
+50
-48
project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+1
-0
pubspec.lock
example/pubspec.lock
+17
-17
video.dart
lib/video.dart
+11
-7
video_loading_view.dart
lib/widget/video_loading_view.dart
+21
-24
没有找到文件。
example/ios/Runner.xcodeproj/project.pbxproj
浏览文件 @
45907799
...
...
@@ -213,6 +213,7 @@
files
=
(
);
inputPaths
=
(
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
,
);
name
=
"Thin Binary"
;
outputPaths
=
(
...
...
example/pubspec.lock
浏览文件 @
45907799
...
...
@@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: async
sha256:
bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256:
"947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1
0
.0"
version: "2.1
1
.0"
boolean_selector:
dependency: transitive
description:
...
...
@@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256:
e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256:
"04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.
2.1
"
version: "1.
3.0
"
clock:
dependency: transitive
description:
...
...
@@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256:
cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256:
"4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.17.
0
"
version: "1.17.
1
"
connectivity:
dependency: transitive
description:
...
...
@@ -147,10 +147,10 @@ packages:
dependency: transitive
description:
name: js
sha256:
"5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
sha256:
f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.
5
"
version: "0.6.
7
"
lints:
dependency: transitive
description:
...
...
@@ -163,10 +163,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "
16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72
"
sha256: "
6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb
"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.1
3
"
version: "0.12.1
5
"
material_color_utilities:
dependency: transitive
description:
...
...
@@ -179,10 +179,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "
6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42
"
sha256: "
3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3
"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.
8.0
"
version: "1.
9.1
"
orientation:
dependency: transitive
description:
...
...
@@ -195,10 +195,10 @@ packages:
dependency: transitive
description:
name: path
sha256:
db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256:
"8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.
2
"
version: "1.8.
3
"
plugin_platform_interface:
dependency: transitive
description:
...
...
@@ -304,10 +304,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256:
ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256:
eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.
4.16
"
version: "0.
5.1
"
vector_math:
dependency: transitive
description:
...
...
@@ -405,5 +405,5 @@ packages:
source: hosted
version: "3.1.4"
sdks:
dart: ">=
2.19.6 <3
.0.0"
dart: ">=
3.0.0-0 <4
.0.0"
flutter: ">=3.7.0"
lib/video.dart
浏览文件 @
45907799
...
...
@@ -122,7 +122,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
/// 屏幕亮度
final
ValueNotifier
<
double
>
_brightness
=
ValueNotifier
(
0.0
);
late
double
_originBrightness
;
double
?
_originBrightness
;
/// 视频音量
final
ValueNotifier
<
double
>
_volume
=
ValueNotifier
(
0.5
);
...
...
@@ -224,15 +224,12 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
/// 常亮
Wakelock
.
toggle
(
enable:
true
);
/// 初始化亮度为系统亮度
initBrightness
();
/// 倍数按钮标题
_speedTitle
=
widget
.
videoStyle
.
videoSpeedButtonStyle
.
title
;
_initPlayer
();
}
void
initBrightness
()
async
{
Future
<
void
>
initBrightness
()
async
{
double
brightness
=
await
ScreenBrightness
().
current
;
_brightness
.
value
=
brightness
;
_originBrightness
=
brightness
;
...
...
@@ -253,13 +250,15 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
_controlBarAnimationController
.
dispose
();
///恢复设备竖屏
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
]);
//
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
OrientationPlugin
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
]);
Wakelock
.
toggle
(
enable:
false
);
_subscription
.
cancel
();
_brightness
.
dispose
();
_volume
.
dispose
();
ScreenBrightness
().
setScreenBrightness
(
_originBrightness
);
if
(
_originBrightness
!=
null
)
{
ScreenBrightness
().
setScreenBrightness
(
_originBrightness
!);
}
super
.
dispose
();
}
...
...
@@ -400,8 +399,10 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
/// 点击全屏或取消
void
toggleFullScreen
()
{
if
(
_fullScreened
)
{
// SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
OrientationPlugin
.
forceOrientation
(
DeviceOrientation
.
portraitUp
);
}
else
{
// SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeRight]);
OrientationPlugin
.
forceOrientation
(
DeviceOrientation
.
landscapeRight
);
}
}
...
...
@@ -816,6 +817,9 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
}
_volume
.
value
=
_controller
.
value
.
volume
;
}
else
{
if
(
_originBrightness
==
null
)
{
await
initBrightness
();
}
// 左侧垂直滑动 - 亮度调节
if
(
details
.
primaryDelta
!
>
0
)
{
//往下滑动
...
...
lib/widget/video_loading_view.dart
浏览文件 @
45907799
...
...
@@ -8,30 +8,27 @@ class VideoLoadingView extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
DecoratedBox
(
decoration:
const
BoxDecoration
(
color:
Colors
.
black
),
child:
Align
(
alignment:
Alignment
.
center
,
child:
Center
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
loadingStyle
.
customLoadingIcon
,
loadingStyle
.
customLoadingText
!=
null
?
loadingStyle
.
customLoadingText
!
:
Container
(
margin:
const
EdgeInsets
.
only
(
top:
10
),
child:
Text
(
loadingStyle
.
loadingText
,
style:
TextStyle
(
color:
loadingStyle
.
loadingTextFontColor
,
fontSize:
loadingStyle
.
loadingTextFontSize
,
),
),
)
],
),
return
Align
(
alignment:
Alignment
.
center
,
child:
Center
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
loadingStyle
.
customLoadingIcon
,
loadingStyle
.
customLoadingText
!=
null
?
loadingStyle
.
customLoadingText
!
:
Container
(
margin:
const
EdgeInsets
.
only
(
top:
10
),
child:
Text
(
loadingStyle
.
loadingText
,
style:
TextStyle
(
color:
loadingStyle
.
loadingTextFontColor
,
fontSize:
loadingStyle
.
loadingTextFontSize
,
),
),
)
],
),
),
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论