Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 1df730a3
authored
2025-12-22 14:17:30 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
音频恢复播放指令中包含播放速率参数时,导致播放错乱的问题
1 parent
363514eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
lib/data/repositories/message/audio_player_handler.dart
lib/services/player_service.dart
lib/data/repositories/message/audio_player_handler.dart
View file @
1df730a
...
...
@@ -41,7 +41,7 @@ class AudioPauseHandler extends MessageHandler {
class
AudioResumeHandler
extends
MessageHandler
{
@override
Future
<
dynamic
>
handleMessage
(
dynamic
params
)
async
{
final
playRate
=
(
params
[
'playRate'
]
as
num
?)?.
toDouble
()
??
1.0
;
double
?
playRate
=
(
params
[
'playRate'
]
as
num
?)?.
toDouble
()
;
return
await
getIt
.
get
<
PlayerService
>().
resumeAudio
(
playRate
);
}
}
...
...
lib/services/player_service.dart
View file @
1df730a
...
...
@@ -64,7 +64,7 @@ class PlayerService {
_playId
=
playId
;
// 播放速度
await
_player
!.
setSpeed
(
playRate
);
_player
!.
setSpeed
(
playRate
);
await
_player
!.
startPlayer
(
fromURI:
url
,
...
...
@@ -119,7 +119,9 @@ class PlayerService {
}
if
(
playRate
!=
null
)
{
await
_player
!.
setSpeed
(
playRate
);
_player
!.
setSpeed
(
playRate
);
// 设置速度之后,会自动恢复播放
return
true
;
}
await
_player
!.
resumePlayer
();
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment