diff --git a/simple_live_app/lib/app/controller/app_settings_controller.dart b/simple_live_app/lib/app/controller/app_settings_controller.dart index d2e7a91e..b6ecb46c 100644 --- a/simple_live_app/lib/app/controller/app_settings_controller.dart +++ b/simple_live_app/lib/app/controller/app_settings_controller.dart @@ -317,8 +317,10 @@ class AppSettingsController extends GetxController { var danmakuMaskEnable = false.obs; void setDanmakuMaskEnable(bool e) { danmakuMaskEnable.value = e; - LocalStorageService.instance.setValue(LocalStorageService.kDanmakuMaskEnable, e); + LocalStorageService.instance + .setValue(LocalStorageService.kDanmakuMaskEnable, e); } + var danmuStrokeWidth = 2.0.obs; void setDanmuStrokeWidth(double e) { danmuStrokeWidth.value = e; @@ -554,7 +556,7 @@ class AppSettingsController extends GetxController { LocalStorageService.instance .setValue(LocalStorageService.kPlayerForceHttps, e); } - + var douyinHlsFirst = false.obs; void setDouyinHlsFirst(bool e) { douyinHlsFirst.value = e; diff --git a/simple_live_app/lib/app/utils/permission_handler.dart b/simple_live_app/lib/app/utils/permission_handler.dart index 5e8dc912..4025997e 100644 --- a/simple_live_app/lib/app/utils/permission_handler.dart +++ b/simple_live_app/lib/app/utils/permission_handler.dart @@ -1,18 +1,18 @@ -import 'dart:async'; +import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart'; export 'package:permission_handler_platform_interface/permission_handler_platform_interface.dart' show - Permission, - PermissionStatus, - PermissionStatusGetters, - PermissionWithService, - FuturePermissionStatusGetters, - ServiceStatus, - ServiceStatusGetters, - FutureServiceStatusGetters; + Permission, + PermissionStatus, + PermissionStatusGetters, + PermissionWithService, + FuturePermissionStatusGetters, + ServiceStatus, + ServiceStatusGetters, + FutureServiceStatusGetters; PermissionHandlerPlatform get _handler => PermissionHandlerPlatform.instance; @@ -198,4 +198,4 @@ extension PermissionListActions on List { /// Returns a [Map] containing the status per requested [Permission]. Future> request() => _handler.requestPermissions(this); -} \ No newline at end of file +} diff --git a/simple_live_app/lib/app/utils/url_parse.dart b/simple_live_app/lib/app/utils/url_parse.dart index 7b4de303..ca15af65 100644 --- a/simple_live_app/lib/app/utils/url_parse.dart +++ b/simple_live_app/lib/app/utils/url_parse.dart @@ -58,10 +58,7 @@ class UrlParse { if (url.contains("twitch.tv/")) { final regExp = RegExp(r'twitch\.tv/([^/?]+)'); id = regExp.firstMatch(url)?.group(1) ?? ""; - return [ - id, - Sites.allSites[Constant.kTwitch]! - ]; + return [id, Sites.allSites[Constant.kTwitch]!]; } if (url.contains("v.douyin.com")) { var regExp = RegExp(r"http.?://v.douyin.com/[\d\w]+/"); diff --git a/simple_live_app/lib/modules/follow_user/follow_info_setting/follow_info_controller.dart b/simple_live_app/lib/modules/follow_user/follow_info_setting/follow_info_controller.dart index c0635821..944ff28e 100644 --- a/simple_live_app/lib/modules/follow_user/follow_info_setting/follow_info_controller.dart +++ b/simple_live_app/lib/modules/follow_user/follow_info_setting/follow_info_controller.dart @@ -192,7 +192,7 @@ class FollowInfoController extends BasePageController { // 更新关注同时 更新历史记录数据 History? oldHistroy = DBService.instance.getHistory(current.id); // null不迁移 - if(oldHistroy != null){ + if (oldHistroy != null) { final History newHistory = History( id: '${targetSite.id}_$targetRoomId', roomId: targetRoomId, diff --git a/simple_live_app/lib/modules/live_room/danmu/danmaku_mask.dart b/simple_live_app/lib/modules/live_room/danmu/danmaku_mask.dart index 9876d397..da833e77 100644 --- a/simple_live_app/lib/modules/live_room/danmu/danmaku_mask.dart +++ b/simple_live_app/lib/modules/live_room/danmu/danmaku_mask.dart @@ -141,10 +141,11 @@ class DanmakuMask { if (a[i - 1] == b[j - 1]) { dp[i][j] = dp[i - 1][j - 1]; } else { - dp[i][j] = 1 + min( - dp[i - 1][j - 1], - min(dp[i][j - 1], dp[i - 1][j]), - ); + dp[i][j] = 1 + + min( + dp[i - 1][j - 1], + min(dp[i][j - 1], dp[i - 1][j]), + ); } } } @@ -182,6 +183,7 @@ class IsolateDanmakuMask { ); return mask; } + Future _init({ required int baseWindowMs, required int bucketCount, diff --git a/simple_live_app/lib/modules/live_room/live_room_controller.dart b/simple_live_app/lib/modules/live_room/live_room_controller.dart index 9558e570..d0f06396 100644 --- a/simple_live_app/lib/modules/live_room/live_room_controller.dart +++ b/simple_live_app/lib/modules/live_room/live_room_controller.dart @@ -602,7 +602,8 @@ class LiveRoomController extends PlayerController with WidgetsBindingObserver { return; } var id = "${site.id}_$roomId"; - var historyDuration = HistoryService.instance.getHistoryDuration(followUserId: id); + var historyDuration = + HistoryService.instance.getHistoryDuration(followUserId: id); FollowService.instance.addFollow( FollowUser( id: id, diff --git a/simple_live_app/lib/modules/live_room/player/player_controller.dart b/simple_live_app/lib/modules/live_room/player/player_controller.dart index 3b8f1a31..681ea760 100644 --- a/simple_live_app/lib/modules/live_room/player/player_controller.dart +++ b/simple_live_app/lib/modules/live_room/player/player_controller.dart @@ -52,7 +52,7 @@ mixin PlayerMixin { await pp.setProperty('ao', 'alsa'); } // media_kit 仓库更新导致的问题,临时解决办法 - if(Platform.isAndroid){ + if (Platform.isAndroid) { // 通过错误参数强制media_kit不seek, 解决了加载-pause-seek 在直播流上的开屏问题 await pp.setProperty('force-seekable', 'yes'); } @@ -739,13 +739,13 @@ class PlayerController extends BaseController _widthSubscription = player.stream.width.listen((event) { Log.d( 'width:$event W:${(player.state.width)} H:${(player.state.height)}'); - if(player.state.width == null){ + if (player.state.width == null) { return; - }else{ + } else { // 可获取直播流size时且不为全屏模式时判断是否进入全屏模式 - isVertical.value = - player.state.height! > player.state.width!; - if (AppSettingsController.instance.autoFullScreen.value && !fullScreenState.value) { + isVertical.value = player.state.height! > player.state.width!; + if (AppSettingsController.instance.autoFullScreen.value && + !fullScreenState.value) { enterFullScreen(); } } diff --git a/simple_live_app/lib/modules/settings/danmu_settings_page.dart b/simple_live_app/lib/modules/settings/danmu_settings_page.dart index d9d38d91..8cc40394 100644 --- a/simple_live_app/lib/modules/settings/danmu_settings_page.dart +++ b/simple_live_app/lib/modules/settings/danmu_settings_page.dart @@ -60,7 +60,7 @@ class DanmuSettingsView extends GetView { () => Get.toNamed(RoutePath.kSettingsDanmuShield), ), Obx( - () => SettingsSwitch( + () => SettingsSwitch( title: "弹幕去重", subtitle: "测试性功能", value: controller.danmakuMaskEnable.value, diff --git a/simple_live_app/lib/services/core_api_service.dart b/simple_live_app/lib/services/core_api_service.dart index bb0169fa..f626ef61 100644 --- a/simple_live_app/lib/services/core_api_service.dart +++ b/simple_live_app/lib/services/core_api_service.dart @@ -104,16 +104,11 @@ class CoreDispatcher { } class CoreApiService extends GetxService { - CoreApiBuilder get builder => CoreApiBuilder(); // demo void exampleUsage() { - builder - .site("bilibili") - .func("getRecommends") - .param("limit", 1) - .build(); + builder.site("bilibili").func("getRecommends").param("limit", 1).build(); // builder // .site("douyu") // .room("12345") @@ -126,4 +121,4 @@ class CoreApiService extends GetxService { // 目的: 自建 api 或 ffi 调用 // 该工作非必要,暂且备份为草稿 } -} \ No newline at end of file +} diff --git a/simple_live_app/lib/services/douyin_account_service.dart b/simple_live_app/lib/services/douyin_account_service.dart index ff2ee926..66018830 100644 --- a/simple_live_app/lib/services/douyin_account_service.dart +++ b/simple_live_app/lib/services/douyin_account_service.dart @@ -30,7 +30,7 @@ class DouyinAccountService extends GetxService { } // 设置DouyinHlsFirst - void _setSiteHlsFirst(){ + void _setSiteHlsFirst() { site.hlsFirst = hlsFirst; } diff --git a/simple_live_app/lib/services/window_service.dart b/simple_live_app/lib/services/window_service.dart index bed236e0..dead0255 100644 --- a/simple_live_app/lib/services/window_service.dart +++ b/simple_live_app/lib/services/window_service.dart @@ -1,4 +1,4 @@ - +import 'dart:io'; import 'dart:ui'; import 'package:get/get.dart'; @@ -44,7 +44,11 @@ class WindowService extends GetxService implements WindowListener { void onWindowBlur() {} @override - void onWindowClose() {} + void onWindowClose() { + if (Platform.isLinux) { + exit(0); + } + } @override void onWindowDocked() {} @@ -72,7 +76,7 @@ class WindowService extends GetxService implements WindowListener { @override Future onWindowMoved() async { - if(!isPIP){ + if (!isPIP) { final bounds = await windowManager.getBounds(); _saveBounds(bounds); } @@ -83,7 +87,7 @@ class WindowService extends GetxService implements WindowListener { @override Future onWindowResized() async { - if(!isPIP){ + if (!isPIP) { final bounds = await windowManager.getBounds(); _saveBounds(bounds); } diff --git a/simple_live_app/pubspec.lock b/simple_live_app/pubspec.lock index 8ed22fda..0083a738 100644 --- a/simple_live_app/pubspec.lock +++ b/simple_live_app/pubspec.lock @@ -785,8 +785,8 @@ packages: dependency: "direct main" description: path: media_kit - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.1.11" @@ -794,8 +794,8 @@ packages: dependency: "direct overridden" description: path: "libs/android/media_kit_libs_android_video" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.3.6" @@ -803,8 +803,8 @@ packages: dependency: "direct overridden" description: path: "libs/ios/media_kit_libs_ios_video" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.1.4" @@ -812,8 +812,8 @@ packages: dependency: "direct overridden" description: path: "libs/linux/media_kit_libs_linux" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.1.3" @@ -821,8 +821,8 @@ packages: dependency: "direct overridden" description: path: "libs/macos/media_kit_libs_macos_video" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.1.4" @@ -830,8 +830,8 @@ packages: dependency: "direct main" description: path: "libs/universal/media_kit_libs_video" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.0.5" @@ -839,8 +839,8 @@ packages: dependency: "direct overridden" description: path: "libs/windows/media_kit_libs_windows_video" - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.0.10" @@ -848,8 +848,8 @@ packages: dependency: "direct main" description: path: media_kit_video - ref: "480c1e182fdb300ba975b2160765965f79a9b955" - resolved-ref: "480c1e182fdb300ba975b2160765965f79a9b955" + ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" + resolved-ref: "66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f" url: "https://github.com/Predidit/media-kit.git" source: git version: "1.2.5" diff --git a/simple_live_app/pubspec.yaml b/simple_live_app/pubspec.yaml index 71126473..51f2fafb 100644 --- a/simple_live_app/pubspec.yaml +++ b/simple_live_app/pubspec.yaml @@ -83,44 +83,44 @@ dependencies: media_kit: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./media_kit media_kit_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./media_kit_video media_kit_libs_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/universal/media_kit_libs_video dependency_overrides: media_kit_libs_linux: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/linux/media_kit_libs_linux media_kit_libs_ios_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/ios/media_kit_libs_ios_video media_kit_libs_android_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/android/media_kit_libs_android_video media_kit_libs_windows_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/windows/media_kit_libs_windows_video media_kit_libs_macos_video: git: url: https://github.com/Predidit/media-kit.git - ref: 480c1e182fdb300ba975b2160765965f79a9b955 + ref: 66d46c3d77ee15684e0c5c6ed51ac78d819d5e6f path: ./libs/macos/media_kit_libs_macos_video dev_dependencies: