Skip to content

Conversation

JZDesign
Copy link
Contributor

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-ios and hybrids

Motivation

Creating a new paywall component can be a VERY large amount of code, I'm breaking things apart to make the PR's easier to review. This PR is just the creation of the VideoComponent model.

Description

Add a video component model and serialization tests

Note

I did not make it a member of the PaywallComponent sealed interface. I intentionally left that part out so I wouldn't have to have a style factory function setup and all of the other stuff that would domino into the PR.
This is just the json -> model

Copy link

codecov bot commented Aug 29, 2025

Codecov Report

❌ Patch coverage is 35.48387% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.25%. Comparing base (982e71d) to head (c651012).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...at/purchases/paywalls/components/VideoComponent.kt 32.65% 32 Missing and 1 partial ⚠️
...chases/paywalls/components/properties/VideoUrls.kt 46.15% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2646      +/-   ##
==========================================
- Coverage   78.48%   78.25%   -0.24%     
==========================================
  Files         305      307       +2     
  Lines       11369    11431      +62     
  Branches     1577     1581       +4     
==========================================
+ Hits         8923     8945      +22     
- Misses       1755     1792      +37     
- Partials      691      694       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JZDesign JZDesign requested review from a team August 29, 2025 14:05
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

This makes sense to me! Great job!

val height: UInt,
@get:JvmSynthetic
@Serializable(with = URLSerializer::class)
val url: URL,
Copy link
Contributor

@tonidero tonidero Sep 1, 2025

Choose a reason for hiding this comment

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

I wonder... should we allow developers to set a reference to an embedded video? So basically, follow a similar pattern as we do with fonts. If we find the name of the video in the resources for the app, we use that video. If not, we download it. That might help with bandwidth... But then again, it's probably a future improvement we can do without causing a breaking change, so I think this is ok for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is an interesting question. @joshdholtz what do you think?

@JZDesign JZDesign added this pull request to the merge queue Sep 2, 2025
Merged via the queue into main with commit c6fd4b0 Sep 2, 2025
21 checks passed
@JZDesign JZDesign deleted the jzdesign/video-component/models branch September 2, 2025 21:54
github-merge-queue bot pushed a commit that referenced this pull request Sep 3, 2025
**This is an automatic release.**

## RevenueCat SDK
### ✨ New Features
* Add preferred UI locale override for RevenueCat UI components (#2620)
via Josh Holtz (@joshdholtz)

### 🔄 Other Changes
* Improve thread safety of setting paywalls preferred locale (#2655) via
Josh Holtz (@joshdholtz)
* Remove validation for no packages on paywalls (#2653) via Josh Holtz
(@joshdholtz)
* Video Component Models (dark code) (#2646) via Jacob Rakidzich
(@JZDesign)
* [EXTERNAL] docs: fixed a typo on documentation about
`Purchases.awaitPurchase` by @matteinn in #2593 (#2651) via Toni Rico
(@tonidero)
* Add warning with 9.x issues to all versions since 9.0.0 in CHANGELOG
(#2650) via Toni Rico (@tonidero)
* [AUTOMATIC][Paywalls V2] Updates paywall-preview-resources submodule
(#2647) via RevenueCat Git Bot (@RCGitBot)
* Delete CLAUDE.md (#2648) via Cesar de la Vega (@vegaro)
* MON-1193 flatten Transition JSON structure after chatting more
thoroughly with team (#2641) via Jacob Rakidzich (@JZDesign)

---------

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Co-authored-by: Josh Holtz <me@joshholtz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants