先commit,测下控制中心
This commit is contained in:
@@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.example.qt_player"
|
namespace = "com.lxh.qingting_player"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = flutter.compileSdkVersion
|
||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.example.qt_player"
|
applicationId = "com.lxh.qingting_player"
|
||||||
minSdk = flutter.minSdkVersion
|
minSdk = flutter.minSdkVersion
|
||||||
targetSdk = flutter.targetSdkVersion
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode = flutter.versionCode
|
versionCode = flutter.versionCode
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.example.qt_player
|
package com.lxh.qingting_player
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
tools:keep="@drawable/ic_previous,@drawable/ic_next,@drawable/ic_play,@drawable/ic_pause" />
|
||||||
@@ -20,20 +20,20 @@ class PlaybackStateManager {
|
|||||||
// lib/audio/playback_state_manager.dart
|
// lib/audio/playback_state_manager.dart
|
||||||
audio_service.PlaybackState get playbackState {
|
audio_service.PlaybackState get playbackState {
|
||||||
final playControl = audio_service.MediaControl(
|
final playControl = audio_service.MediaControl(
|
||||||
androidIcon: _playing ? 'drawable/ic_pause' : 'drawable/ic_play',
|
androidIcon: _playing ? '@drawable/ic_pause' : '@drawable/ic_play',
|
||||||
label: _playing ? '暂停' : '播放',
|
label: _playing ? '暂停' : '播放',
|
||||||
action: audio_service.MediaAction.playPause,
|
action: audio_service.MediaAction.playPause,
|
||||||
);
|
);
|
||||||
|
|
||||||
final controls = [
|
final controls = [
|
||||||
audio_service.MediaControl(
|
audio_service.MediaControl(
|
||||||
androidIcon: 'drawable/ic_previous', // 上一首
|
androidIcon: '@drawable/ic_previous', // 上一首
|
||||||
label: '上一曲',
|
label: '上一曲',
|
||||||
action: audio_service.MediaAction.skipToPrevious,
|
action: audio_service.MediaAction.skipToPrevious,
|
||||||
),
|
),
|
||||||
playControl,
|
playControl,
|
||||||
audio_service.MediaControl(
|
audio_service.MediaControl(
|
||||||
androidIcon: 'drawable/ic_next', // 下一首
|
androidIcon: '@drawable/ic_next', // 下一首
|
||||||
label: '下一曲',
|
label: '下一曲',
|
||||||
action: audio_service.MediaAction.skipToNext,
|
action: audio_service.MediaAction.skipToNext,
|
||||||
),
|
),
|
||||||
|
|||||||
+1
-1
@@ -258,7 +258,7 @@ class _QTPlayerAppState extends State<QTPlayerApp> {
|
|||||||
await audio_service.AudioService.init(
|
await audio_service.AudioService.init(
|
||||||
builder: () => _audioHandler!,
|
builder: () => _audioHandler!,
|
||||||
config: const audio_service.AudioServiceConfig(
|
config: const audio_service.AudioServiceConfig(
|
||||||
androidNotificationChannelId: 'com.example.qt_player.music',
|
androidNotificationChannelId: 'com.lxh.qingting_player.music',
|
||||||
androidNotificationChannelName: '清听音乐播放',
|
androidNotificationChannelName: '清听音乐播放',
|
||||||
androidNotificationOngoing: true,
|
androidNotificationOngoing: true,
|
||||||
androidStopForegroundOnPause: true,
|
androidStopForegroundOnPause: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user