Skip to main content

The PreTeXt Guide

Subsection 29.1.5 Privacy Options for Video Embedding

When videos are embedded in HTML from sites like YouTube 2  or Vimeo 3 , they come with whatever tracking cookies these sites want to include. Some of these can be helpful; for example, to let the viewer keep track of what they have watched. Others are designed to target advertising, and load when the page loads, rather than when the video plays, which can increase the time it takes for your book to load.
Currently YouTube offers an “enhanced privacy mode” that disables tracking cookies on page load. The assumption is that publishers will want to protect their readers’ privacy and optimage page load time, so this mode is turned on by default for YouTube videos. It is not known to be available for other platforms, but can be added if this changes. Note that the behavior and appearance of your videos may change slightly depending on which option you choose.
Within the <publication> element of your publication file include an <html> element, with a child element <video> having an attribute @privacy. The value must be either yes (use enhanced privacy, if available), or no (allow all tracking cookies). If your publication file does not have this element (or you do not have a publication file) you will get a warning message, and the default will be used. See Subsection 44.4.12 for details on specifying this option.