Module Description
MyTube is a content filter developed by the Electronic Frontier Foundation. It is designed to protect visitors' privacy (and provide compliance with privacy regulations such as GDPR, CCPA/CPRA, etc.) while still allowing videos or other embedded content to be viewed on your site. MyTube works by automatically replacing user-submitted embed code with local image tags that load the embed code when clicked. This prevents remote-site requests, cookies, Flash cookies and similar invasions of privacy from automatically plaguing visitors when they access your page because, until the user clicks play, no remote request is made to the third-party website. See here for an example.

Unlike existing filters for embed code, MyTube does not generate any embed code. Instead, it processes existing embeds, modifies them according to the administrator's settings, and converts them into clickable thumbnails. The thumbnails, when activated, will then use JQuery to swap themselves out for the original embed code. To ensure that the user is making an educated choice about whether or not to load the embed (and to show that the administrator cares about their privacy), a disclaimer text is also placed below the thumbnail, with a best-effort attempt to figure out the source, alerting users to the privacy concerns associated with loading an embedded object.

For your viewers, the experience is much like having Flashblock enabled for your entire site, except that most videos (such as YouTube) will have the correct thumbnails instead of a generic play button, and will automatically play the first time they're clicked on. This is done by downloading the thumbnail in question, and displaying it from the site's public://mytube folder for recognized sites, while displaying a generic thumbnail for others, then modifying the embed code to autoplay when it does finally load. For unrecognized embed codes, the process is the same and MyTube should still swap it out for a generic thumbnail. This makes the process relatively transparent for those who are not technically-inclined or detail-oriented, but a noticeable gesture towards privacy for others. Additionally, without automatically loading embedded content (such as iframes), content on your site will load faster for the end users, making it more accessible to users with old computers or slow internet connections.

Instructions: After installing the module, administrators should enable "MyTube Filtering" for any input formats that will allow embeds. It is strongly recommended that administrators then enable the HTML Filter and arrange it before MyTube; failure to do so means it may be possible for users to inject arbitrary scripts into your website using embeds. MyTube will not conflict with the HTML Filter; if you trust your users, you should whitelist each individual tag you wish to allow (MyTube will currently process <embed>, <iframe> and <object>). If you do not trust them (e.g. relatively anonymous users), then you should use a different filter that generates embed code (such as Video Filter) instead of allowing them to submit such dangerous code. Any tags or attributes the administrator wishes to restrict can be restricted without breaking MyTube's ability to filter other authorized (or in the case of video filter, generated) tags. MyTube will make a best-effort attempt to replace all kinds of embed code listed here, and for stability reasons, MyTube will automatically implement the HTML Corrector filter, whether that filter is enabled or not. If enabled, it should be noted that the HTML Corrector will be run twice, but the performance toll is negligible.

Beyond this initial setup, MyTube should require little if any configuration, but offers several customizable options (requires "administer mytube" permissions) for appearance on its settings page. All <embed>, <iframe>, and <object> tags passed through the filter will be replaced with MyTube thumbnails, whether the source is recognized or not. Unrecognized sources will default to an included default.gif thumbnail. For these individual videos, a custom thumbnail can be added by adding thumb="$relative_directory" to the first affected tag. MyTube will also make a best-effort attempt to recognize the video source and display it in the privacy info text. Default thumbnails for YouTube™ and Vimeo™ videos are downloaded to public://mytube automatically and cannot be overridden.

Integrations: On Drupal 7, the "Apply the MyTube filter to Video Embed Field embed code" setting enables the MyTube filter to be applied to embed code generated by Video Embed Field module. In Video Embed Field version 8.x-2.x, the "lazy load" field formatter enables functionality similar to MyTube, i.e. no integration should be necessary.

Credits: MyTube was upgraded by Brian Swaney in collaboration with Tim Jones, the original author. It is currently maintained by Squiggy Rubio and mfb.

Project Usage
354
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
MyTube is a content filter designed to protect visitors' privacy by replacing user-submitted embed code with local image tags that load the embed code when clicked, preventing remote-site requests and invasions of privacy until the user chooses to play the content.
Data Name
mytube

OPENAI CHATBOT

OPENAI CHATBOT

08:39:16
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.