Close revoked remote sessions and document installation requirements
iOS build and tests / simulator (push) Has been cancelled

This commit is contained in:
2026-09-14 00:51:20 +03:00
parent eaf091b1cf
commit 91e305ada5
5 changed files with 65 additions and 7 deletions
+12 -3
View File
@@ -45,7 +45,8 @@ final class PCMediaSession: RemoteMediaSessionRepresentable {
}
var commands: [MediaCommand] {
[
guard attributes.hasSession else { return [] }
return [
.play { try await self.send(.play) }.enabled(attributes.capabilities.play),
.pause { try await self.send(.pause) }.enabled(attributes.capabilities.pause),
.next { try await self.send(.next) }.enabled(attributes.capabilities.next),
@@ -62,7 +63,15 @@ final class PCMediaSession: RemoteMediaSessionRepresentable {
}
private func send(_ action: SystemPlayerAction, value: Double? = nil) async throws {
let state = try await transport.send(action, value: value, sessionID: id)
attributes = SystemPlayerAttributes(id: id, state: state)
do {
let state = try await transport.send(action, value: value, sessionID: id)
attributes = SystemPlayerAttributes(id: id, state: state)
} catch BridgeError.unauthorized {
try SystemPlayerCredentials.delete(id)
attributes.hasSession = false
attributes.playing = false
attributes.volume = nil
throw BridgeError.unauthorized
}
}
}