Skip to content

Commit ed7c7ed

Browse files
authored
Merge pull request #60 from nini22P/dev
v1.5.1
2 parents 3b84495 + 02440b6 commit ed7c7ed

39 files changed

Lines changed: 1069 additions & 1036 deletions

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## v1.5.1
2+
3+
### Changelog
4+
5+
* Adjusted the playback control bar style in compact layout
6+
* Clicking “Check update” in the Microsoft Store version redirects to the Store page
7+
* Fixed forward and backward issues
8+
9+
### 更新日志
10+
11+
* 调整了紧凑布局下的播放控制栏样式
12+
* 微软商店版本中点击检查更新将跳转至商店页面
13+
* 修复了快退快进的问题
14+
115
## v1.5.0
216

317
### Changelog

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# IRIS - A lightweight video player
44

5-
![ci](https://github.com/nini22P/iris/actions/workflows/ci.yml/badge.svg)
5+
[![Build Status](https://github.com/nini22P/iris/actions/workflows/ci.yml/badge.svg)](https://github.com/nini22P/iris/actions/workflows/ci.yml)
6+
<a href="https://apps.microsoft.com/detail/9NML7WNHNRTJ?referrer=appbadge&mode=direct"><img src="https://get.microsoft.com/images/en-us%20dark.svg" height="30"/></a>
67
<a href="https://afdian.com/a/nini22P"><img alt="Afdian" style="height: 30px;" src="https://pic1.afdiancdn.com/static/img/welcome/button-sponsorme.png"></a>
78
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/nini22p)
89

@@ -18,18 +19,14 @@ English | [中文](./README_CN.md)
1819

1920
## Download
2021

21-
### Windows
22-
23-
- [IRIS-windows-installer.exe](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows-installer.exe)
24-
- [IRIS-windows.zip](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows.zip)
25-
26-
### Android
27-
28-
| Architecture | Download Link |
29-
| ------------ | ------------------------------------------------------------------------------------------------------------------ |
30-
| arm64-v8a | [IRIS-android-arm64-v8a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-arm64-v8a.apk) |
31-
| armeabi-v7a | [IRIS-android-armeabi-v7a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-armeabi-v7a.apk) |
32-
| x86_64 | [IRIS-android-x86_64.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-x86_64.apk) |
22+
| Platform | Arch/Channel | Download Link | Notes |
23+
| :------- | :---------------- | :----------------------------------------------------------------------------------------------------------------- | :--------------------- |
24+
| Windows | **Microsoft Store** | [Microsoft Store](https://apps.microsoft.com/detail/9NML7WNHNRTJ) | **Recommended**, auto-updates |
25+
| | Installer | [IRIS-windows-installer.exe](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows-installer.exe) | |
26+
| | Portable | [IRIS-windows.zip](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows.zip) | Unzip and run |
27+
| Android | arm64-v8a | [IRIS-android-arm64-v8a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-arm64-v8a.apk) | For 64-bit devices |
28+
| | armeabi-v7a | [IRIS-android-armeabi-v7a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-armeabi-v7a.apk) | For 32-bit devices |
29+
| | x86_64 | [IRIS-android-x86_64.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-x86_64.apk) | For emulators/x86 devices |
3330

3431
## Keyboard and Gesture Controls
3532

@@ -38,8 +35,8 @@ English | [中文](./README_CN.md)
3835
| Key | Description |
3936
| ---------------------- | -------------------------------------------------- |
4037
| `Space` | Play / Pause / Select file |
41-
| `Arrow Left` | Fast backward 10 seconds |
42-
| `Arrow Right` | Fast forward 10 seconds |
38+
| `Arrow Left` | Fast backward |
39+
| `Arrow Right` | Fast forward |
4340
| `Arrow Up` | Volume up |
4441
| `Arrow Down` | Volume down |
4542
| `Ctrl + Arrow Left` | Previous |
@@ -70,12 +67,12 @@ English | [中文](./README_CN.md)
7067
| --------------------------------- | ----------------------------- |
7168
| Tap | Select an item or open a menu |
7269
| Double tap center | Play / Pause |
73-
| Double tap left side | Fast backward 10 seconds |
74-
| Double tap right side | Fast forward 10 seconds |
70+
| Double tap left side | Fast backward |
71+
| Double tap right side | Fast forward |
7572
| Swipe left / right | Adjust playback progress |
7673
| Swipe up / down on left side | Adjust screen brightness |
7774
| Swipe up / down on right side | Adjust device volume |
78-
| Long press | Start speed playback |
75+
| Long press | Display Playback Speed Selector |
7976
| Long press and swipe left / right | Adjust speed playback speed |
8077

8178
## Contribution

README_CN.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
# IRIS - 轻量级视频播放器
44

5-
![ci](https://github.com/nini22P/iris/actions/workflows/ci.yml/badge.svg)
5+
[![Build Status](https://github.com/nini22P/iris/actions/workflows/ci.yml/badge.svg)](https://github.com/nini22P/iris/actions/workflows/ci.yml)
6+
<a href="https://apps.microsoft.com/detail/9NML7WNHNRTJ?referrer=appbadge&mode=direct"><img src="https://get.microsoft.com/images/zh-cn%20dark.svg" height="30"/></a>
67
<a href="https://afdian.com/a/nini22P"><img alt="爱发电" style="height: 30px;" src="https://pic1.afdiancdn.com/static/img/welcome/button-sponsorme.png"></a>
78
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/nini22p)
89

@@ -18,18 +19,14 @@
1819

1920
## 下载
2021

21-
### Windows
22-
23-
- [IRIS-windows-installer.exe](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows-installer.exe)
24-
- [IRIS-windows.zip](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows.zip)
25-
26-
### Android
27-
28-
| 设备架构 | 下载链接 |
29-
| ----------- | ------------------------------------------------------------------------------------------------------------------ |
30-
| arm64-v8a | [IRIS-android-arm64-v8a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-arm64-v8a.apk) |
31-
| armeabi-v7a | [IRIS-android-armeabi-v7a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-armeabi-v7a.apk) |
32-
| x86_64 | [IRIS-android-x86_64.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-x86_64.apk) |
22+
| 平台 | 架构/渠道 | 下载链接 | 备注 |
23+
| :------ | :------------ | :----------------------------------------------------------------------------------------------------------------- | :--------------- |
24+
| Windows | **微软商店** | [Microsoft Store](https://apps.microsoft.com/detail/9NML7WNHNRTJ) | **推荐**,自动更新 |
25+
| | 安装包 | [IRIS-windows-installer.exe](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows-installer.exe) | |
26+
| | 便携版 | [IRIS-windows.zip](https://github.com/nini22P/iris/releases/latest/download/IRIS-windows.zip) | 解压即用 |
27+
| Android | arm64-v8a | [IRIS-android-arm64-v8a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-arm64-v8a.apk) | 64位设备 |
28+
| | armeabi-v7a | [IRIS-android-armeabi-v7a.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-armeabi-v7a.apk) | 32位设备 |
29+
| | x86_64 | [IRIS-android-x86_64.apk](https://github.com/nini22P/iris/releases/latest/download/IRIS-android-x86_64.apk) | 模拟器/x86设备 |
3330

3431
## 键位和手势
3532

@@ -38,8 +35,8 @@
3835
| 键位 | 描述 |
3936
| ---------------------- | ------------------------------------ |
4037
| `Space` | 播放 / 暂停 / 选择文件 |
41-
| `Arrow Left` | 快退 10 秒 |
42-
| `Arrow Right` | 快进 10 秒 |
38+
| `Arrow Left` | 快退 |
39+
| `Arrow Right` | 快进 |
4340
| `Arrow Up` | 提升音量 |
4441
| `Arrow Down` | 降低音量 |
4542
| `Ctrl + Arrow Left` | 上一个 |
@@ -70,13 +67,13 @@
7067
| ---------------- | ------------------ |
7168
| 单击 | 选择项目或打开菜单 |
7269
| 双击屏幕中心 | 播放 / 暂停 |
73-
| 双击屏幕左侧 | 快退 10 秒 |
74-
| 双击屏幕右侧 | 快进 10 秒 |
70+
| 双击屏幕左侧 | 快退 |
71+
| 双击屏幕右侧 | 快进 |
7572
| 左右滑动 | 调整播放进度 |
7673
| 屏幕左侧上下滑动 | 调整屏幕亮度 |
7774
| 屏幕右侧上下滑动 | 调整设备音量 |
78-
| 长按 | 启动倍速播放 |
79-
| 长按后左右滑动 | 调整倍速播放的速度 |
75+
| 长按 | 显示播放速度选择器 |
76+
| 长按后左右滑动 | 调整播放速度 |
8077

8178
## 贡献
8279

inno.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "IRIS"
5-
#define MyAppVersion "1.5.0"
5+
#define MyAppVersion "1.5.1"
66
#define MyAppPublisher "nini22P"
77
#define MyAppURL "https://github.com/nini22P/iris"
88
#define MyAppExeName "iris.exe"

lib/hooks/use_app_lifecycle.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ import 'package:provider/provider.dart';
66

77
void useAppLifecycle() {
88
final context = useContext();
9-
final saveProgress = context.read<MediaPlayer>().saveProgress;
109

1110
AppLifecycleState? appLifecycleState = useAppLifecycleState();
1211

1312
useEffect(() {
1413
try {
1514
if (appLifecycleState == AppLifecycleState.paused) {
1615
logger('App lifecycle state: paused');
17-
saveProgress();
16+
context.read<MediaPlayer>().saveProgress();
1817
}
1918
} catch (e) {
2019
logger('App lifecycle state error: $e');

lib/hooks/use_cover.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@ FileItem? useCover() {
1515
final currentIndex =
1616
usePlayQueueStore().select(context, (state) => state.currentIndex);
1717

18-
final int currentPlayIndex = useMemoized(
19-
() => playQueue.indexWhere((element) => element.index == currentIndex),
20-
[playQueue, currentIndex]);
21-
22-
final FileItem? file = useMemoized(
23-
() => playQueue.isEmpty || currentPlayIndex < 0
24-
? null
25-
: playQueue[currentPlayIndex].file,
26-
[playQueue, currentPlayIndex]);
18+
final FileItem? file = useMemoized(() {
19+
final index =
20+
playQueue.indexWhere((element) => element.index == currentIndex);
21+
return playQueue.isEmpty || index < 0 ? null : playQueue[index].file;
22+
}, [playQueue, currentIndex]);
2723

2824
final localStoragesFuture =
2925
useMemoized(() async => await getLocalStorages(context), []);
@@ -52,9 +48,8 @@ FileItem? useCover() {
5248

5349
final files = await storage.getFiles(dir);
5450

55-
final images = files
56-
.where((file) => [ContentType.image].contains(file.type))
57-
.toList();
51+
final images =
52+
files.where((file) => file.type == ContentType.image).toList();
5853

5954
cover.value = images.firstWhereOrNull((image) =>
6055
image.name.split('.').first.toLowerCase() == 'cover') ??

lib/hooks/use_gesture.dart

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/gestures.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_hooks/flutter_hooks.dart';
4+
import 'package:flutter_volume_controller/flutter_volume_controller.dart';
45
import 'package:iris/globals.dart' show speedStops, speedSelectorItemWidth;
56
import 'package:iris/hooks/use_brightness.dart';
67
import 'package:iris/hooks/use_volume.dart';
@@ -31,7 +32,6 @@ class Gesture {
3132
final bool isRightGesture;
3233
final double? brightness;
3334
final double? volume;
34-
final MouseCursor cursor;
3535

3636
Gesture({
3737
required this.onTapDown,
@@ -51,7 +51,6 @@ class Gesture {
5151
required this.isRightGesture,
5252
required this.brightness,
5353
required this.volume,
54-
required this.cursor,
5554
});
5655
}
5756

@@ -65,8 +64,6 @@ Gesture useGesture({
6564
}) {
6665
final context = useContext();
6766

68-
final player = context.read<MediaPlayer>();
69-
7067
final gestureState = useRef({
7168
'isTouch': false,
7269
'isLongPress': false,
@@ -97,20 +94,22 @@ Gesture useGesture({
9794
}
9895

9996
void onDoubleTapDown(TapDownDetails details) {
97+
final player = context.read<MediaPlayer>();
98+
10099
if (details.kind == PointerDeviceKind.touch) {
101100
final screenWidth = MediaQuery.sizeOf(context).width;
102101
final tapDx = details.globalPosition.dx;
103102

104-
if (tapDx > screenWidth * 0.7) {
105-
// 右侧 30%
103+
if (tapDx > screenWidth * 0.75) {
104+
// 右侧 25%
106105
showProgress();
107106
player.forward(10);
108-
} else if (tapDx < screenWidth * 0.3) {
109-
// 左侧 30%
107+
} else if (tapDx < screenWidth * 0.25) {
108+
// 左侧 25%
110109
showProgress();
111110
player.backward(10);
112111
} else {
113-
// 中间 40%
112+
// 中间 50%
114113
if (player.isPlaying) {
115114
useAppStore().updateAutoPlay(false);
116115
player.pause();
@@ -128,7 +127,8 @@ Gesture useGesture({
128127
}
129128

130129
void onLongPressStart(LongPressStartDetails details) {
131-
if (gestureState.value['isTouch'] as bool && player.isPlaying) {
130+
if (gestureState.value['isTouch'] as bool &&
131+
context.read<MediaPlayer>().isPlaying) {
132132
gestureState.value['isLongPress'] = true;
133133
gestureState.value['startPanOffset'] = details.globalPosition;
134134

@@ -206,7 +206,8 @@ Gesture useGesture({
206206
gestureState.value['isTouch'] = true;
207207
gestureState.value['isDragging'] = true;
208208
gestureState.value['startPanOffset'] = details.globalPosition;
209-
gestureState.value['startSeekPosition'] = player.position;
209+
gestureState.value['startSeekPosition'] =
210+
context.read<MediaPlayer>().position;
210211
gestureState.value['panDirection'] = null;
211212
isLeftGesture.value = false;
212213
isRightGesture.value = false;
@@ -246,9 +247,10 @@ Gesture useGesture({
246247
int targetSeconds = (startSeconds + seekSecondsOffset).round();
247248

248249
// 边界检查
249-
targetSeconds = targetSeconds.clamp(0, player.duration.inSeconds);
250+
targetSeconds = targetSeconds.clamp(
251+
0, context.read<MediaPlayer>().duration.inSeconds);
250252

251-
player.seek(Duration(seconds: targetSeconds));
253+
context.read<MediaPlayer>().seek(Duration(seconds: targetSeconds));
252254
showProgress();
253255
}
254256

@@ -259,6 +261,10 @@ Gesture useGesture({
259261
isLeftGesture.value =
260262
startOffset.dx < MediaQuery.sizeOf(context).width / 2;
261263
isRightGesture.value = !isLeftGesture.value;
264+
265+
if (isRightGesture.value) {
266+
FlutterVolumeController.updateShowSystemUI(false);
267+
}
262268
}
263269

264270
final double dy = details.delta.dy;
@@ -287,6 +293,8 @@ Gesture useGesture({
287293
};
288294
isLeftGesture.value = false;
289295
isRightGesture.value = false;
296+
297+
FlutterVolumeController.updateShowSystemUI(true);
290298
}
291299

292300
void onPanEnd(DragEndDetails details) => _resetPanState();
@@ -299,12 +307,6 @@ Gesture useGesture({
299307
}
300308
}
301309

302-
final cursor = useMemoized(() {
303-
return player.isPlaying == false
304-
? SystemMouseCursors.basic
305-
: SystemMouseCursors.none;
306-
}, [player.isPlaying]);
307-
308310
return Gesture(
309311
onTapDown: onTapDown,
310312
onTap: onTap,
@@ -323,6 +325,5 @@ Gesture useGesture({
323325
isRightGesture: isRightGesture.value,
324326
brightness: brightness.value,
325327
volume: volume.value,
326-
cursor: cursor,
327328
);
328329
}

lib/hooks/use_keyboard.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import 'package:flutter_hooks/flutter_hooks.dart';
44
import 'package:iris/globals.dart';
55
import 'package:iris/models/player.dart';
66
import 'package:iris/models/storages/local.dart';
7-
import 'package:iris/pages/player/overlays/history.dart';
8-
import 'package:iris/pages/player/overlays/play_queue.dart';
9-
import 'package:iris/pages/player/overlays/track/subtitle_and_audio_track.dart';
10-
import 'package:iris/pages/settings/settings.dart';
11-
import 'package:iris/pages/storages/storages.dart';
7+
import 'package:iris/widgets/popups/history.dart';
8+
import 'package:iris/widgets/popups/play_queue.dart';
9+
import 'package:iris/widgets/popups/track/subtitle_and_audio_track.dart';
10+
import 'package:iris/widgets/popups/settings/settings.dart';
11+
import 'package:iris/widgets/popups/storages/storages.dart';
1212
import 'package:iris/store/use_app_store.dart';
1313
import 'package:iris/store/use_play_queue_store.dart';
1414
import 'package:iris/store/use_player_ui_store.dart';
@@ -28,9 +28,9 @@ KeyboardEvent useKeyboard({
2828
}) {
2929
final context = useContext();
3030

31-
final player = context.read<MediaPlayer>();
32-
3331
void onKeyEvent(KeyEvent event) async {
32+
final player = context.read<MediaPlayer>();
33+
3434
if (event.runtimeType == KeyDownEvent) {
3535
if (HardwareKeyboard.instance.isAltPressed) {
3636
switch (event.logicalKey) {
@@ -138,7 +138,7 @@ KeyboardEvent useKeyboard({
138138
case LogicalKeyboardKey.space:
139139
case LogicalKeyboardKey.mediaPlayPause:
140140
showControl();
141-
if (context.read<MediaPlayer>().isPlaying) {
141+
if (player.isPlaying) {
142142
useAppStore().updateAutoPlay(false);
143143
player.pause();
144144
} else {

lib/hooks/use_volume.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ ValueNotifier<double?> useVolume(bool isGesture) {
1010
try {
1111
() async {
1212
if (!isGesture) return;
13-
await FlutterVolumeController.updateShowSystemUI(false);
1413
volume.value = await FlutterVolumeController.getVolume();
1514
}();
1615
} catch (e) {
1716
logger('Error getting volume: $e');
1817
}
1918
return () {
2019
volume.value = null;
21-
FlutterVolumeController.updateShowSystemUI(true);
2220
};
2321
}, [isGesture]);
2422

0 commit comments

Comments
 (0)