Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
gz_video_player
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
gz_video_player
Commits
2abe3aa0
提交
2abe3aa0
authored
9月 15, 2023
作者:
jungleiOS
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ios 滑动亮度卡顿问题修复
上级
f424eed8
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
11 行删除
+9
-11
video.dart
lib/video.dart
+7
-5
video_play_options.dart
lib/video_play_options.dart
+2
-6
没有找到文件。
lib/video.dart
浏览文件 @
2abe3aa0
...
@@ -218,9 +218,12 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
...
@@ -218,9 +218,12 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
DeviceOrientation
.
landscapeLeft
,
DeviceOrientation
.
landscapeLeft
,
DeviceOrientation
.
landscapeRight
,
DeviceOrientation
.
landscapeRight
,
]);
]);
// 常亮
//
/
常亮
Wakelock
.
toggle
(
enable:
true
);
Wakelock
.
toggle
(
enable:
true
);
/// 初始化亮度为系统亮度
ScreenBrightness
().
current
.
then
((
brightness
)
{
_brightness
.
value
=
brightness
;
});
/// 倍数按钮标题
/// 倍数按钮标题
_speedTitle
=
widget
.
videoStyle
.
videoSpeedButtonStyle
.
title
;
_speedTitle
=
widget
.
videoStyle
.
videoSpeedButtonStyle
.
title
;
_initPlayer
();
_initPlayer
();
...
@@ -805,10 +808,9 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
...
@@ -805,10 +808,9 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
_volume
.
value
=
_controller
.
value
.
volume
;
_volume
.
value
=
_controller
.
value
.
volume
;
}
else
{
}
else
{
// 左侧垂直滑动 - 亮度调节
// 左侧垂直滑动 - 亮度调节
_brightness
.
value
=
await
ScreenBrightness
().
current
;
if
(
details
.
primaryDelta
!
>
0
)
{
if
(
details
.
primaryDelta
!
>
0
)
{
//往下滑动
//往下滑动
_brightness
.
value
-=
widget
.
playOptions
.
brightnessGestureUnit
;
_brightness
.
value
=
_brightness
.
value
-
widget
.
playOptions
.
brightnessGestureUnit
;
widget
.
onBrightness
?.
call
(
_brightness
.
value
);
widget
.
onBrightness
?.
call
(
_brightness
.
value
);
if
(
_brightness
.
value
<=
0
)
{
if
(
_brightness
.
value
<=
0
)
{
_brightness
.
value
=
0.0
;
_brightness
.
value
=
0.0
;
...
@@ -817,7 +819,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
...
@@ -817,7 +819,7 @@ class GZVideoPlayerState extends State<GZVideoPlayer>
await
ScreenBrightness
().
setScreenBrightness
(
_brightness
.
value
);
await
ScreenBrightness
().
setScreenBrightness
(
_brightness
.
value
);
}
else
{
}
else
{
//往上滑动
//往上滑动
_brightness
.
value
+=
widget
.
playOptions
.
brightnessGestureUnit
;
_brightness
.
value
=
_brightness
.
value
+
widget
.
playOptions
.
brightnessGestureUnit
;
widget
.
onBrightness
?.
call
(
_brightness
.
value
);
widget
.
onBrightness
?.
call
(
_brightness
.
value
);
if
(
_brightness
.
value
>=
1
)
{
if
(
_brightness
.
value
>=
1
)
{
_brightness
.
value
=
1.0
;
_brightness
.
value
=
1.0
;
...
...
lib/video_play_options.dart
浏览文件 @
2abe3aa0
import
'dart:io'
;
import
'package:gz_video_player/video_speed.dart'
;
import
'package:gz_video_player/video_speed.dart'
;
/// 自定义播放参数
/// 自定义播放参数
...
@@ -11,13 +9,11 @@ class VideoPlayOptions {
...
@@ -11,13 +9,11 @@ class VideoPlayOptions {
this
.
seekSeconds
=
15
,
this
.
seekSeconds
=
15
,
this
.
progressGestureUnit
=
1000
,
this
.
progressGestureUnit
=
1000
,
this
.
volumeGestureUnit
=
0.005
,
this
.
volumeGestureUnit
=
0.005
,
double
?
brightnessGestureUnit
,
this
.
brightnessGestureUnit
=
0.005
,
this
.
autoplay
=
true
,
this
.
autoplay
=
true
,
this
.
allowScrubbing
=
true
,
this
.
allowScrubbing
=
true
,
List
<
VideoSpeedItem
>?
speedList
,
List
<
VideoSpeedItem
>?
speedList
,
})
:
brightnessGestureUnit
=
})
:
speedList
=
speedList
??
brightnessGestureUnit
??
(
Platform
.
isIOS
?
0.01
:
0.005
),
speedList
=
speedList
??
[
[
VideoSpeedItem
(
speed:
0.5
,
title:
'0.5X'
),
VideoSpeedItem
(
speed:
0.5
,
title:
'0.5X'
),
VideoSpeedItem
(
speed:
0.75
,
title:
'0.75X'
),
VideoSpeedItem
(
speed:
0.75
,
title:
'0.75X'
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论