Remove embedded music player

The music feature is retired: delete the Media tab, MediaAPI,
MediaPlayerController, PinnedMediaResourceLoader, MediaPanelView, the
media_state control publish, media scope handling in VoiceSession, the
volume setting, and all media tests. App is now Talk + Activity tabs.

Backend media API in hope-voice-api is untouched (still serves the web UI).
This commit is contained in:
snowspeeder committed 2026-09-12 06:26:58 -04:00
1 parent 3620a2387b
commit ed329213de
18 files changed
+55 -2393

No files matched your search

+2 -35
View File
@@ -1,9 +1,8 @@
import XCTest
/// Opt-in tests against the actual NAS deployment. No injected replies or media.
/// Opt-in tests against the actual NAS deployment. No injected replies.
final class VoiceLiveTests: XCTestCase {
private var app: XCUIApplication!
private var startedMusic = false
override func record(_ issue: XCTIssue) {
if let app, app.state == .runningForeground {
@@ -17,20 +16,13 @@ final class VoiceLiveTests: XCTestCase {
}
override func tearDownWithError() throws {
defer { app?.terminate() }
guard let app, app.state == .runningForeground else { return }
// Stop only playback initiated by this test, including assertion failures.
// Do not leave the shared default room playing between test runs.
if startedMusic, app.buttons["Stop playback"].exists {
app.buttons["Stop playback"].tap()
}
app?.terminate()
}
override func setUpWithError() throws {
try XCTSkipUnless(ProcessInfo.processInfo.environment["HOPE_RUN_LIVE_TESTS"] == "1", "Requires the live Hope server")
continueAfterFailure = false
app = XCUIApplication()
startedMusic = false
app.launchArguments = ["--ui-testing", "--reset-ui-testing", "--live-testing"]
app.launch()
}
@@ -63,31 +55,6 @@ final class VoiceLiveTests: XCTestCase {
XCTAssertTrue(app.buttons["Start chatting"].waitForExistence(timeout: 20))
}
func testLiveLibraryPlayback() {
app.tabBars.buttons["Music"].tap()
let play = app.buttons.matching(NSPredicate(format: "label BEGINSWITH 'Play Sheryl Crow'")).firstMatch
XCTAssertTrue(play.waitForExistence(timeout: 20), "Existing library must load from NAS")
startedMusic = true
play.tap()
XCTAssertTrue(app.buttons["Pause"].waitForExistence(timeout: 30))
// Elapsed media time proves AVPlayer decoded and advanced, beyond a server desired-state label.
let position = app.sliders["Playback position"]
XCTAssertTrue(position.waitForExistence(timeout: 10))
let advanced = NSPredicate { _, _ in
let value = position.value as? String ?? "0%"
return value != "0%" && value != "0" && !value.isEmpty
}
expectation(for: advanced, evaluatedWith: position)
waitForExpectations(timeout: 35)
app.buttons["Pause"].tap()
XCTAssertTrue(app.buttons["Play"].waitForExistence(timeout: 10))
app.buttons["Seek forward 10 seconds"].tap()
capture("Live music playback")
app.buttons["Stop playback"].tap()
XCTAssertFalse(app.buttons["Pause"].exists)
startedMusic = false
}
private func capture(_ name: String) {
let attachment = XCTAttachment(screenshot: app.screenshot())
attachment.name = name
-23
View File
@@ -48,29 +48,6 @@ final class VoiceUITests: XCTestCase {
XCTAssertEqual(app.textFields["Server URL"].value as? String, "https://127.0.0.1:1")
}
func testMusicSearchAndStationValidation() {
app.launch()
app.tabBars.buttons["Music"].tap()
XCTAssertTrue(app.buttons["Add radio station"].waitForExistence(timeout: 5))
XCTAssertTrue(app.staticTexts["Music server unavailable"].waitForExistence(timeout: 10))
app.segmentedControls.buttons["Search"].tap()
let query = app.textFields["Song, artist, lyrics…"]
query.tap()
query.typeText("Piano")
app.buttons["music.search"].tap()
XCTAssertTrue(app.staticTexts.matching(NSPredicate(format: "label CONTAINS 'connect to the server'")).firstMatch.waitForExistence(timeout: 15))
app.buttons["Add radio station"].tap()
let url = app.textFields["Audio stream URL"]
XCTAssertTrue(url.waitForExistence(timeout: 5))
url.tap()
url.typeText("not-a-url")
app.buttons["Add station"].tap()
XCTAssertTrue(app.staticTexts["Enter a complete http:// or https:// audio stream address."].exists)
app.buttons["Cancel"].tap()
XCTAssertTrue(app.buttons["Add radio station"].exists)
capture("Music search")
}
func testTranscriptClearConfirmationAndActivityDetails() {
app.launchArguments.append("--ui-fixtures")
app.launch()