Skip to content

Conversation

@mpivchev
Copy link
Collaborator

@mpivchev mpivchev commented Dec 29, 2025

Opening audio or video in the player did not show position and remaining time until after playing.

This PR preparses the media and updates the timers at the beginning.

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>
@mpivchev mpivchev marked this pull request as ready for review December 30, 2025 12:32
@mpivchev mpivchev requested review from Copilot and marinofaggiana and removed request for Copilot December 30, 2025 12:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the media player wasn't displaying the current position and maximum length when opening media files. The fix introduces explicit media parsing before playback and refactors the time calculation logic to be more robust.

Key changes:

  • Added VLCMedia parsing with appropriate options for local vs. network files to ensure media metadata is available before playback
  • Refactored the update() method to updatePlaybackPosition() with improved time calculation logic that manually computes current and remaining time
  • Fixed multiple typos in debug print statements ("Played" → "Player", "Play URL" → "Playing URL")

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift Added VLCMediaDelegate protocol conformance and media parsing to load metadata before playback; fixed print statement typos; added slider event state change during opening
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift Renamed update() to updatePlaybackPosition() and refactored time calculation logic to manually compute time strings; fixed code formatting
Nextcloud.xcodeproj/project.pbxproj Updated file reference metadata for NCPlayer.swift with indentation settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +69 to +73
let media = VLCMedia(url: url)

media.parse(options: url.isFileURL ? .fetchLocal : .fetchNetwork)

player.media = media

This comment was marked as off-topic.

@nextcloud nextcloud deleted a comment from Copilot AI Jan 5, 2026
@nextcloud nextcloud deleted a comment from Copilot AI Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants