Skip to content

Commit

Permalink
Merge pull request #436 from xiaoyaocz/dev
Browse files Browse the repository at this point in the history
Release 1.6.3 / TV 1.1.0
  • Loading branch information
xiaoyaocz authored Jun 7, 2024
2 parents f10523c + cbe50a8 commit 023bdfc
Show file tree
Hide file tree
Showing 15 changed files with 383 additions and 166 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.6.0",
"version_num": 10600,
"version_desc": "- 修复MacOS打开同步失败 #351\n- 修复Windows返回时亮度调节至最高 #332\n- 修复虎牙分类加载失败 #366\n- 修复虎牙无法播放问题 #409\n- 修复链接跳转时虚拟导航条显示错误 #373\n- 修复播放器锁定时依旧触发长按事件\n- 支持调整弹幕字重 #372\n- 支持日志记录\n- 支持抖音手机端分享链接解析 #376\n- 支持复制直播间链接\n- 支持滑动删除历史记录 #231\n- 支持自定义视频输出驱动\n- PC页面增加刷新按钮\n- 优化桌面小窗播放\n- 优化关注列表加载\n- 优化直播间加载错误的处理\n- 统一全平台图标,安卓支持主题图标 #140 #112\n- 尝试使用WebView实现抖音搜索 #379",
"version": "1.6.3",
"version_num": 10603,
"version_desc": "- 修复抖音无法读取直播状态 #431\n- 修复抖音无法读取原画 #429\n- 优化直播状态读取\n-斗鱼默认不使用PCDN链接",
"prerelease":false,
"download_url": "https://github.com/xiaoyaocz/dart_simple_live/releases"
}
6 changes: 3 additions & 3 deletions assets/tv_app_version.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "1.0.8",
"version_num": 10008,
"version_desc": "- 修复虎牙播放问题\n- TV增加Banner图标\n- 优化使用体验",
"version": "1.1.0",
"version_num": 10100,
"version_desc": "- 修复抖音无法读取原画\n- 优化直播状态读取\n-斗鱼默认不使用PCDN链接",
"prerelease":true,
"download_url": "https://github.com/xiaoyaocz/dart_simple_live/releases"
}
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ class LiveRoomController extends PlayerController with WidgetsBindingObserver {
detail.value = await site.liveSite.getRoomDetail(roomId: roomId);

if (site.id == Constant.kDouyin) {
// 如果是抖音,且收藏的是Rid,需要转换roomID
// 1.6.0之前收藏的WebRid
// 1.6.0收藏的RoomID
// 1.6.0之后改回WebRid
if (detail.value!.roomId != roomId) {
var oldId = roomId;
rxRoomId.value = detail.value!.roomId;
Expand Down
9 changes: 9 additions & 0 deletions simple_live_app/lib/modules/live_room/live_room_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,15 @@ class LiveRoomPage extends GetView<LiveRoomController> {
controller.openNaviteAPP();
},
),
ListTile(
leading: const Icon(Icons.info_outline_rounded),
title: const Text("播放信息"),
trailing: const Icon(Icons.chevron_right),
onTap: () {
Get.back();
controller.showDebugInfo();
},
),
],
),
),
Expand Down
51 changes: 34 additions & 17 deletions simple_live_app/lib/modules/live_room/player/player_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,19 @@ mixin PlayerSystemMixin on PlayerMixin, PlayerStateMixin, PlayerDanmakuMixin {
//danmakuController?.clear();
}

Size? _lastWindowSize;
Offset? _lastWindowPosition;

///小窗模式()
void enterSmallWindow() {
void enterSmallWindow() async {
if (!(Platform.isAndroid || Platform.isIOS)) {
fullScreenState.value = true;
smallWindowState.value = true;

// 读取窗口大小
_lastWindowSize = await windowManager.getSize();
_lastWindowPosition = await windowManager.getPosition();

windowManager.setTitleBarStyle(TitleBarStyle.hidden);
// 获取视频窗口大小
var width = player.state.width ?? 16;
Expand All @@ -311,9 +319,10 @@ mixin PlayerSystemMixin on PlayerMixin, PlayerStateMixin, PlayerDanmakuMixin {
fullScreenState.value = false;
smallWindowState.value = false;
windowManager.setTitleBarStyle(TitleBarStyle.normal);
windowManager.setSize(const Size(1280, 720));
windowManager.setSize(_lastWindowSize!);
windowManager.setPosition(_lastWindowPosition!);
windowManager.setAlwaysOnTop(false);
windowManager.setAlignment(Alignment.center);
//windowManager.setAlignment(Alignment.center);
}
}

Expand Down Expand Up @@ -690,24 +699,10 @@ class PlayerController extends BaseController
void mediaError(String error) {}

void showDebugInfo() {
if (lockControlsState.value && fullScreenState.value) {
return;
}
Utils.showBottomSheet(
title: "播放信息",
child: ListView(
children: [
ListTile(
title: const Text("Media"),
subtitle: Text(player.state.playlist.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Media\n${player.state.playlist}",
),
);
},
),
ListTile(
title: const Text("Resolution"),
subtitle: Text('${player.state.width}x${player.state.height}'),
Expand Down Expand Up @@ -742,6 +737,17 @@ class PlayerController extends BaseController
);
},
),
ListTile(
title: const Text("Media"),
subtitle: Text(player.state.playlist.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Media\n${player.state.playlist}",
),
);
},
),
ListTile(
title: const Text("AudioTrack"),
subtitle: Text(player.state.track.audio.toString()),
Expand Down Expand Up @@ -775,6 +781,17 @@ class PlayerController extends BaseController
);
},
),
ListTile(
title: const Text("Volume"),
subtitle: Text(player.state.volume.toString()),
onTap: () {
Clipboard.setData(
ClipboardData(
text: "Volume\n${player.state.volume}",
),
);
},
),
],
),
);
Expand Down
13 changes: 13 additions & 0 deletions simple_live_app/lib/modules/user/user_page.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
Expand Down Expand Up @@ -193,6 +194,18 @@ class UserPage extends StatelessWidget {
Get.toNamed(RoutePath.kSettingsOther);
},
),
if (kDebugMode)
ListTile(
leading: const Icon(Remix.apps_line),
title: const Text("测试"),
trailing: const Icon(
Icons.chevron_right,
color: Colors.grey,
),
onTap: () {
Get.toNamed(RoutePath.kTest);
},
),
],
),
Divider(
Expand Down
3 changes: 3 additions & 0 deletions simple_live_app/lib/routes/route_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ class RoutePath {

/// 同步设备
static const kSyncDevice = "/sync/device";

/// 测试页面
static const kTest = "/test";
}
2 changes: 1 addition & 1 deletion 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.6.0+10600
version: 1.6.3+10603
publish_to: none
description: "Simple Live APP"
environment:
Expand Down
17 changes: 9 additions & 8 deletions simple_live_core/example/simple_live_core_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:simple_live_core/simple_live_core.dart';
void main() async {
CoreLog.enableLog = true;
CoreLog.requestLogType = RequestLogType.short;
LiveSite site = DouyinSite();
LiveSite site = DouyuSite();
var danmaku = site.getDanmaku();
danmaku.onMessage = (event) {
if (event.type == LiveMessageType.chat) {
Expand All @@ -20,13 +20,14 @@ void main() async {
};
//var categores = await site.getCategores();
//print(categores.length);
var detail = await site.getRoomDetail(roomId: "7375009979071236915");
// var playQualites = await site.getPlayQualites(detail: detail);
// var playUrls =
// await site.getPlayUrls(detail: detail, quality: playQualites.first);
// for (var element in playUrls) {
// print(element);
// }
var detail = await site.getRoomDetail(roomId: "687423");
var playQualites = await site.getPlayQualites(detail: detail);
print(playQualites);
var playUrls =
await site.getPlayUrls(detail: detail, quality: playQualites.first);
for (var element in playUrls) {
print(element);
}
//print(detail);

danmaku.start(detail.danmakuData);
Expand Down
Loading

0 comments on commit 023bdfc

Please sign in to comment.