@neoskola/auto-play 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -125,15 +125,17 @@ class NowPlayingTemplate: AutoPlayTemplate {
125
125
  }
126
126
 
127
127
  playPauseItem.handler = { [weak self] _, completion in
128
- guard let self = self else { completion(); return }
129
- if self.config.isPlaying {
130
- self.pauseAudio()
131
- self.config.onPause?()
132
- } else {
133
- self.resumeAudio()
134
- self.config.onPlay?()
128
+ DispatchQueue.main.async {
129
+ guard let self = self else { completion(); return }
130
+ if self.config.isPlaying {
131
+ self.pauseAudio()
132
+ self.config.onPause?()
133
+ } else {
134
+ self.resumeAudio()
135
+ self.config.onPlay?()
136
+ }
137
+ completion()
135
138
  }
136
- completion()
137
139
  }
138
140
 
139
141
  nextItem.handler = { [weak self] _, completion in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neoskola/auto-play",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "Android Auto and Apple CarPlay for react-native",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",