{"version":"https://jsonfeed.org/version/1","title":"Aaron Gustafson: Content tagged media","description":"The latest 20 posts and links tagged media.","home_page_url":"https://www.aaron-gustafson.com","feed_url":"https://www.aaron-gustafson.com/feeds/media.json","author":{"name":"Aaron Gustafson","url":"https://www.aaron-gustafson.com"},"icon":"https://www.aaron-gustafson.com/i/og-logo.png","favicon":"https://www.aaron-gustafson.com/favicon.png","expired":false,"items":[{"id":"https://www.aaron-gustafson.com/notebook/fullscreen-video-and-iframes-made-easy/","title":"✍🏻 Fullscreen Video and Iframes Made Easy","summary":"The fullscreen-control web component adds fullscreen capabilities to any video or iframe element with a single wrapper and zero configuration.","content_html":"<p>Adding fullscreen capabilities to videos and embedded iframes shouldn’t require wrestling with prefixed APIs or managing focus states. The <code>fullscreen-control</code> web component handles all of that for you — just wrap it around the element. The component handles the rest as a discrete progressive enhancement.</p>\n<h2 id=\"easy-peasy\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#easy-peasy\" aria-hidden=\"true\">#</a> Easy-peasy</h2>\n<p>Here’s a simple example using a <code>video</code> element:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>fullscreen-control</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>video</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>video.mp4<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>video</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>fullscreen-control</span><span class=\"token punctuation\">></span></span></code></pre>\n<p>With that in place, the component</p>\n<ul>\n<li>Adds a styleable button for launching fullscreen control over the contained element,</li>\n<li>Handles browser prefixes as needed,</li>\n<li>Manages focus automatically,</li>\n<li>Rigs up the necessary keyboard events (e.g. <kbd>Escape</kbd> to exit), and</li>\n<li>Assigns the relevant ARIA attributes.</li>\n</ul>\n<p>The component uses light DOM, so your <code>video</code> stays in the regular DOM tree and all your existing CSS continues to work.</p>\n<h2 id=\"fullscreen-iframes\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#fullscreen-iframes\" aria-hidden=\"true\">#</a> Fullscreen iframes</h2>\n<p>Need to embed a YouTube video, slide deck, or code demo? The component works with <code>iframe</code> elements too:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>fullscreen-control</span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>iframe</span>\n    <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>https://www.youtube.com/embed/dQw4w9WgXcQ<span class=\"token punctuation\">\"</span></span>\n    <span class=\"token attr-name\">width</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>560<span class=\"token punctuation\">\"</span></span>\n    <span class=\"token attr-name\">height</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>315<span class=\"token punctuation\">\"</span></span>\n    <span class=\"token attr-name\">title</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>YouTube video player<span class=\"token punctuation\">\"</span></span>\n  <span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>iframe</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>fullscreen-control</span><span class=\"token punctuation\">></span></span></code></pre>\n<p>The component automatically adds the necessary <code>allow=&quot;fullscreen&quot;</code> and <code>allowfullscreen</code> attributes, including prefixed versions for broader compatibility.</p>\n<h2 id=\"customizable-button-text\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#customizable-button-text\" aria-hidden=\"true\">#</a> Customizable <code>button</code> text</h2>\n<p>You can change the <code>button</code> label to match your site’s language or writing style by setting the <code>button-text</code> attribute:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>fullscreen-control</span> <span class=\"token attr-name\">button-text</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>全画面表示<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>video</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>video.mp4<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>video</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>fullscreen-control</span><span class=\"token punctuation\">></span></span></code></pre>\n<p>The default button label is “View fullscreen,” but you can use this attribute to customize it to anything you like. You can even dynamically inject the accessible name of the contained element, using the <code>{name}</code> token. For example:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>fullscreen-control</span> <span class=\"token attr-name\">button-text</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>View {name} fullscreen<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>video</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>video.mp4<span class=\"token punctuation\">\"</span></span> <span class=\"token attr-name\">aria-label</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>Product demo<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>video</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>fullscreen-control</span><span class=\"token punctuation\">></span></span></code></pre>\n<p>This creates a <code>button</code> with the text “View Product demo fullscreen”. The component looks for <code>aria-label</code>, <code>title</code>, or other native naming on the wrapped element and uses that to make the <code>button</code> contextual.</p>\n<h2 id=\"distinct-screen-reader-labels\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#distinct-screen-reader-labels\" aria-hidden=\"true\">#</a> Distinct screen reader labels</h2>\n<p>If you want the visible label and accessible button name to differ, use the <code>button-label</code> attribute. Like <code>button-text</code>, it can also inject the accessible name of the controlled element using the <code>{name}</code> token:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>fullscreen-control</span>\n  <span class=\"token attr-name\">button-text</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>Fullscreen<span class=\"token punctuation\">\"</span></span>\n  <span class=\"token attr-name\">button-label</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>View {name} in fullscreen mode<span class=\"token punctuation\">\"</span></span>\n<span class=\"token punctuation\">></span></span>\n  <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>iframe</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>https://example.com<span class=\"token punctuation\">\"</span></span> <span class=\"token attr-name\">title</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>Product teaser<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span> <span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>iframe</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>fullscreen-control</span><span class=\"token punctuation\">></span></span></code></pre>\n<p>This code will generate a <code>button</code> that visually reads “Fullscreen”, but is announced as “View Product teaser in fullscreen mode” to screen readers. In mode cases, <code>button-text</code> will suffice, but this option is available if you need to distinguish the buttons of multiple fullscreen controls from one another and don’t have visual space to display their accessible names.</p>\n<h2 id=\"focus-management\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#focus-management\" aria-hidden=\"true\">#</a> Focus management</h2>\n<p>If users activate fullscreen using the button, focus will automatically return to the button upon exiting fullscreen. This ensures keyboard users don’t lose their place.</p>\n<h2 id=\"need-more-control%3F\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#need-more-control%3F\" aria-hidden=\"true\">#</a> Need more control?</h2>\n<p>Want to manage the component yourself? The component exposes three methods:</p>\n<pre class=\"language-javascript\" tabindex=\"0\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> control <span class=\"token operator\">=</span> document<span class=\"token punctuation\">.</span><span class=\"token function\">querySelector</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"fullscreen-control\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\">// Enter fullscreen</span>\n<span class=\"token keyword\">await</span> control<span class=\"token punctuation\">.</span><span class=\"token function\">enterFullscreen</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\">// Exit fullscreen</span>\n<span class=\"token keyword\">await</span> control<span class=\"token punctuation\">.</span><span class=\"token function\">exitFullscreen</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token comment\">// Toggle fullscreen state</span>\ncontrol<span class=\"token punctuation\">.</span><span class=\"token function\">toggleFullscreen</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre>\n<p>These handle all the browser prefixes and error handling for you.</p>\n<p>There are also a set of events you can tap into when the fullscreen state changes:</p>\n<pre class=\"language-javascript\" tabindex=\"0\"><code class=\"language-javascript\"><span class=\"token keyword\">const</span> control <span class=\"token operator\">=</span> document<span class=\"token punctuation\">.</span><span class=\"token function\">querySelector</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"fullscreen-control\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ncontrol<span class=\"token punctuation\">.</span><span class=\"token function\">addEventListener</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"fullscreen-control:enter\"</span><span class=\"token punctuation\">,</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n  console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Entered fullscreen mode\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n\ncontrol<span class=\"token punctuation\">.</span><span class=\"token function\">addEventListener</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"fullscreen-control:exit\"</span><span class=\"token punctuation\">,</span> <span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span> <span class=\"token operator\">=></span> <span class=\"token punctuation\">{</span>\n  console<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"Exited fullscreen mode\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre>\n<p>These events give you the ability to pause other media, track analytics, and the like.</p>\n<h2 id=\"style-the-button\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#style-the-button\" aria-hidden=\"true\">#</a> Style the button</h2>\n<p>Since the component uses light DOM, you can style the button directly with CSS:</p>\n<pre class=\"language-css\" tabindex=\"0\"><code class=\"language-css\"><span class=\"token selector\">fullscreen-control button</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token property\">background</span><span class=\"token punctuation\">:</span> #ff6b6b<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">color</span><span class=\"token punctuation\">:</span> white<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">border</span><span class=\"token punctuation\">:</span> none<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">padding</span><span class=\"token punctuation\">:</span> 0.75rem 1.5rem<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">border-radius</span><span class=\"token punctuation\">:</span> 20px<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">font-weight</span><span class=\"token punctuation\">:</span> bold<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span>\n\n<span class=\"token selector\">fullscreen-control button:hover</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token property\">background</span><span class=\"token punctuation\">:</span> #ff5252<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre>\n<p>The button is positioned absolutely by default (top-right corner), but you can adjust this with CSS custom properties:</p>\n<pre class=\"language-css\" tabindex=\"0\"><code class=\"language-css\"><span class=\"token selector\">fullscreen-control</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token property\">--fullscreen-control-button-inset-block-start</span><span class=\"token punctuation\">:</span> 1rem<span class=\"token punctuation\">;</span>\n  <span class=\"token property\">--fullscreen-control-button-inset-inline-end</span><span class=\"token punctuation\">:</span> 1rem<span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre>\n<p>This uses logical properties, so it adapts automatically to different writing modes.</p>\n<h2 id=\"installation\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#installation\" aria-hidden=\"true\">#</a> Installation</h2>\n<p>Install via npm:</p>\n<pre class=\"language-bash\" tabindex=\"0\"><code class=\"language-bash\"><span class=\"token function\">npm</span> <span class=\"token function\">install</span> @aarongustafson/fullscreen-control</code></pre>\n<p>Then import it in your JavaScript:</p>\n<pre class=\"language-javascript\" tabindex=\"0\"><code class=\"language-javascript\"><span class=\"token keyword\">import</span> <span class=\"token string\">\"@aarongustafson/fullscreen-control/define.js\"</span><span class=\"token punctuation\">;</span></code></pre>\n<p>Or load it from a CDN for quick prototyping:</p>\n<pre class=\"language-html\" tabindex=\"0\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>script</span> <span class=\"token attr-name\">type</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>module<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token script\"><span class=\"token language-javascript\">\n  <span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> defineFullscreenControl <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">\"https://unpkg.com/@aarongustafson/fullscreen-control@latest/define.js?module\"</span><span class=\"token punctuation\">;</span>\n  <span class=\"token function\">defineFullscreenControl</span><span class=\"token punctuation\">(</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n</span></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>script</span><span class=\"token punctuation\">></span></span></code></pre>\n<h2 id=\"browser-support\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#browser-support\" aria-hidden=\"true\">#</a> Browser support</h2>\n<p>The component uses modern web standards (Custom Elements v1, ES Modules) and handles browser-prefixed fullscreen APIs internally. For older browsers, you may need polyfills, but the component gracefully handles missing APIs with console warnings rather than breaking your page.</p>\n<h2 id=\"demo-and-source-code\" tabindex=\"-1\"><a class=\"header-anchor\" href=\"#demo-and-source-code\" aria-hidden=\"true\">#</a> Demo and source code</h2>\n<p>Check out the <a href=\"https://aarongustafson.github.io/fullscreen-control/demo/\">live demo</a> to see all the features in action, or grab the code from <a href=\"https://github.com/aarongustafson/fullscreen-control\">GitHub</a>.</p>\n","social_text":"Add fullscreen controls to videos and iframes with progressive enhancement. One wrapper, zero hassle.","url":"https://www.aaron-gustafson.com/notebook/fullscreen-video-and-iframes-made-easy/","tags":["web components","progressive enhancement","HTML","video","accessibility","media"],"date_published":"2025-12-29T17:17:27Z"},{"id":"https://www.aaron-gustafson.com/notebook/over-90-of-newspaper-reading-is-in-print/","title":"✍🏻 Study: Over 90% of Newspaper Reading is in Print","summary":"A recent study in of the UK came to the conclusion that over 90% of newspaper reading is still taking place in print. Their findings are based on a survey of 12 UK newspapers during the period of 2007–2011, examining National Readership…","content_html":"<p>\n\tA <a href=\"http://www.tandfonline.com/doi/pdf/10.1080/21670811.2013.818365\">recent study in of the UK</a> came to the conclusion that over 90% of newspaper reading is still taking place in print. Their findings are based on a survey of 12 UK newspapers during the period of 2007–2011, examining National Readership Survey data, circulation audits from the Audit Bureau of Circulations, and Neilsen data regarding web-based engagement.</p>\n<p>\n\tIn reviewing their domestic readership, comparing time spent reading online versus time spent reading print editions, the study found that 96.7% of reading time was spent with the print edition. Of course the “quality” of said publications varied greatly and that sad figure was even sadder for some online editions: Readers of “tabloid” newspapers spent, on average, a depressing 1.16% of their time reading the paper online. On the flip side, proper news outlets that are not behind a paywall saw 6.98% of their readership online. Paywalled online editions were all over the place: 4.1% for the <cite>Financial Times</cite> and only 0.83% for the <cite>Times</cite>.</p>\n<p>\n\tI think the most interesting stat, however, was that the overall reading of some of these publications actually <em>declined</em> over the study period. In fact, the total time people spent reading the <cite>Independent</cite> went down 30.88% between 2007 and 2011.</p>\n<p>\n\tDue to limitations of the data from the Audit Bureau of Circulations, the study was not able to include circulation data via apps and the meager data they could get was mostly self-reported and had to do mainly with page requests. They could not get data on reading time spent with the various newspapers’ apps.</p>\n<p>\n\tNow granted, the data they used for the study is two years old at this point and some of the newspapers have redesigned their websites since this time, but the study got me wondering:</p>\n<ul>\n<li>\n\t\tIs the reason online newspaper readership and engagement doesn’t compare to print because <a href=\"http://bradcolbow.com/archive/view/the_brads_this_is_why_your_newspaper_is_dying/\">so many newspaper websites are cluttered and unreadable</a>?</li>\n<li>\n\t\tIs the lack of decent mobile web support a contributing factor?</li>\n<li>\n\t\tHow has the advent of media queries and responsive design changed the data since 2011?</li>\n<li>\n\t\tIs there a correlation in the US and other newspaper markets as well? It seems all the stats we see show print declining here.</li>\n<li>\n\t\tWith <a href=\"http://www.thedailybeast.com/articles/2012/10/18/a-turn-of-the-page-for-newsweek.html\"><cite>Newsweek</cite> killing off its print version back in 2012</a> and many calls for Jeff Bezos to do the same with the <cite>Washington Post</cite>, is that a wise strategy?</li>\n</ul>\n<p>\n\tHaving come from a journalism background, I am incredibly interested in seeing where things go. I have mixed feelings about print versus digital. On one hand, I have not subscribed to a newspaper for as long as I can remember. I only read them occasionally while traveling; most of my reading takes place digitally (online or at least via online sources). On the other hand, I do see print editions as being some people’s only access to what is going on around them.</p>\n<p>\n\tIt will be interesting to see how this all shakes out.</p>\n<p>\n<strong>Update:</strong> I made a small tweak to the declining readership paragraph per Neil’s correction in the comments.</p>\n","url":"https://www.aaron-gustafson.com/notebook/over-90-of-newspaper-reading-is-in-print/","tags":["media","society"],"date_published":"2013-08-12T15:45:00Z"}]}