Skip to content

Commit 1f47920

Browse files
Destroy the media session and the notification when we disconnect from the PlaybackAPI
1 parent 0eaf00c commit 1f47920

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

android/app/src/main/java/com/marshallofsound/gpmdp/remote/PlaybackAPIService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ public void onConnected(WebSocket websocket, Map<String, List<String>> headers)
9494
public void onConnectError(WebSocket websocket, WebSocketException cause) throws Exception {
9595
Log.d(WS_TAG, "ERROR");
9696
emitEvent("WebSocket:Error", null);
97+
InternalMediaService.destroy();
9798
}
9899

99100
@Override
100101
public void onDisconnected(WebSocket websocket, WebSocketFrame serverCloseFrame, WebSocketFrame clientCloseFrame, boolean closedByServer) throws Exception {
101102
Log.d(WS_TAG, "CLOSE");
102103
emitEvent("WebSocket:Close", null);
104+
InternalMediaService.destroy();
103105
}
104106

105107
@Override

0 commit comments

Comments
 (0)