Skip to content

chore: migrate from expo-av to expo-audio and expo-video#6719

Open
Rohit3523 wants to merge 261 commits into
developfrom
expo-audio
Open

chore: migrate from expo-av to expo-audio and expo-video#6719
Rohit3523 wants to merge 261 commits into
developfrom
expo-audio

Conversation

@Rohit3523

@Rohit3523 Rohit3523 commented Oct 12, 2025

Copy link
Copy Markdown
Member

Proposed changes

Depends on: #6875

Issue(s)

https://rocketchat.atlassian.net/browse/CORE-2035

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Refactor

    • Migrated audio playback, recording, and VOIP playback to a new audio stack.
    • Updated ringer audio and audio seeking to use the new player/recorder flows.
    • Switched attachment and share preview video rendering to a new video player.
  • Bug Fixes

    • Improved seek gesture handling with accurate, snapshot-based rollback and synchronous time updates.
    • Strengthened end-of-playback detection, cleanup, and listener release behavior.
    • Enhanced video loading/error handling and pause-on-navigation behavior.
  • Chores

    • Updated Jest mocks and media API tests; removed old audio test stubs.

@coderabbitai

coderabbitai Bot commented Oct 12, 2025

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Migrates audio and video usage from expo-av to expo-audio and expo-video across recording, playback, VoIP, ringer, previews, tests, and package dependencies, and updates seek and status handling to the new APIs.

Changes

Expo media migration

Layer / File(s) Summary
Seek and playback status
app/containers/AudioPlayer/Seek.tsx, app/containers/AudioPlayer/index.tsx
Seek callbacks become synchronous, gesture finalize uses saved seek snapshots, and playback status handling maps expo-audio fields to player state and end detection.
Recorder permissions and lifecycle
app/containers/MessageComposer/components/Buttons/MicOrSendButton.tsx, app/containers/MessageComposer/components/RecordAudio/Duration.tsx, app/containers/MessageComposer/components/RecordAudio/RecordAudio.tsx
Recording permissions move to expo-audio APIs, recorder state types change to RecorderState, and recording now uses recorder hooks, stop-based cleanup, and recorder URI/state for upload and review paths.
VoIP end-of-call sound and tests
app/lib/services/voip/playCallEndedSound.ts, app/lib/services/voip/playCallEndedSound.test.ts
VoIP call-ended playback uses a synchronous expo-audio player with watchdog cleanup, and the tests validate creation, completion, coalescing, timeout cleanup, and error logging.
AudioManager factory and caches
app/lib/methods/AudioManager.ts
AudioManager becomes a factory-backed expo-audio manager with per-key player caches, listener management, seek and rate restoration, end handling, sequence lookup, and release-based unload logic.
Video rendering and preview
app/views/AttachmentView.tsx, app/views/ShareView/Preview.tsx, app/views/AttachmentView.test.tsx
Attachment and share preview video playback use expo-video players and views, with loading, error, blur, and sizing behavior moved into local video components and the test mock removed.
Ringer playback
app/containers/Ringer/index.tsx
The ringer component switches to expo-audio player hooks, maps sound names to assets, and starts looping playback from the created player.
Package dependencies
package.json
expo-audio replaces expo-av in dependencies, and expo-video is added.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • diegolmello
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: migrating media handling from expo-av to expo-audio and expo-video.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2035: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rohit3523

Copy link
Copy Markdown
Member Author

Recording is not working... idk why...

@Rohit3523
Rohit3523 had a problem deploying to approve_e2e_testing July 9, 2026 19:47 — with GitHub Actions Error
@Rohit3523
Rohit3523 had a problem deploying to approve_e2e_testing July 9, 2026 20:24 — with GitHub Actions Error
@Rohit3523
Rohit3523 had a problem deploying to approve_e2e_testing July 9, 2026 20:31 — with GitHub Actions Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants