Commit 5afd932
committed
fix(android): wire stayAwake to ExoPlayer wake mode in audioplayers_android_exo
The exo implementation parses the stayAwake flag of AudioContextAndroid
(AudioplayersPlugin requires it in the method channel) but never consumes
it: the ExoPlayer is built without setWakeMode, so no wake/wifi lock is
held during playback and network streaming with the screen off depends
entirely on locks held by other plugins (e.g. audio_service).
Map stayAwake=true to C.WAKE_MODE_NETWORK (partial wake lock + wifi lock,
only held while actually playing), mirroring the stayAwake handling of
audioplayers_android (MediaPlayer.setWakeMode in updateContext). Applied
both at player creation and on context updates.1 parent 687218b commit 5afd932
1 file changed
Lines changed: 22 additions & 3 deletions
File tree
- packages/audioplayers_android_exo/android/src/main/kotlin/xyz/luan/audioplayers/player
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
| |||
164 | 181 | | |
165 | 182 | | |
166 | 183 | | |
| 184 | + | |
167 | 185 | | |
168 | 186 | | |
169 | 187 | | |
| |||
173 | 191 | | |
174 | 192 | | |
175 | 193 | | |
| 194 | + | |
176 | 195 | | |
177 | 196 | | |
178 | 197 | | |
| |||
0 commit comments