mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 04:58:41 +00:00
separate live dm
Closes #1217 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -775,8 +775,8 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
children: [
|
children: [
|
||||||
Obx(
|
Obx(
|
||||||
() {
|
() {
|
||||||
final enableShowDanmaku =
|
final enableShowLiveDanmaku =
|
||||||
plPlayerController.enableShowDanmaku.value;
|
plPlayerController.enableShowLiveDanmaku.value;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: 34,
|
width: 34,
|
||||||
height: 34,
|
height: 34,
|
||||||
@@ -785,16 +785,17 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
final newVal = !enableShowDanmaku;
|
final newVal = !enableShowLiveDanmaku;
|
||||||
plPlayerController.enableShowDanmaku.value = newVal;
|
plPlayerController.enableShowLiveDanmaku.value =
|
||||||
|
newVal;
|
||||||
if (!plPlayerController.tempPlayerConf) {
|
if (!plPlayerController.tempPlayerConf) {
|
||||||
GStorage.setting.put(
|
GStorage.setting.put(
|
||||||
SettingBoxKey.enableShowDanmaku,
|
SettingBoxKey.enableShowLiveDanmaku,
|
||||||
newVal,
|
newVal,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: enableShowDanmaku
|
icon: enableShowLiveDanmaku
|
||||||
? const Icon(
|
? const Icon(
|
||||||
size: 22,
|
size: 22,
|
||||||
Icons.subtitles_outlined,
|
Icons.subtitles_outlined,
|
||||||
@@ -1019,7 +1020,7 @@ class _LiveDanmakuState extends State<LiveDanmaku> {
|
|||||||
return Obx(
|
return Obx(
|
||||||
() {
|
() {
|
||||||
return AnimatedOpacity(
|
return AnimatedOpacity(
|
||||||
opacity: plPlayerController.enableShowDanmaku.value ? 1 : 0,
|
opacity: plPlayerController.enableShowLiveDanmaku.value ? 1 : 0,
|
||||||
duration: const Duration(milliseconds: 100),
|
duration: const Duration(milliseconds: 100),
|
||||||
child: DanmakuScreen(
|
child: DanmakuScreen(
|
||||||
createdController: (DanmakuController e) {
|
createdController: (DanmakuController e) {
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ class BottomControl extends StatelessWidget {
|
|||||||
const SizedBox(width: 3),
|
const SizedBox(width: 3),
|
||||||
Obx(
|
Obx(
|
||||||
() {
|
() {
|
||||||
final enableShowDanmaku =
|
final enableShowLiveDanmaku =
|
||||||
plPlayerController.enableShowDanmaku.value;
|
plPlayerController.enableShowLiveDanmaku.value;
|
||||||
return ComBtn(
|
return ComBtn(
|
||||||
icon: enableShowDanmaku
|
icon: enableShowLiveDanmaku
|
||||||
? const Icon(
|
? const Icon(
|
||||||
size: 18,
|
size: 18,
|
||||||
Icons.subtitles_outlined,
|
Icons.subtitles_outlined,
|
||||||
@@ -85,11 +85,11 @@ class BottomControl extends StatelessWidget {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final newVal = !enableShowDanmaku;
|
final newVal = !enableShowLiveDanmaku;
|
||||||
plPlayerController.enableShowDanmaku.value = newVal;
|
plPlayerController.enableShowLiveDanmaku.value = newVal;
|
||||||
if (!plPlayerController.tempPlayerConf) {
|
if (!plPlayerController.tempPlayerConf) {
|
||||||
GStorage.setting.put(
|
GStorage.setting.put(
|
||||||
SettingBoxKey.enableShowDanmaku,
|
SettingBoxKey.enableShowLiveDanmaku,
|
||||||
newVal,
|
newVal,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,10 +75,18 @@ class PlayerFocus extends StatelessWidget {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case LogicalKeyboardKey.keyD:
|
case LogicalKeyboardKey.keyD:
|
||||||
final newVal = !plPlayerController.enableShowDanmaku.value;
|
if (plPlayerController.isLive) {
|
||||||
plPlayerController.enableShowDanmaku.value = newVal;
|
final newVal = !plPlayerController.enableShowLiveDanmaku.value;
|
||||||
if (!plPlayerController.tempPlayerConf) {
|
plPlayerController.enableShowLiveDanmaku.value = newVal;
|
||||||
GStorage.setting.put(SettingBoxKey.enableShowDanmaku, newVal);
|
if (!plPlayerController.tempPlayerConf) {
|
||||||
|
GStorage.setting.put(SettingBoxKey.enableShowLiveDanmaku, newVal);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
final newVal = !plPlayerController.enableShowDanmaku.value;
|
||||||
|
plPlayerController.enableShowDanmaku.value = newVal;
|
||||||
|
if (!plPlayerController.tempPlayerConf) {
|
||||||
|
GStorage.setting.put(SettingBoxKey.enableShowDanmaku, newVal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,8 @@ class PlPlayerController {
|
|||||||
bool get isLive => _isLive;
|
bool get isLive => _isLive;
|
||||||
|
|
||||||
/// 弹幕开关
|
/// 弹幕开关
|
||||||
RxBool enableShowDanmaku = Pref.enableShowDanmaku.obs;
|
late final RxBool enableShowDanmaku = Pref.enableShowDanmaku.obs;
|
||||||
|
late final RxBool enableShowLiveDanmaku = Pref.enableShowLiveDanmaku.obs;
|
||||||
|
|
||||||
late final bool autoPiP = Pref.autoPiP;
|
late final bool autoPiP = Pref.autoPiP;
|
||||||
|
|
||||||
|
|||||||
@@ -167,6 +167,7 @@ abstract class SettingBoxKey {
|
|||||||
blockTrack = 'blockTrack';
|
blockTrack = 'blockTrack';
|
||||||
|
|
||||||
static const String enableShowDanmaku = 'enableShowDanmaku',
|
static const String enableShowDanmaku = 'enableShowDanmaku',
|
||||||
|
enableShowLiveDanmaku = 'enableShowLiveDanmaku',
|
||||||
pipNoDanmaku = 'pipNoDanmaku',
|
pipNoDanmaku = 'pipNoDanmaku',
|
||||||
showVipDanmaku = 'showVipDanmaku',
|
showVipDanmaku = 'showVipDanmaku',
|
||||||
showSpecialDanmaku = 'showSpecialDanmaku',
|
showSpecialDanmaku = 'showSpecialDanmaku',
|
||||||
|
|||||||
@@ -635,6 +635,9 @@ abstract class Pref {
|
|||||||
static bool get enableShowDanmaku =>
|
static bool get enableShowDanmaku =>
|
||||||
_setting.get(SettingBoxKey.enableShowDanmaku, defaultValue: true);
|
_setting.get(SettingBoxKey.enableShowDanmaku, defaultValue: true);
|
||||||
|
|
||||||
|
static bool get enableShowLiveDanmaku =>
|
||||||
|
_setting.get(SettingBoxKey.enableShowLiveDanmaku, defaultValue: true);
|
||||||
|
|
||||||
static bool get enableQuickFav =>
|
static bool get enableQuickFav =>
|
||||||
_setting.get(SettingBoxKey.enableQuickFav, defaultValue: false);
|
_setting.get(SettingBoxKey.enableQuickFav, defaultValue: false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user