{"id":36408870,"url":"https://github.com/wrav/oembed","last_synced_at":"2026-01-16T10:56:15.407Z","repository":{"id":38146565,"uuid":"158040840","full_name":"wrav/oembed","owner":"wrav","description":"A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.","archived":false,"fork":false,"pushed_at":"2025-09-08T00:33:00.000Z","size":283,"stargazers_count":36,"open_issues_count":13,"forks_count":38,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-11T18:26:16.923Z","etag":null,"topics":["craft","craft-plugin","craftcms","graphql","iframe","instagram","oembed","twitter","vimeo","youtube"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrav.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-11-18T01:47:03.000Z","updated_at":"2025-09-08T00:28:01.000Z","dependencies_parsed_at":"2024-07-26T01:14:22.600Z","dependency_job_id":"b7e951db-569d-49e0-9241-cc0bb28451ad","html_url":"https://github.com/wrav/oembed","commit_stats":{"total_commits":83,"total_committers":9,"mean_commits":9.222222222222221,"dds":"0.15662650602409633","last_synced_commit":"b6967288b3c967e65c12cd9646fef863d2977202"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"purl":"pkg:github/wrav/oembed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrav%2Foembed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrav%2Foembed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrav%2Foembed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrav%2Foembed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrav","download_url":"https://codeload.github.com/wrav/oembed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrav%2Foembed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craft","craft-plugin","craftcms","graphql","iframe","instagram","oembed","twitter","vimeo","youtube"],"created_at":"2026-01-11T16:49:58.474Z","updated_at":"2026-01-16T10:56:15.402Z","avatar_url":"https://github.com/wrav.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oEmbed plugin for Craft CMS 3.x\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"resources/img/plugin-logo.png\" alt=\"oEmbed\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" /\u003e\n   \u003ca href=\"https://github.com/wrav/oembed/releases\" alt=\"Releases\"\u003e\n   \u003cimg src=\"https://img.shields.io/github/v/release/wrav/oembed\"\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/reganlawton\" alt=\"Maintainer\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/maintainer-reganlawton-blue\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/badges/shields/graphs/contributors\" alt=\"Contributors\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/contributors/wrav/oembed\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://github.com/wrav/oembed/pulse\" alt=\"Activity\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/commit-activity/y/wrav/oembed\" /\u003e\u003c/a\u003e  \n   \u003ca href=\"https://github.com/wrav/oembed/issues\" alt=\"Issues\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/issues-raw/wrav/oembed\" /\u003e\u003c/a\u003e\n   \u003ca href=\"https://packagist.org/packages/wrav/oembed\" alt=\"Downloads\"\u003e\n      \u003cimg src=\"https://img.shields.io/packagist/dt/wrav/oembed\" /\u003e\u003c/a\u003e   \n   \n\u003c/p\u003e\n\n\nA simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.\n\n## Seeking a New Maintainer\n\nIt's been nearly nine years since I released the first version of Oembed. While it's been an incredible journey, I no longer have the time or energy to actively maintain the project. Since 2019, I've been deeply involved in building a data and analytics startup, which has grown significantly and now demands most of my focus.\n\nTo keep this library alive and thriving, I'm looking for someone passionate about its future to take over its maintenance and development. If you're interested, please reach out by opening an issue or contacting me directly.\n\nIn the meantime, I’ll continue merging pull requests from the community to ensure the project doesn’t stagnate, though I won’t be actively contributing new features or updates. Thank you for your support over the years!\n\n## Requirements\n\nThis plugin requires Craft CMS 3.0.0-beta.23 or later.\n\n## Versions\n\n| Version | CraftCMS Version       | Embed Version | PHP Version   | Branch                          | Status        |\n|---------|------------------------|---------------|---------------|---------------------------------|---------------|\n| v1      | ^3.0.0-beta.23          | ^3.3          | \u003e=7.2.5       | [v1](https://github.com/wrav/oembed/tree/v1) | Discontinued  |\n| v2      | ^4.0                    | ^3.3          | ^8.0.2        | [v2](https://github.com/wrav/oembed/tree/v2) | Discontinued  |\n| v3      | ^3.0 \\| ^4.0 \\| ^5.0    | ^v4.4         | ^8.2          | [v3](https://github.com/wrav/oembed/tree/v3) | Active        |\n| dev-v3-php74-support | ^3.0 \\| ^4.0 \\| ^5.0 | ^v4.4         | ^7.4          | [dev-v3-php74-support](https://github.com/wrav/oembed/tree/dev-v3-php74-support) | Active (PHP 7.4 Support) |\n\n## Quick FYI on URL issues\n\nMany websites, such as Vimeo, are restricting access to standard URLs (e.g. www.vimeo.com) and sometimes require using the embed URL (e.g., player.vimeo.com) to retrieve oEmbed data.\n\nYou can typically find the embed URL through the \"share\" options on video and oEmbed-supported sites. While the plugin provides general rich content as a fallback, its true potential comes from utilizing the oEmbed protocol and the associated metadata from the content provider.\n\nIf you're experiencing issues, check whether the provider or page offers an embed version, and use that URL to ensure you're accessing the most accurate data.\n\n## Installing\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n\n        cd /path/to/project\n\n2. Then tell Composer to load the plugin:\n\n        composer require wrav/oembed\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for oEmbed.\n\n## Using oEmbed\n\nTo use simply call one of the following methods on your field type\n\n    {{ entry.field.valid }} # Get the embed object\n    {{ entry.field.render }} # Renders HTML\n    {{ entry.field.embed }} # Get the embed object\n    {{ entry.field.media }} # Get the embed object\n    \nWe also provide option to use as a Twig variable\n\n    {{ craft.oembed.valid(url, options, cacheFields) }}\n    {{ craft.oembed.render(url, options, cacheFields) }}\n    {% set embed = craft.oembed.embed(url, options, cacheFields) %}\n    {% set media = craft.oembed.media(url, options, cacheFields) %}\n    \nUpdating the embed URL, such as autoplay, rel, mute paramaters. This allows for you to support features the provider might not yet support\n\n    {{ \n        entry.oembed_field.render({\n            params: {\n                autoplay: 1,\n                rel: 0,\n                mute: 0,\n                loop: 1,\n                autopause: 1,\n            },\n            attributes: {\n                title: 'Main title',\n                'data-title': 'Some other title',\n            }\n        }) \n    }}\n    \nWe still support hte old legacy method, however this might be deprecated in future versions.\n\n    {{ \n        entry.oembed_field.render({\n             autoplay: 1,\n             rel: 0,\n             mute: 0,\n             loop: 1,\n             autopause: 1,\n        }) \n    }}\n    \nUpdating the width \u0026 height attributes on the iframe can be done using the following method, however is CSS is still recommended view for sizing your iframe.\n\n    {{ \n        entry.oembed_field.render({\n            width: 640,\n            height: 480,\n        }) \n    }}\n    \nor\n    \n    {{ \n        entry.oembed_field.render({\n            attributes: {\n                width: 640,\n                height: 480,\n            }\n        }) \n    }}\n    \nYou can access additional media details using the examples below, these are the default keys.\n\n    entry.field.media.title\n    entry.field.media.description\n    entry.field.media.url\n    entry.field.media.type\n    entry.field.media.tags\n    entry.field.media.images\n    entry.field.media.image\n    entry.field.media.imageWidth\n    entry.field.media.imageHeight\n    entry.field.media.code\n    entry.field.media.width\n    entry.field.media.height\n    entry.field.media.aspectRatio\n    entry.field.media.authorName\n    entry.field.media.authorUrl\n    entry.field.media.providerName\n    entry.field.media.providerUrl\n    entry.field.media.providerIcons\n    entry.field.media.providerIcon\n    entry.field.media.publishedDate\n    entry.field.media.license\n    entry.field.media.linkedData\n    entry.field.media.feeds\n\nYou can access additional media details from the data array. These will be snake_case so be aware.\n\n   {{ dump(entry.field.media.data) }}\n\nAdditional Embed information can be found [here](https://github.com/oscarotero/Embed)\n\n## Cache\n\nBy default, the plugin will cache the following keys on the oembed object. The plugin can cache additional missing fields using the cache prop parameter which will take an array of strings.\n\n   {{ \n      entry.oembed_field.render(\n         {\n            width: 640,\n            height: 480,\n         }, \n         [\n            'cacheable_key'\n         ]\n      ) \n   }}\n\n### Default Keys\n\n- title\n- description\n- url\n- type\n- tags\n- images\n- image\n- imageWidth\n- imageHeight\n- code\n- width\n- height\n- aspectRatio\n- authorName\n- authorUrl\n- providerName\n- providerUrl\n- providerIcons\n- providerIcon\n- publishedDate\n- license\n- linkedData\n- feeds\n\n## Cookie Management\n\nThe plugin includes automatic cookie file cleanup to prevent server storage issues from accumulating embed-cookie files created by the underlying `embed/embed` library.\n\n### Settings\n\nCookie cleanup can be configured in the plugin settings:\n\n- **Enable Cookie Cleanup** (default: `true`) - Enable/disable automatic cookie file cleanup\n- **Cookie Max Age** (default: `86400` seconds / 24 hours) - Maximum age of cookie files before cleanup (minimum: 300 seconds)\n- **Cookies Path** (optional) - Custom directory path for cookie files (uses system temp directory if empty)\n\n### Manual Cleanup Commands\n\nYou can manually manage cookie files using the console commands:\n\n```bash\n# Clean up old cookie files\nphp craft oembed/cookie/cleanup\n\n# Get information about cookie files\nphp craft oembed/cookie/info\n```\n\n### Automatic Cleanup\n\nCookie cleanup runs automatically on plugin initialization with built-in throttling to prevent performance impact:\n\n- Cleanup runs at most once per hour\n- Only processes files older than the configured `cookieMaxAge`\n- Only removes files matching the pattern `embed-cookies-*`\n- Preserves non-cookie files and recently created files\n\n## GraphQL\n\nI recommend enabling caching in the plugin settings menu to speed up the API resolve timing.\n\nBelow is an example of a Oembed field called \"foobar\" add accessing properties from the embed object.\n\n```\n{\n  entries {\n    id,\n    ... on page_page_Entry {\n      foobar {\n        code,\n        providerUrl,\n        aspectRatio\n      }\n    }\n  }\n}\n```\n\n## Testing\n\nThis project uses Codeception and Docker Compose (Locally) and I would strongly ask for unit tests, however I understand sometimes this may not be needed.\n\n***NOTE:*** If your wanting to run the all project tests you'll need to set up the required Meta, Twitter, etc API tokens in the `.env` file.\n\n```bash\n# Setting ENV for testing and edit\ncp tests/.env.example tests/.env\n\n# Spin up docker\ndocker compose up -d\n\n# Access shell \ndocker exec -it app sh\n\n# Run tests via Codeception\nvendor/bin/codecept run {your_file}\n\n# Run with Coverage\nXDEBUG_MODE=coverage vendor/bin/codecept run --coverage\n```\n\n## Credits\n\nOriginal built while working at [HutSix](https://hutsix.com.au/) I've since been granted permission to continue development here.\n\n## Change Log\n\nChanges can be viewed [here](https://github.com/wrav/oembed/blob/master/CHANGELOG.md)\n\n## Support\n\nGet in touch via email, Discord, or by [creating a Github issue](/wrav/oembed/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrav%2Foembed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrav%2Foembed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrav%2Foembed/lists"}