Skip to content

fix(ios): honour progressDivider for Video.compress - #426

Merged
numandev1 merged 1 commit into
numandev1:mainfrom
miguelnietoa:fix/ios-video-progress-divider
Oct 25, 2026
Merged

numandev1 merged 1 commit into
numandev1:mainfrom
miguelnietoa:fix/ios-video-progress-divider

Conversation

@miguelnietoa

Copy link
Copy Markdown
Contributor

Fixes #425. Same root cause as #417 / #422, in the video path.

VideoMain.swift reads progressDivider in four places with options["progressDivider"] as? Int. Nitro delivers JS numbers as Double, so the cast never matches and the divider falls back to 0: progress fires once per encoded frame whatever the caller passes. bitrate and maxSize in the same functions already go through (… as? NSNumber)?.intValue; this does the same for progressDivider.

Measured on an iOS simulator with a 3-minute 1080p30 clip, compressionMethod: 'manual' and progressDivider: 1: 5,400 callbacks before, 100 after.

Nitro hands JS numbers over as Double, which `as? Int` never matches, so
progressDivider always fell back to 0 and progress fired once per encoded
frame. Read it through NSNumber, as bitrate and maxSize already are.

Fixes numandev1#425

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The four localized conversions follow existing numeric parsing patterns, preserve defaults, and have no identified blocking issues.

No open issues 🎉

What changed in this PR

Fixes #425 by making iOS video compression read progressDivider through NSNumber, matching existing numeric-option handling.

Changes:

  • Updates all four reads, covering compression and remote-video downloads.
  • Preserves the default value of 0 and existing progress-throttling logic.

Native Swift changes were not runtime-verified during this review.

File Description
ios/​Video/​VideoMain.swift Converts numeric progress-divider options through NSNumber.intValue.

Review effort: Balanced

@numandev1
numandev1 merged commit 8f85623 into numandev1:main Oct 25, 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.

[iOS] progressDivider is ignored for Video.compress — Nitro passes Double, as? Int always fails

3 participants