mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 直播间新增刷新、内置浏览器打开
This commit is contained in:
@@ -164,6 +164,37 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
//刷新
|
||||
IconButton(
|
||||
tooltip: '刷新',
|
||||
onPressed: () {
|
||||
_futureBuilderFuture =
|
||||
_liveRoomController.queryLiveInfo();
|
||||
// videoSourceInit();
|
||||
},
|
||||
icon: const Icon(Icons.refresh),
|
||||
),
|
||||
//内置浏览器打开
|
||||
IconButton(
|
||||
tooltip: '内置浏览器打开',
|
||||
onPressed: () {
|
||||
Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://live.bilibili.com/h5/${_liveRoomController.roomId}',
|
||||
'type': 'liveRoom',
|
||||
'pageTitle': _liveRoomController
|
||||
.roomInfoH5
|
||||
.value
|
||||
.anchorInfo!
|
||||
.baseInfo!
|
||||
.uname!,
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.open_in_browser)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -64,6 +64,15 @@ class WebviewController extends GetxController {
|
||||
}
|
||||
}
|
||||
},
|
||||
onPageFinished: (String url) {
|
||||
if (type.value == 'liveRoom') {
|
||||
print("adding");
|
||||
//注入js
|
||||
controller.runJavaScriptReturningResult('''
|
||||
document.styleSheets[0].insertRule('div.open-app-btn.bili-btn-warp {display:none;}', 0);
|
||||
''').then((value) => print(value));
|
||||
}
|
||||
},
|
||||
// 加载完成
|
||||
onUrlChange: (UrlChange urlChange) async {
|
||||
loadShow.value = false;
|
||||
|
||||
Reference in New Issue
Block a user