-
-
Notifications
You must be signed in to change notification settings - Fork 984
Fix player not showing position and max length when opening media #3940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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]>
There was a problem hiding this 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 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.
| 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.
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.