Skip to content

Commit

Permalink
add native external player dialog for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Predidit committed Sep 25, 2024
1 parent 4f6d9ac commit a4f8555
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/utils/remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RemotePlay {
return AlertDialog(
title: const Text('实验性功能'),
content: const Text(
'调用系统当前m3u8默认打开方式进行播放。外部播放器调用在windows上仍处于实验阶段, 存在缺陷。包括但不限于无法调用播放器、无法播放等。此外还需要一定的缓存时间进行播放器初始化。'),
'调用系统当前m3u8默认打开方式进行播放。外部播放器调用在windows上仍处于实验阶段, 存在缺陷。包括但不限于无法调用播放器、无法播放等。'),
actions: [
TextButton(
onPressed: () => SmartDialog.dismiss(),
Expand All @@ -72,7 +72,7 @@ class RemotePlay {
onPressed: () {
SmartDialog.dismiss();
SmartDialog.showToast(
'尝试唤起外部播放器, 这可能需要一些时间',
'尝试唤起外部播放器',
displayType:
SmartToastType.onlyRefresh);
_launchURLWithMIME(video, 'video/mp4')
Expand Down
5 changes: 2 additions & 3 deletions windows/runner/external_player_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ void ExternalPlayerUtils::OpenWithPlayer(const char* url) {

SHELLEXECUTEINFO execInfo = {0};
execInfo.cbSize = sizeof(SHELLEXECUTEINFO);
execInfo.fMask = SEE_MASK_CLASSNAME;
execInfo.lpVerb = L"open";
execInfo.fMask = SEE_MASK_INVOKEIDLIST;
execInfo.lpVerb = L"openas";
execInfo.lpFile = tempFile;
execInfo.lpClass = L".m3u8";
execInfo.nShow = SW_SHOWNORMAL;

ShellExecuteEx(&execInfo);
Expand Down

0 comments on commit a4f8555

Please sign in to comment.