先commit,测下控制中心
This commit is contained in:
@@ -20,20 +20,20 @@ class PlaybackStateManager {
|
||||
// lib/audio/playback_state_manager.dart
|
||||
audio_service.PlaybackState get playbackState {
|
||||
final playControl = audio_service.MediaControl(
|
||||
androidIcon: _playing ? 'drawable/ic_pause' : 'drawable/ic_play',
|
||||
androidIcon: _playing ? '@drawable/ic_pause' : '@drawable/ic_play',
|
||||
label: _playing ? '暂停' : '播放',
|
||||
action: audio_service.MediaAction.playPause,
|
||||
);
|
||||
|
||||
final controls = [
|
||||
audio_service.MediaControl(
|
||||
androidIcon: 'drawable/ic_previous', // 上一首
|
||||
androidIcon: '@drawable/ic_previous', // 上一首
|
||||
label: '上一曲',
|
||||
action: audio_service.MediaAction.skipToPrevious,
|
||||
),
|
||||
playControl,
|
||||
audio_service.MediaControl(
|
||||
androidIcon: 'drawable/ic_next', // 下一首
|
||||
androidIcon: '@drawable/ic_next', // 下一首
|
||||
label: '下一曲',
|
||||
action: audio_service.MediaAction.skipToNext,
|
||||
),
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@ class _QTPlayerAppState extends State<QTPlayerApp> {
|
||||
await audio_service.AudioService.init(
|
||||
builder: () => _audioHandler!,
|
||||
config: const audio_service.AudioServiceConfig(
|
||||
androidNotificationChannelId: 'com.example.qt_player.music',
|
||||
androidNotificationChannelId: 'com.lxh.qingting_player.music',
|
||||
androidNotificationChannelName: '清听音乐播放',
|
||||
androidNotificationOngoing: true,
|
||||
androidStopForegroundOnPause: true,
|
||||
|
||||
Reference in New Issue
Block a user