@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
|
-
|
|
129
|
-
|
|
130
|
-
self.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|