Skip to content

Conversation

@error9098x
Copy link
Contributor

Description

Enable muted autoplay for the YouTube video in the docs “Watch & Learn” section to improve UX. Autoplay is requested via YouTube URL params (required by modern browser policies), and the redundant autoPlay attribute is removed.

  • Affected file: next-cloudinary/docs/components/Video/Video.js
  • Affected page: /cldimage/basic-usage → “Watch & Learn”

Before vs After

Before (no autoplay) After (muted autoplay)
Video becomes visible but doesn’t start Video begins playing muted when visible

Code change

--- a/next-cloudinary/docs/components/Video/Video.js
+++ b/next-cloudinary/docs/components/Video/Video.js
@@ -56,13 +56,12 @@ export const Video = ({
         >
           <iframe
             title={title}
             width={width}
             height={height}
-            src={`https://www.youtube.com/embed/${videoId}?feature=oembed`}
+            src={`https://www.youtube.com/embed/${videoId}?feature=oembed&autoplay=1&mute=1&playsinline=1`}
             frameBorder="0"
             allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
             allowFullScreen
-            autoPlay
           />
         </div>
       ) : (

No new dependencies.

Issue Ticket Number

Fixes #640

Type of change

  • Fix or improve the documentation
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I have followed the contributing guidelines of this project as mentioned in CONTRIBUTING.md
  • I have created an issue ticket for this PR
  • I have checked to ensure there aren't other open Pull Requests for the same update/change?
  • I have performed a self-review of my own code
  • I have run tests locally to ensure they all pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes needed to the documentation

@vercel
Copy link

vercel bot commented Oct 29, 2025

@error9098x is attempting to deploy a commit to the Cloudinary DevX Team on Vercel.

A member of the Team first needs to authorize it.

@eportis-cloudinary
Copy link
Contributor

Hi @error9098x ! Thank you for this contribution.

I don't think we actually want the video to autoplay. Thank you for catching that we were using the autoPlay attribute, and making it actually functional -- however I have edited your PR to strip the attribute entirely instead, and am merging it. Thanks!

@eportis-cloudinary eportis-cloudinary merged commit 6f1c5e4 into cloudinary-community:main Nov 15, 2025
3 of 4 checks passed
@eportis-cloudinary
Copy link
Contributor

@all-contributors please add @error9098x for docs

@allcontributors
Copy link
Contributor

@eportis-cloudinary

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected string in JSON at position 11236

@github-actions
Copy link

🎉 This PR is included in version 6.17.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@error9098x
Copy link
Contributor Author

@

Hi @error9098x ! Thank you for this contribution.

I don't think we actually want the video to autoplay. Thank you for catching that we were using the autoPlay attribute, and making it actually functional -- however I have edited your PR to strip the attribute entirely instead, and am merging it. Thanks!

No problem, makes sense. Thanks for using my PR for fixing the issue :)

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.

[Bug] Docs video doesn’t autoplay in “Watch & Learn” section

2 participants