Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions simple_live_app/lib/app/utils/permission_handler.dart
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -198,4 +198,4 @@ extension PermissionListActions on List<Permission> {
/// Returns a [Map] containing the status per requested [Permission].
Future<Map<Permission, PermissionStatus>> request() =>
_handler.requestPermissions(this);
}
}
5 changes: 1 addition & 4 deletions simple_live_app/lib/app/utils/url_parse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]+/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class FollowInfoController extends BasePageController<FollowUser> {
// 更新关注同时 更新历史记录数据
History? oldHistroy = DBService.instance.getHistory(current.id);
// null不迁移
if(oldHistroy != null){
if (oldHistroy != null) {
final History newHistory = History(
id: '${targetSite.id}_$targetRoomId',
roomId: targetRoomId,
Expand Down
10 changes: 6 additions & 4 deletions simple_live_app/lib/modules/live_room/danmu/danmaku_mask.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
);
}
}
}
Expand Down Expand Up @@ -182,6 +183,7 @@ class IsolateDanmakuMask {
);
return mask;
}

Future<void> _init({
required int baseWindowMs,
required int bucketCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down Expand Up @@ -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();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DanmuSettingsView extends GetView<AppSettingsController> {
() => Get.toNamed(RoutePath.kSettingsDanmuShield),
),
Obx(
() => SettingsSwitch(
() => SettingsSwitch(
title: "弹幕去重",
subtitle: "测试性功能",
value: controller.danmakuMaskEnable.value,
Expand Down
9 changes: 2 additions & 7 deletions simple_live_app/lib/services/core_api_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -126,4 +121,4 @@ class CoreApiService extends GetxService {
// 目的: 自建 api 或 ffi 调用
// 该工作非必要,暂且备份为草稿
}
}
}
2 changes: 1 addition & 1 deletion simple_live_app/lib/services/douyin_account_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DouyinAccountService extends GetxService {
}

// 设置DouyinHlsFirst
void _setSiteHlsFirst(){
void _setSiteHlsFirst() {
site.hlsFirst = hlsFirst;
}

Expand Down
12 changes: 8 additions & 4 deletions simple_live_app/lib/services/window_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

import 'dart:io';
import 'dart:ui';

import 'package:get/get.dart';
Expand Down Expand Up @@ -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() {}
Expand Down Expand Up @@ -72,7 +76,7 @@ class WindowService extends GetxService implements WindowListener {

@override
Future<void> onWindowMoved() async {
if(!isPIP){
if (!isPIP) {
final bounds = await windowManager.getBounds();
_saveBounds(bounds);
}
Expand All @@ -83,7 +87,7 @@ class WindowService extends GetxService implements WindowListener {

@override
Future<void> onWindowResized() async {
if(!isPIP){
if (!isPIP) {
final bounds = await windowManager.getBounds();
_saveBounds(bounds);
}
Expand Down
32 changes: 16 additions & 16 deletions simple_live_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -785,71 +785,71 @@ 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"
media_kit_libs_android_video:
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"
media_kit_libs_ios_video:
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"
media_kit_libs_linux:
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"
media_kit_libs_macos_video:
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"
media_kit_libs_video:
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"
media_kit_libs_windows_video:
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"
media_kit_video:
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"
Expand Down
16 changes: 8 additions & 8 deletions simple_live_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading