url_to_video_filter
Overview
This module allows users to paste a URL from various video sharing websites, and upon submission replaces the URL with the video from that URL. The module does this by creating a new text filter, that can be added to any input format (such as Full HTML or Limited HTML). It works much the same as the Convert URLs into links text filter that ships with core, however instead of converting URLs to links, it instead converts the URLs into embedded videos.
Supported Services
Currently this module supports the following services:
- YouTube
- Twitter/X (as of 4.0.0-rc2)
- Vimeo
As of version 4.x.x, video services are plugins, and additional services can be created by implementing new plugins. View the YouTube and Vimeo plugins for examples.
Please open a feature request in the support queue for other services.
Configuration
- Install the module as you would any module
- Edit or create a new text format at
/config/content/formats - Check the Convert URLs to embedded videos checkbox
- Select the video sharing services you wish to enable in the filter settings
- If you have the Limit allowed HTML tags and correct faulty HTML filter enabled, you will need to add the following in the Allowed HTML tags in the filter settings:
<span class data-youtube-id data-twitter-id data-vimeo-id> - If you have enabled the Convert URLs into links filter, ensure that this filter comes before it. Often, this filter should come before any other filters, but you may need to play around with the priority
- Create an entity with a text field that uses this filter, and paste a video URL from a service you've enabled directly into the body and save, and the URL will be replaced with the given video. URLs with query strings are supported.
Troubleshooting
If the video is not rendering, you may have to work with changing the order of the filters within the text format. For example, "Limit allowed HTML tags and correct faulty HTML" if enabled must come before "Convert URLs to embedded videos".
Development Roadmap
At this moment, nothing is planned. If you have support requests, please open an issue in the issue queue. New services will be added if they have an API allowing for videos embedded from their service.