Merge pull request #66 from nini22P/dev

v1.5.2
This commit is contained in:
22
2025-11-01 16:29:55 +08:00
committed by GitHub
9 changed files with 569 additions and 753 deletions

View File

@@ -1,3 +1,19 @@
## v1.5.2
### Changelog
* Migrate to MPL-2.0 license
* Add more media type support
* Fix key open subtitle and audio track issue
* Fix popup layer cannot be closed with `Esc` key issue
### 更新日志
* 迁移到 MPL-2.0 许可证
* 添加更多媒体类型支持
* 修复按键打开字幕和音频轨道的问题
* 修复弹出层无法使用 `Esc` 键关闭的问题
## v1.5.1
### Changelog

1046
LICENSE

File diff suppressed because it is too large Load Diff

View File

@@ -90,4 +90,4 @@ Thank you for your support!
## License
This project is licensed under the AGPLv3 license. For more details, please see the [LICENSE](./LICENSE) file.
This project is licensed under the MPL-2.0 license. For more details, please see the [LICENSE](./LICENSE) file.

View File

@@ -90,4 +90,4 @@
## 许可证
本项目采用 AGPLv3 许可证,详细信息请查看 [LICENSE](./LICENSE) 文件。
本项目采用 MPL-2.0 许可证,详细信息请查看 [LICENSE](./LICENSE) 文件。

View File

@@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "IRIS"
#define MyAppVersion "1.5.1"
#define MyAppVersion "1.5.2"
#define MyAppPublisher "nini22P"
#define MyAppURL "https://github.com/nini22P/iris"
#define MyAppExeName "iris.exe"
@@ -69,39 +69,65 @@ Root: HKA; Subkey: "Software\Classes\{#MyAppAssocName}\shell\open\command"; Valu
Root: HKA; Subkey: "Software\Classes\.aac\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.aiff\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.alac\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.amr\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.ape\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.caf\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.cda\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.dsd\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.dts\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.flac\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.m4a\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.midi\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mp3\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mpc\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.oga\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.ogg\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.opus\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.raw\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.spx\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.tak\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.tta\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.wav\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.wma\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.wv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
; Video Files
Root: HKA; Subkey: "Software\Classes\.3gp\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.amv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.asf\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.avi\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.divx\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.dpx\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.drc\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.dv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.f4v\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.flv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.he264\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.hevc\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.h264\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.h265\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.hevc\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.m2ts\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.m4p\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.m4v\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mkv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mng\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mov\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mp2\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mp4\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mpe\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mpeg\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mpg\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mov\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mpv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mts\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.mxf\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.nsv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.ogv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.qt\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.rm\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.rmvb\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.ts\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.vob\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.webm\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.wmv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\.yuv\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocName}"; ValueData: ""; Flags: uninsdeletevalue
; --- 注册应用程序的 Capabilities ---
Root: HKA; Subkey: "Software\{#MyAppPublisher}\{#MyAppName}"; Flags: uninsdeletekey

View File

@@ -181,7 +181,10 @@ KeyboardEvent useKeyboard({
showControlForHover(
showPopup(
context: context,
child: SubtitleAndAudioTrack(),
child: Provider<MediaPlayer>.value(
value: context.read<MediaPlayer>(),
child: const SubtitleAndAudioTrack(),
),
direction: PopupDirection.right,
),
);

View File

@@ -5,41 +5,67 @@ class Formats {
'aac',
'aiff',
'alac',
'amr',
'ape',
'caf',
'cda',
'dsd',
'dts',
'flac',
'm4a',
'midi',
'mp3',
'mpc',
'oga',
'ogg',
'opus',
'raw',
'spx',
'tak',
'tta',
'wav',
'wma',
'wv',
];
static const List<String> video = [
'3gp',
'amv',
'asf',
'avi',
'divx',
'dpx',
'drc',
'dv',
'f4v',
'flv',
'he264',
'hevc',
'h264',
'h265',
'hevc',
'm2ts',
'm4p',
'm4v',
'mkv',
'mng',
'mov',
'mp2',
'mp4',
'mpe',
'mpeg',
'mpg',
'mov',
'mpv',
'mts',
'mxf',
'nsv',
'ogv',
'qt',
'rm',
'rmvb',
'ts',
'vob',
'webm',
'wmv',
'yuv',
];
static const List<String> image = [
@@ -53,12 +79,12 @@ class Formats {
'jpg',
'pbm',
'pgm',
'png',
'ppm',
'raw',
'svg',
'tiff',
'webp',
'png',
];
}

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/material.dart' hide Card;
import 'package:flutter/services.dart';
import 'package:iris/utils/platform.dart';
import 'package:iris/widgets/card.dart';
import 'package:window_manager/window_manager.dart';
@@ -25,10 +26,13 @@ class Popup<T> extends PopupRoute<T> {
Popup({
required this.child,
required this.direction,
});
}) {
_focusNode = FocusNode();
}
final Widget child;
final PopupDirection direction;
late final FocusNode _focusNode;
bool _isPopping = false;
@@ -50,94 +54,111 @@ class Popup<T> extends PopupRoute<T> {
@override
Duration get transitionDuration => const Duration(milliseconds: 250);
@override
void dispose() {
_focusNode.dispose();
super.dispose();
}
@override
Widget buildPage(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return Stack(
children: [
Positioned.fill(
child: GestureDetector(
onPanStart: (details) {
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
windowManager.startDragging();
}
},
onTap: () => _popOnce(context),
),
),
Align(
alignment: direction == PopupDirection.left
? Alignment.bottomLeft
: Alignment.bottomRight,
child: AnimatedBuilder(
animation: animation,
builder: (context, child) {
return SlideTransition(
position: Tween<Offset>(
begin: direction == PopupDirection.left
? const Offset(-1.0, 0.0)
: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(
CurvedAnimation(
parent: animation,
curve: Curves.easeInOutCubicEmphasized,
),
),
child: child,
);
},
child: Dismissible(
key: UniqueKey(),
direction: direction == PopupDirection.left
? DismissDirection.endToStart
: DismissDirection.startToEnd,
onUpdate: (details) {
if (details.previousReached) {
_popOnce(context);
return KeyboardListener(
focusNode: _focusNode,
autofocus: true,
onKeyEvent: (event) {
if (event.logicalKey == LogicalKeyboardKey.escape) {
_popOnce(context);
}
},
child: Stack(
children: [
Positioned.fill(
child: GestureDetector(
onPanStart: (details) {
if (Platform.isWindows ||
Platform.isLinux ||
Platform.isMacOS) {
windowManager.startDragging();
}
},
child: LayoutBuilder(
builder: (context, constraints) {
final screenWidth = constraints.maxWidth;
final screenHeight = constraints.maxHeight;
final int size = screenWidth > 1200
? 3
: screenWidth > 720
? 2
: 1;
return Padding(
padding: EdgeInsets.only(
bottom: 8,
left: direction == PopupDirection.left ? 8 : 0,
right: direction == PopupDirection.right ? 8 : 0,
onTap: () => _popOnce(context),
),
),
Align(
alignment: direction == PopupDirection.left
? Alignment.bottomLeft
: Alignment.bottomRight,
child: AnimatedBuilder(
animation: animation,
builder: (context, child) {
return SlideTransition(
position: Tween<Offset>(
begin: direction == PopupDirection.left
? const Offset(-1.0, 0.0)
: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(
CurvedAnimation(
parent: animation,
curve: Curves.easeInOutCubicEmphasized,
),
child: UnconstrainedBox(
child: LimitedBox(
maxWidth: screenWidth / size - 16,
maxHeight:
isDesktop ? screenHeight - 56 : screenHeight - 16,
child: Card(
child: Material(
color: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(child: child),
],
),
child: child,
);
},
child: Dismissible(
key: UniqueKey(),
direction: direction == PopupDirection.left
? DismissDirection.endToStart
: DismissDirection.startToEnd,
onUpdate: (details) {
if (details.previousReached) {
_popOnce(context);
}
},
child: LayoutBuilder(
builder: (context, constraints) {
final screenWidth = constraints.maxWidth;
final screenHeight = constraints.maxHeight;
final int size = screenWidth > 1200
? 3
: screenWidth > 720
? 2
: 1;
return Padding(
padding: EdgeInsets.only(
bottom: 8,
left: direction == PopupDirection.left ? 8 : 0,
right: direction == PopupDirection.right ? 8 : 0,
),
child: UnconstrainedBox(
child: LimitedBox(
maxWidth: screenWidth / size - 16,
maxHeight:
isDesktop ? screenHeight - 56 : screenHeight - 16,
child: Card(
child: Material(
color: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(child: child),
],
),
),
),
),
),
),
);
},
);
},
),
),
),
),
),
],
],
),
);
}
}

View File

@@ -1,7 +1,7 @@
name: iris
description: "A lightweight video player"
publish_to: 'none'
version: 1.5.1+3
description: A lightweight video player
publish_to: none
version: 1.5.2+3
environment:
sdk: ^3.5.4
@@ -84,9 +84,9 @@ msix_config:
identity_name: 22P.IRISplayer
publisher_display_name: 22P
publisher: CN=9740B6B2-E777-4F52-8ECD-C4A577A73010
msix_version: 1.5.1.0
msix_version: 1.5.2.0
logo_path: assets/images/logo.png
trim_logo: false
languages: en-us, zh-cn
execution_alias: iris
file_extension: .3gp, .avi, .dpx, .dv, .f4v, .flv, .he264, .hevc, .h265, .mkv, .mp4, .mpeg, .mpg, .mov, .nsv, .rm, .rmvb, .ts, .vob, .webm, .wmv, .aac, .aiff, .alac, .cda, .dsd, .flac, .m4a, .midi, .mp3, .ogg, .opus, .raw, .wav, .wma
file_extension: .aac, .aiff, .alac, .amr, .ape, .caf, .cda, .dsd, .dts, .flac, .m4a, .midi, .mp3, .mpc, .oga, .ogg, .opus, .raw, .spx, .tak, .tta, .wav, .wma, .wv, .3gp, .amv, .asf, .avi, .divx, .dpx, .drc, .dv, .f4v, .flv, .h264, .h265, .hevc, .m2ts, .m4p, .m4v, .mkv, .mng, .mov, .mp2, .mp4, .mpe, .mpeg, .mpg, .mpv, .mts, .mxf, .nsv, .ogv, .qt, .rm, .rmvb, .ts, .vob, .webm, .wmv, .yuv