summaryrefslogtreecommitdiff
path: root/player-android/android/app/src/main/AndroidManifest.xml
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-21 08:25:16 +0300
committerPaul Buetow <paul@buetow.org>2026-05-21 08:25:16 +0300
commit09f0ee28b6a7b7fc588a8a4e387d94ffb6848af3 (patch)
tree4850136006f64f1938dc2a9fae2bde7a28c4f8b7 /player-android/android/app/src/main/AndroidManifest.xml
parent63fc4369917ab548c5cdc4dddccf0ad4ded11a2f (diff)
Add video/audio player packages, routes, and placeholder screens (task xa)
- pubspec.yaml: add video_player ^2.9.2, chewie ^1.8.5, just_audio ^0.9.42, audio_service ^0.18.15 with descriptive comments explaining each package's role. - AndroidManifest.xml: add FOREGROUND_SERVICE, FOREGROUND_SERVICE_MEDIA_PLAYBACK, and WAKE_LOCK permissions; declare AudioService with foregroundServiceType= mediaPlayback and MediaButtonReceiver for hardware media button support. INTERNET was already present — not duplicated. - app_routes.dart: add videoPlayer (/video/:mediaId) and audioPlayer (/audio/:mediaId) route constants plus videoPlayerPath/audioPlayerPath helpers. - router.dart: wire GoRoutes for the two new paths, forwarding mediaId from path params and optional mediaUrl from route extra. - screens/video_player_screen.dart: placeholder VideoPlayerScreen accepting mediaId + mediaUrl, importing chewie and video_player for resolution check. - screens/audio_player_screen.dart: placeholder AudioPlayerScreen accepting mediaId + mediaUrl, importing just_audio and audio_service for resolution check. flutter pub get and flutter analyze both pass clean. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'player-android/android/app/src/main/AndroidManifest.xml')
-rw-r--r--player-android/android/app/src/main/AndroidManifest.xml31
1 files changed, 31 insertions, 0 deletions
diff --git a/player-android/android/app/src/main/AndroidManifest.xml b/player-android/android/app/src/main/AndroidManifest.xml
index 4ca1088..602051c 100644
--- a/player-android/android/app/src/main/AndroidManifest.xml
+++ b/player-android/android/app/src/main/AndroidManifest.xml
@@ -1,5 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Required for all network calls (API, streaming). -->
<uses-permission android:name="android.permission.INTERNET" />
+ <!-- Required by audio_service to keep audio playing when the app is in the
+ background. Without this the OS may kill the media playback process. -->
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+ <!-- Required to declare mediaPlayback foreground service type on API 34+. -->
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
+ <!-- Prevents the CPU from sleeping while audio is actively playing. -->
+ <uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:label="Player"
@@ -25,5 +33,28 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
+ <!-- audio_service background playback service.
+ android:foregroundServiceType="mediaPlayback" is mandatory on
+ Android 10+ (API 29+) to grant media-playback foreground service
+ privileges. This overrides the entry auto-merged from
+ audio_service's own manifest to explicitly pin the foreground
+ service type. Class names match audio_service 0.18.x internals. -->
+ <service
+ android:name="com.ryanheise.audioservice.AudioService"
+ android:exported="true"
+ android:foregroundServiceType="mediaPlayback">
+ <intent-filter>
+ <action android:name="android.media.browse.MediaBrowserService" />
+ </intent-filter>
+ </service>
+ <!-- Receives hardware media button events (headset play/pause, etc.)
+ and forwards them to audio_service. -->
+ <receiver
+ android:name="com.ryanheise.audioservice.MediaButtonReceiver"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MEDIA_BUTTON" />
+ </intent-filter>
+ </receiver>
</application>
</manifest>