Fix player not showing position and max length when opening media#3940
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 toupdatePlaybackPosition()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.
This comment was marked as off-topic.
Sorry, something went wrong.
* Deinit now playing info Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com> * Refactor Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com> --------- Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
marinofaggiana
approved these changes
Jan 12, 2026
marinofaggiana
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.