Merge branch 'feature-dlna'
This commit is contained in:
@ -190,6 +190,15 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
setKey: SettingBoxKey.enableRelatedVideo,
|
setKey: SettingBoxKey.enableRelatedVideo,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: '视频投屏开关',
|
||||||
|
subTitle: '打开后将在播放器右上角显示投屏入口',
|
||||||
|
setKey: SettingBoxKey.enableDlna,
|
||||||
|
defaultVal: false,
|
||||||
|
callFn: (bool val) {
|
||||||
|
GlobalDataCache.enableDlna = val;
|
||||||
|
},
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
title: Text('评论展示', style: titleStyle),
|
title: Text('评论展示', style: titleStyle),
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import 'package:pilipala/pages/video/detail/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
|
import 'package:pilipala/pages/video/detail/introduction/widgets/menu_row.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
|
import 'package:pilipala/utils/global_data_cache.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/services/shutdown_timer_service.dart';
|
import 'package:pilipala/services/shutdown_timer_service.dart';
|
||||||
import '../../../../http/danmaku.dart';
|
import '../../../../http/danmaku.dart';
|
||||||
@ -1237,22 +1238,24 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
// ),
|
// ),
|
||||||
// fuc: () => _.screenshot(),
|
// fuc: () => _.screenshot(),
|
||||||
// ),
|
// ),
|
||||||
ComBtn(
|
if (GlobalDataCache.enableDlna) ...[
|
||||||
icon: const Icon(
|
ComBtn(
|
||||||
Icons.cast,
|
icon: const Icon(
|
||||||
size: 19,
|
Icons.cast,
|
||||||
color: Colors.white,
|
size: 19,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
fuc: () async {
|
||||||
|
showDialog<void>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return LiveDlnaPage(
|
||||||
|
datasource: widget.videoDetailCtr!.videoUrl);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
fuc: () async {
|
],
|
||||||
showDialog<void>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return LiveDlnaPage(
|
|
||||||
datasource: widget.videoDetailCtr!.videoUrl);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
if (isFullScreen.value) ...[
|
if (isFullScreen.value) ...[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 56,
|
width: 56,
|
||||||
|
|||||||
@ -53,6 +53,8 @@ class GlobalDataCache {
|
|||||||
static late bool enableAutoExpand;
|
static late bool enableAutoExpand;
|
||||||
// 动态切换
|
// 动态切换
|
||||||
static late bool enableDynamicSwitch;
|
static late bool enableDynamicSwitch;
|
||||||
|
// 投屏开关
|
||||||
|
static bool enableDlna = false;
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalDataCache._();
|
GlobalDataCache._();
|
||||||
@ -120,5 +122,6 @@ class GlobalDataCache {
|
|||||||
setting.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
|
setting.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
|
||||||
enableDynamicSwitch =
|
enableDynamicSwitch =
|
||||||
setting.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
setting.get(SettingBoxKey.enableDynamicSwitch, defaultValue: true);
|
||||||
|
enableDlna = setting.get(SettingBoxKey.enableDlna, defaultValue: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,7 +115,8 @@ class SettingBoxKey {
|
|||||||
enableAi = 'enableAi',
|
enableAi = 'enableAi',
|
||||||
enableAutoExpand = 'enableAutoExpand',
|
enableAutoExpand = 'enableAutoExpand',
|
||||||
defaultHomePage = 'defaultHomePage',
|
defaultHomePage = 'defaultHomePage',
|
||||||
enableRelatedVideo = 'enableRelatedVideo';
|
enableRelatedVideo = 'enableRelatedVideo',
|
||||||
|
enableDlna = 'enableDlna';
|
||||||
|
|
||||||
/// 外观
|
/// 外观
|
||||||
static const String themeMode = 'themeMode',
|
static const String themeMode = 'themeMode',
|
||||||
|
|||||||
Reference in New Issue
Block a user