Skip to content

fix: autoplay videos from media settings#102

Open
AlejandroAkbal wants to merge 1 commit intomainfrom
auto-triage/11-autoplays-video-so-you-dont-have-to-click-it-for-it-to-play-like-a-gif-pls
Open

fix: autoplay videos from media settings#102
AlejandroAkbal wants to merge 1 commit intomainfrom
auto-triage/11-autoplays-video-so-you-dont-have-to-click-it-for-it-to-play-like-a-gif-pls

Conversation

@AlejandroAkbal
Copy link
Member

@AlejandroAkbal AlejandroAkbal commented Mar 14, 2026

Summary

  • extend the existing autoplay animated media setting to videos using Fluid Player's built-in autoplay and muted playback options
  • update the settings copy so users know the toggle now starts videos muted
  • add a settings page assertion covering the new label text

Validation

  • pnpm exec prettier --write "components/pages/posts/post/PostMedia.vue" "pages/settings.vue" "test/pages/settings.test.ts"
  • pnpm exec prettier --check "components/pages/posts/post/PostMedia.vue" "pages/settings.vue" "test/pages/settings.test.ts"
  • pnpm exec vitest run "test/pages/settings.test.ts" (fails: Cannot find package '@nuxt/test-utils' imported from test/pages/settings.test.ts; pre-existing environment issue)
  • pnpm exec nuxi typecheck (fails with many pre-existing project type errors, including missing @nuxt/test-utils and unrelated app-wide typing issues)

Summary by CodeRabbit

  • New Features

    • Expanded autoplay support to cover both animated GIFs and videos. When enabled, videos will automatically start muted, providing a smoother browsing experience without unexpected audio playback.
  • Documentation

    • Updated the autoplay settings label and description to reflect the new capability for both GIFs and videos, with clarification that videos play muted automatically.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

Walkthrough

These changes extend the autoplay animated media feature to include video autoplay with muting. Fluid Player configuration is enhanced with autoPlay and mute options bound to the autoplayAnimatedMedia preference, and settings UI text is updated to reflect the expanded scope from GIFs to videos.

Changes

Cohort / File(s) Summary
Video Player Configuration
components/pages/posts/post/PostMedia.vue
Added autoPlay and mute configuration properties to Fluid Player options, both bound to autoplayAnimatedMedia.value, enabling automatic playback and muting for eligible animated media.
Settings UI & Tests
pages/settings.vue, test/pages/settings.test.ts
Updated autoplay media switch label from "Autoplay GIFs" to "Autoplay GIFs & videos" and expanded description to mention muted video playback; added corresponding assertion in test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • chore: remove unnecessary param #72: Directly related autoplay-for-animated-media feature enhancement modifying the same files and extending autoplay behavior to include video playback with muting.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: autoplay videos from media settings' directly and clearly summarizes the main change: enabling autoplay for videos through the media settings interface.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch auto-triage/11-autoplays-video-so-you-dont-have-to-click-it-for-it-to-play-like-a-gif-pls
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch auto-triage/11-autoplays-video-so-you-dont-have-to-click-it-for-it-to-play-like-a-gif-pls
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/pages/posts/post/PostMedia.vue`:
- Around line 119-122: Add/expand a unit test for the PostMedia component that
asserts layoutControls.autoPlay and layoutControls.mute mirror the reactive
value autoplayAnimatedMedia; specifically mount or shallowMount PostMedia with
different autoplayAnimatedMedia states and verify the produced player-options
(or emitted/derived layoutControls) set autoPlay and mute accordingly so this
behavior cannot regress (reference symbols: PostMedia component,
autoplayAnimatedMedia, layoutControls.autoPlay, layoutControls.mute,
player-options test).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 720883a6-f5ac-49d6-8cf8-78e5175d8df5

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc34fe and 5273587.

📒 Files selected for processing (3)
  • components/pages/posts/post/PostMedia.vue
  • pages/settings.vue
  • test/pages/settings.test.ts

Comment on lines +119 to +122
autoPlay: autoplayAnimatedMedia.value,

mute: autoplayAnimatedMedia.value,

Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Add a focused player-options test to lock this behavior.

Consider adding/expanding a PostMedia test that verifies layoutControls.autoPlay and layoutControls.mute follow autoplayAnimatedMedia, so this doesn’t regress silently.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/pages/posts/post/PostMedia.vue` around lines 119 - 122, Add/expand
a unit test for the PostMedia component that asserts layoutControls.autoPlay and
layoutControls.mute mirror the reactive value autoplayAnimatedMedia;
specifically mount or shallowMount PostMedia with different
autoplayAnimatedMedia states and verify the produced player-options (or
emitted/derived layoutControls) set autoPlay and mute accordingly so this
behavior cannot regress (reference symbols: PostMedia component,
autoplayAnimatedMedia, layoutControls.autoPlay, layoutControls.mute,
player-options test).

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.

1 participant