Skip to content

Commit

Permalink
Merge pull request #90 from xiaoyaocz/dev
Browse files Browse the repository at this point in the history
Release 1.2.2
  • Loading branch information
xiaoyaocz authored Aug 8, 2023
2 parents 978482e + 1855d7a commit 772476b
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 18 deletions.
6 changes: 3 additions & 3 deletions assets/app_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.2.1",
"version_num": 10201,
"version_desc": "1. 播放器增加兼容模式\n2. 修改虎牙直播间标题获取 #48\n3. 修复虎牙直播播放问题 #71\n4. 直播间全屏增加刷新按钮 #42\n5. 修复哔哩哔哩部分直播间无法观看问题 #59\n6. 修复弹幕默认开关设置无效问题 #65\n7. 增加进入直播间自动全屏选项 #41\n8. 增加弹幕关键词屏蔽功能 #70\n9. 增加双击全屏功能 #56\n10. 关注列表支持导入导出 #19",
"version": "1.2.2",
"version_num": 10202,
"version_desc": "1. 修复进入后台自动暂停#89,#88,#85,#77\n2. 哔哩哔哩优选非PCDN链接\n3. 修复弹幕描边设置不生效 #81",
"prerelease":false,
"download_url": "https://github.com/xiaoyaocz/dart_simple_live/releases"
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class AppSettingsController extends GetxController {
.getValue(LocalStorageService.kDanmuSpeed, 10.0);
danmuEnable.value = LocalStorageService.instance
.getValue(LocalStorageService.kDanmuEnable, true);

danmuStrokeWidth.value = LocalStorageService.instance
.getValue(LocalStorageService.kDanmuStrokeWidth, 2.0);
hardwareDecode.value = LocalStorageService.instance
.getValue(LocalStorageService.kHardwareDecode, true);
chatTextSize.value = LocalStorageService.instance
Expand Down
11 changes: 8 additions & 3 deletions simple_live_app/lib/modules/live_room/live_room_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,13 @@ class LiveRoomController extends BaseController {

void setPlayer() async {
currentUrlInfo.value = "线路${currentUrl + 1}";
errorMsg.value = "";
Map<String, String> headers = {};
if (site.id == "bilibili") {
headers = {
"referer": "https://live.bilibili.com",
"user-agent": "Mozilla/5.0 BiliDroid/1.12.0 ([email protected])"
"user-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188"
};
}
playerLoadding.value = true;
Expand Down Expand Up @@ -384,7 +386,7 @@ class LiveRoomController extends BaseController {
errorStream = player.stream.error.listen((event) {
Log.w(event);
// 切换清晰度时会触发此事件,暂时不做处理
// mediaError();
mediaError();
});

endStream = player.stream.completed.listen((event) {
Expand Down Expand Up @@ -415,7 +417,7 @@ class LiveRoomController extends BaseController {

void mediaError() {
if (playUrls.length - 1 == currentUrl) {
liveStatus.value = false;
//liveStatus.value = false;
errorMsg.value = "播放失败";
//Log.w(player.state..errorDescription ?? "");
} else {
Expand Down Expand Up @@ -616,6 +618,9 @@ class LiveRoomController extends BaseController {
value: i,
groupValue: currentUrl,
title: Text("线路${i + 1}"),
secondary: Text(
playUrls[i].contains(".flv") ? "FLV" : "HLS",
),
onChanged: (e) {
Get.back();
currentUrl = i;
Expand Down
29 changes: 27 additions & 2 deletions simple_live_app/lib/modules/live_room/live_room_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,31 @@ class LiveRoomPage extends GetView<LiveRoomController> {
return ListTile(
selected: controller.currentUrl == i,
textColor: Colors.white,
title: Text(
"线路${i + 1}",
title: Text.rich(
TextSpan(
text: "线路${i + 1}",
children: [
WidgetSpan(
child: Container(
decoration: BoxDecoration(
borderRadius: AppStyle.radius4,
border: Border.all(
color: Colors.grey,
),
),
padding: AppStyle.edgeInsetsH4,
margin: AppStyle.edgeInsetsL8,
child: Text(
controller.playUrls[i].contains(".flv")
? "FLV"
: "HLS",
style: const TextStyle(
fontSize: 12,
),
),
)),
],
),
style: const TextStyle(fontSize: 14),
),
minLeadingWidth: 16,
Expand Down Expand Up @@ -786,6 +809,8 @@ class LiveRoomPage extends GetView<LiveRoomController> {
return Video(
key: controller.globalPlayerKey,
controller: controller.videoController,
pauseUponEnteringBackgroundMode: false,
controls: NoVideoControls,
// child: Obx(
// () {
// if (controller.vlcPlayerController.value == null) {
Expand Down
12 changes: 6 additions & 6 deletions simple_live_app/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: simple_live_app
version: 1.2.1+10201
version: 1.2.2+10202
publish_to: none
description: "Simple Live APP"
environment:
Expand Down Expand Up @@ -48,11 +48,11 @@ dependencies:
file_picker: ^5.3.3 #文件选择

# 视频播放
media_kit: ^1.1.1
media_kit_video: ^1.1.1
media_kit_native_event_loop: ^1.0.6
media_kit_libs_android_video: ^1.3.0
media_kit_libs_ios_video: ^1.0.5
media_kit: ^1.1.3
media_kit_video: ^1.1.3
media_kit_native_event_loop: ^1.0.7
media_kit_libs_android_video: ^1.3.1
media_kit_libs_ios_video: ^1.1.1

flutter:
sdk: flutter
Expand Down
13 changes: 10 additions & 3 deletions simple_live_core/lib/src/bilibili_site.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ class BiliBiliSite implements LiveSite {
"https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo",
queryParameters: {
"room_id": detail.roomId,
"protocol": "0",
"format": "0",
"protocol": "0,1",
"format": "0,2",
"codec": "0",
"platform": "web",
"qn": quality.data,
Expand All @@ -145,7 +145,14 @@ class BiliBiliSite implements LiveSite {
}
}
}

// 对链接进行排序,包含mcdn的在后
urls.sort((a, b) {
if (a.contains("mcdn")) {
return 1;
} else {
return -1;
}
});
return urls;
}

Expand Down

0 comments on commit 772476b

Please sign in to comment.