opt: 封面点击播放+弹幕发送标识
This commit is contained in:
@ -306,9 +306,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Obx(() => SliverAppBar(
|
Obx(() => SliverAppBar(
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
// 假装使用一个非空变量,避免Obx检测不到而罢工
|
// 假装使用一个非空变量,避免Obx检测不到而罢工
|
||||||
pinned: videoDetailController
|
pinned: videoDetailController.autoPlay.value ^
|
||||||
.autoPlay.value ^ false ^ videoDetailController
|
false ^
|
||||||
.autoPlay.value,
|
videoDetailController.autoPlay.value,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
scrolledUnderElevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
forceElevated: innerBoxIsScrolled,
|
forceElevated: innerBoxIsScrolled,
|
||||||
@ -389,6 +389,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
handlePlay();
|
||||||
|
},
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
type: 'emote',
|
type: 'emote',
|
||||||
src: videoDetailController
|
src: videoDetailController
|
||||||
@ -399,6 +403,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
/// 关闭自动播放时 手动播放
|
/// 关闭自动播放时 手动播放
|
||||||
Obx(
|
Obx(
|
||||||
@ -444,13 +449,24 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
bottom: 10,
|
bottom: 10,
|
||||||
child: TextButton.icon(
|
child: TextButton.icon(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
|
side: MaterialStateProperty
|
||||||
|
.resolveWith(
|
||||||
|
(states) {
|
||||||
|
return BorderSide(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.colorScheme
|
||||||
|
.primary
|
||||||
|
.withOpacity(0.5),
|
||||||
|
width: 1);
|
||||||
|
}),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
MaterialStateProperty
|
MaterialStateProperty
|
||||||
.resolveWith(
|
.resolveWith(
|
||||||
(states) {
|
(states) {
|
||||||
return Theme.of(context)
|
return Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.primaryContainer;
|
.background
|
||||||
|
.withOpacity(0.6);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
onPressed: () => handlePlay(),
|
onPressed: () => handlePlay(),
|
||||||
@ -458,7 +474,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Icons.play_circle_outline,
|
Icons.play_circle_outline,
|
||||||
size: 20,
|
size: 20,
|
||||||
),
|
),
|
||||||
label: const Text('Play'),
|
label: const Text('轻触封面播放'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -239,7 +239,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
// TODO: 暂停状态下预览弹幕仍会移动与计时,可考虑添加到dmSegList或其他方式实现
|
// TODO: 暂停状态下预览弹幕仍会移动与计时,可考虑添加到dmSegList或其他方式实现
|
||||||
widget.controller!.danmakuController!.addItems([
|
widget.controller!.danmakuController!.addItems([
|
||||||
DanmakuItem(
|
DanmakuItem(
|
||||||
msg,
|
"☞$msg",
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
time: widget
|
time: widget
|
||||||
.controller!.position.value.inMilliseconds,
|
.controller!.position.value.inMilliseconds,
|
||||||
@ -780,13 +780,15 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
label: danmakuDurationVal.toString(),
|
label: danmakuDurationVal.toString(),
|
||||||
onChanged: (double val) {
|
onChanged: (double val) {
|
||||||
danmakuDurationVal = val;
|
danmakuDurationVal = val;
|
||||||
widget.controller!.danmakuDurationVal = danmakuDurationVal;
|
widget.controller!.danmakuDurationVal =
|
||||||
|
danmakuDurationVal;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
try {
|
try {
|
||||||
DanmakuOption currentOption =
|
DanmakuOption currentOption =
|
||||||
danmakuController.option;
|
danmakuController.option;
|
||||||
DanmakuOption updatedOption =
|
DanmakuOption updatedOption =
|
||||||
currentOption.copyWith(duration:
|
currentOption.copyWith(
|
||||||
|
duration:
|
||||||
val / widget.controller!.playbackSpeed);
|
val / widget.controller!.playbackSpeed);
|
||||||
danmakuController.updateOption(updatedOption);
|
danmakuController.updateOption(updatedOption);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
@ -882,10 +884,13 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
fuc: () => {
|
fuc: () => {
|
||||||
if (widget.controller!.isFullScreen.value){
|
if (widget.controller!.isFullScreen.value)
|
||||||
widget.controller!.triggerFullScreen(status: false)
|
{widget.controller!.triggerFullScreen(status: false)}
|
||||||
} else {
|
else
|
||||||
if (MediaQuery.of(context).orientation == Orientation.landscape){
|
{
|
||||||
|
if (MediaQuery.of(context).orientation ==
|
||||||
|
Orientation.landscape)
|
||||||
|
{
|
||||||
SystemChrome.setPreferredOrientations([
|
SystemChrome.setPreferredOrientations([
|
||||||
DeviceOrientation.portraitUp,
|
DeviceOrientation.portraitUp,
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user