Media Capabilities - Decoding Info API

Today, web developers rely on isTypeSupported() or canPlayType() to vaguely
know if some media can be decoded or not. The real question though should be:
“How well it would perform on this device?”

This is exactly one of the things the proposed Media Capabilities wants to
solve: An API to query the browser about the decoding abilities of the device
based on information such as the codecs, profile, resolution, bitrates, etc. It
would expose information such as whether the playback should be smooth and
power efficient based on previous playback statistics recorded by the browser.

In a nutshell, here’s how the Decoding Info API works for now. Check out the
official
sample.

You can try different media configurations until you find the best one
(smooth and powerEfficient) and use it to play the appropriate media
stream. By the way, Chrome’s current implementation is based on previously
recorded playback information. It defines smooth as true when the percentage
of dropped frames is less than 10% while powerEfficient is true when more
than 50% of frames are decoded by the hardware. Small frames are always
considered power efficient.

Note: The result returned from navigator.mediaCapabilities.decodingInfo will
always be reported as smooth and power-efficient if the media configuration is
supported and playback stats have not been recorded yet by the browser.

I recommend using a snippet similar to the one below to detect
availability and fallback to your current implementation for browsers that
don’t support this API.

HDR video playback on Windows 10

High Dynamic Range (HDR) videos have higher contrast, revealing precise,
detailed shadows and stunning highlights with more clarity than ever. Moreover
support for wide color gamut means colors are more vibrant.

As VP9 Profile 2 10-bit playback is now supported in Chrome for Windows 10 Fall
Creator Update, Chrome additionally supports HDR video playback when Windows 10
is in HDR mode. On a technical note, Chrome 64 now supports the scRGB color
profile which in turn allows media to play back in HDR.

All you need for now is Windows 10 Fall Creator Update, an HDR-compatible
graphics card and display (e.g. NVIDIA 10-series card, LG HDR TV or monitor),
and turn on HDR mode in Windows display settings.

Web developers can detect the approximate color gamut supported by the output
device with the recent color-gamut media query and the number of bits used to
display a color on the screen with screen.colorDepth. Here’s one way of using
those to detect if VP9 HDR is supported for instance:

Persistent licenses for Windows and Mac

Persistent license in Encrypted Media Extensions (EME) means the license can
be persisted on the device so that applications can load the license into
memory without sending another license request to the server. This is how
offline playback is supported in EME.

Until now, Chrome OS and Android were the only platforms to support persistent
licenses. It is not true anymore. Playing protected content through EME while
the device is offline is now possible in Chrome 64 on Windows and Mac as well.

Click "Make available offline" and wait for the video to be downloaded.

Turn off your internet connection.

Click the "Play" button and enjoy the video!

Media preload defaults to "metadata"

Matching other browsers' implementations, Chrome desktop now sets the default
preload value for <video> and <audio> elements to "metadata" in order to
reduce bandwidth and resource usage. This new behavior only applies in Chrome
64 to cases where no preload value is set. Note that the preload attribute's
hint is discarded when a MediaSource is attached to the media element as the
web site handles its own preload.

In other words, <video> preload value is now "metadata" while <video
preload="auto"> preload value stays "auto". Give a try to the official
sample.

Background video track optimizations

The chrome team is always trying to find new ways to improve battery life and
Chrome 63 was no exception.

If the video doesn't contain any audio tracks, the video will be automatically
paused when played in the background (e.g., in a non-visible tab) in Chrome
desktop (Windows, Mac, Linux, and Chrome OS). This is a follow-up from a
similar change that was only applying to MSE videos in Chrome 62.

Remove muting for extreme playbackRates

Before Chrome 64, sound was muted when playbackRate was below 0.5 or above 4
as the quality degraded significantly. As Chrome has switched to a
Waveform-Similarity-Overlap-Add (WSOLA) approach for quality degrading, sound
doesn’t need to be muted anymore. It means you can play sound crazy slow and
crazy fast now.