Vimeo oEmbed now has dnt=1 parameter
-
I don’t exactly know when this started occuring, since I didn’t cross-check the version with a particular date, but it seems that Vimeo oEmbed players are now being given a
dnt=1
parameter on the Vimeo player’s iframe source URL. This is causing an issue that may have been overlooked.If there are numerious Vimeo videos embedded on the page, previously (by default), Vimeo would only allow one of those video to play at a time. If a user played one video — then started playing another video — it would then pause the previous video that as playing. Again, this is default Vimeo behavior. However, when the Vimeo URL has the parameter of
dnt=1
on the URL, it causes that default behavior to be overridden. Therefore, it allows the user to play multiple videos at once (which is NOT default behavior, and is arguably not very “Accessible friendly”.Digging into the code, I see that it’s likely this following function from
class-wp-oembed.php
that’s the culprit. Is there a way to override this function, with something in the child theme? If not, it seems I’d be forced to either:- replace URLs with jQuery
- embed the Vimeo videos with an iframe code, instead of the oEmbed feature
Ideally, this would be looked in to further, since it nows overrides default/expected Vimeo behavior.
/** * Connects to a oEmbed provider and returns the result. * * @since 2.9.0 * * @param string $provider The URL to the oEmbed provider. * @param string $url The URL to the content that is desired to be embedded. * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty. * @return object|false The result in the form of an object on success, false on failure. */ public function fetch( $provider, $url, $args = '' ) { $args = wp_parse_args( $args, wp_embed_defaults( $url ) ); $provider = add_query_arg( 'maxwidth', (int) $args['width'], $provider ); $provider = add_query_arg( 'maxheight', (int) $args['height'], $provider ); $provider = add_query_arg( 'url', urlencode( $url ), $provider ); $provider = add_query_arg( 'dnt', 1, $provider ); /** * Filters the oEmbed URL to be fetched. * * @since 2.9.0 * @since 4.9.0 The <code>dnt</code> (Do Not Track) query parameter was added to all oEmbed provider URLs. * * @param string $provider URL of the oEmbed provider. * @param string $url URL of the content to be embedded. * @param array $args Optional arguments, usually passed from a shortcode. */ $provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args ); foreach ( array( 'json', 'xml' ) as $format ) { $result = $this->_fetch_with_format( $provider, $format ); if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() ) { continue; } return ( $result && ! is_wp_error( $result ) ) ? $result : false; } return false; }
- The topic ‘Vimeo oEmbed now has dnt=1 parameter’ is closed to new replies.