Skip to content

Expo-av to expo-video migration after revert#75270

Merged
mountiny merged 62 commits intoExpensify:mainfrom
software-mansion-labs:Guccio163/expo-video-after-revert
Jan 27, 2026
Merged

Expo-av to expo-video migration after revert#75270
mountiny merged 62 commits intoExpensify:mainfrom
software-mansion-labs:Guccio163/expo-video-after-revert

Conversation

@Guccio163
Copy link
Contributor

@Guccio163 Guccio163 commented Nov 16, 2025

Explanation of Change

This PR introduces expo-video replacing expo-av Video usages. It is a second PR after this one because of the revert. It also aims to fix issues reported during the staging deployment.

Fixed Issues

$ #64846
$ #75203
$ #75206
$ #75207
$ #75212
$ #75214
$ #75215
$ #75216
$ #75234

PROPOSAL:

Tests

Video checklist introduced here below:

Checklist
  • Inside chats (inbox):
    • Video can be played
    • Video can be played in chat thread (even nested one)
    • Video can be played after reload/navigating to another route
    • Video stops when changing routes / opening a thread with the video
    • Video works when navigating from other attachments via the arrows (not only from other videos, but also when navigating out of an image)
    • Video works when we enter the fullscreen play the video, leave the fullscreen and play it again
  • Inside new report view:
    • Video can be played
    • Video can be played in chat thread (even nested one)
    • Video can be played after reload/navigating to another route
    • Video stops when changing routes / opening a thread with the video
    • Video works when navigating from other attachments via the arrows (not only from other videos, but also when navigating out of an image)
    • Video works when we enter the fullscreen play the video, leave the fullscreen and play it again
  • In RHP:
    • Video can be played
    • Video can be played in chat thread (even nested one)
    • Video can be played after reload/navigating to another route
    • Video stops when changing routes / opening a thread with the video
    • Video works when navigating from other attachments via the arrows (not only from other videos, but also when navigating out of an image)
    • Video works when we enter the fullscreen play the video, leave the fullscreen and play it again
  • In chats via search:
    • Video can be played
    • Video can be played in chat thread (even nested one)
    • Video can be played after reload/navigating to another route
    • Video stops when changing routes / opening a thread with the video
    • Video works when navigating from other attachments via the arrows (not only from other videos, but also when navigating out of an image)
    • Video works when we enter the fullscreen play the video, leave the fullscreen and play it again
  • Video works fine (playing, fullscreen, mobile & desktop) on welcome to Expensify onboarding video (/onboarding/welcome-video url)
  • Video works fine (playing, fullscreen, mobile & desktop) in Send Attachment Modal
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Screen.Recording.2026-01-09.at.15.52.16.mov
Android: mWeb Chrome
mWeb_android.mov
iOS: Native
iOS.mov
iOS: mWeb Safari
mWeb-iOS.mov
MacOS: Chrome / Safari
web480.mov
MacOS: Desktop

Not included, desktop no longer supported

@github-actions
Copy link
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@Guccio163 Guccio163 mentioned this pull request Nov 16, 2025
84 tasks
@Guccio163
Copy link
Contributor Author

Hi @mountiny this is a draft PR for the expo-video main issue after the revert and also linked subissues.

I already started with a revert of the revert, fixing the android.permission problem (prime cause of the revert) and updating the package.lock; I'll keep you posted with the incoming changes 👀

Also cc-ing @blazejkustra @war-in and @Skalakid who were part of the original PR, feel free to unsubscribe 🔙

@codecov
Copy link

codecov bot commented Nov 16, 2025

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...rc/components/Attachments/AttachmentView/index.tsx 50.57% <ø> (+0.57%) ⬆️
src/components/FullscreenLoadingIndicator.tsx 90.90% <100.00%> (ø)
src/components/VideoPlayer/index.native.tsx 100.00% <ø> (ø)
src/components/VideoPlayer/index.tsx 0.00% <ø> (ø)
...ents/VideoPlayerContexts/PlaybackContext/index.tsx 92.30% <100.00%> (+4.30%) ⬆️
...xts/PlaybackContext/usePlaybackContextVideoRefs.ts 100.00% <100.00%> (+25.00%) ⬆️
...c/components/VideoPlayerContexts/VolumeContext.tsx 76.92% <ø> (ø)
src/components/VideoPopoverMenu/index.tsx 100.00% <ø> (ø)
src/components/FeatureTrainingModal.tsx 86.74% <50.00%> (+1.03%) ⬆️
...ts/VideoPlayerContexts/VideoPopoverMenuContext.tsx 86.36% <66.66%> (-3.64%) ⬇️
... and 8 more
... and 8 files with indirect coverage changes

@Guccio163
Copy link
Contributor Author

I think I've found a correct conditional to display loading spinner and hide controls a little bit longer when video doesn't start playing yet, but also don't trigger it on pausing or ending (occurs when using plain 'idle' status). This way the issue with 'NaN' duration shouldn't be possible to occur since the whole controls panel wouldn't be visible, but I safeguarded it with swapping bullish coalescing for OR operator to also filter NaN and swap it for 0.

@Guccio163
Copy link
Contributor Author

Next 2 issues look like handled, during the development I think I've stumbled upon a bug originating in sharedElement logic, I'll focus on it next, hopefully with some help from @Skalakid 🙇

…-fork into Guccio163/expo-video-after-revert
…-fork into Guccio163/expo-video-after-revert
@mountiny
Copy link
Contributor

Asked for an update

Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

QA confirmed the regression is done, we can move this ahead.

@Guccio163 maybe soon

Image

@Guccio163
Copy link
Contributor Author

@mountiny I guess that makes you a real wizard then 🪄 Can't wait to see it merged, let's hope for no reverts this time 👀

@mountiny mountiny merged commit 3a61f36 into Expensify:main Jan 27, 2026
38 checks passed
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@IuliiaHerets
Copy link

Hi @Guccio163 and @mountiny. Which QA steps do we need to follow here?

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.3.10-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@mountiny
Copy link
Contributor

@IuliiaHerets there are no specific test steps here as this pr changes everything related to video and audio in the app so all the regression tests you might have related to videos

@Guccio163
Copy link
Contributor Author

There is also a checklist created some time ago to test video player's behaviour; It's pasted in the 'Tests' section in PR's description, maybe it'll help 👀

@IuliiaHerets
Copy link

@mountiny @Guccio163, accordingly, I will check off this PR from the list, as these steps are already covered by regression tests.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.10-6 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@daledah
Copy link
Contributor

daledah commented Jan 29, 2026

@Guccio163 @mountiny @ZhenjaHorbach My IOS app crashed when I shared a video. It seems this problem was caused by this PR. Could you please check again?

error.mov

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Jan 29, 2026

@Guccio163 @mountiny @ZhenjaHorbach My IOS app crashed when I shared a video. It seems this problem was caused by this PR. Could you please check again?

error.mov

Did you update the main to the latest version, nodes, pods, and rebuild the iOS app?

@blazejkustra
Copy link
Contributor

I can reproduce, and I have a fix. I'll post a PR asap

return isLoading && (!isPlaying || currentTime <= 0) && !isOffline && !hasError;
}, [currentTime, hasError, isLoading, isOffline, isPlaying]);
const shouldShowOfflineIndicator = useMemo(() => {
return isOffline && currentTime + bufferedPosition <= 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Relying on isOffline would end up showing offline indicator even for intermittent/slow network conditions. We fixed this in #82779

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.

9 participants