Skip to content

Directive: media src

Ryan Parman edited this page Jun 14, 2024 · 7 revisions

Overview

The media-src directive specifies valid sources for loading media using the <audio> and <video> elements.

Affects: <audio> and <video>, along with their nested <source> and <track> elements.

Required reading:

Usage examples

Accepts one or more schemes or hosts, the 'self' keyword, or the 'none' keyword.

media-src 'none'
media-src 'self'
media-src example.com
media-src example.com example.org
media-src https://*.example.com
media-src https:

Fallbacks

media-src will fallback to default-src if it is undefined.

Possible errors

  • CSP-0100 — [ERROR] directive %s has an invalid value %s

For developers

ABNF (CSP3)

directive-name  = "media-src"
directive-value = serialized-source-list

See ABNF: serialized-source-list

Type

References

Clone this wiki locally