What Is the SMIL systemScreenSize Test Attribute?

The systemScreenSize attribute in Synchronized Multimedia Integration Language (SMIL) is a conditional test attribute used to evaluate the host display's physical resolution before rendering content. By determining whether the playback device meets specific screen dimension requirements, systemScreenSize allows authors to deliver responsive, device-appropriate layouts, images, and video streams across heterogeneous hardware without requiring server-side media processing.

Core Mechanics and Syntax

SMIL defines a suite of system test attributes designed for runtime content adaptation. The systemScreenSize attribute specifically tests the available screen height and width of the client display in pixels.

The attribute value is formatted as a pixel dimension pair separated by an uppercase "X" (for example, 1024X768 or 1920X1080):

<switch>
  <video src="hd_stream.mp4" systemScreenSize="1920X1080" region="main_viewport" />
  <video src="sd_stream.mp4" systemScreenSize="800X600" region="main_viewport" />
  <video src="lowres_stream.mp4" region="main_viewport" />
</switch>

When evaluated, the SMIL playback engine checks the target display environment. If the screen resolution matches or exceeds the specified dimensions (depending on the SMIL profile and implementation), the condition returns true, and the associated element executes.

Behavior Across Different SMIL Displays

Different target displays handle multimedia playback under vastly distinct hardware constraints. The systemScreenSize attribute plays a pivotal role in standardizing presentation behavior across these environments:

Digital Signage and Commercial Displays

Digital signage setups range from compact retail shelf screens to multi-panel video walls. In signage appliances powered by SMIL (such as dedicated media players running SMIL-compliant firmwares):

Mobile and Embedded Handhelds

Mobile SMIL players (historically prevalent in 3GPP MMS messaging and lightweight embedded multimedia suites) operate under strict memory and battery limits. Using systemScreenSize ensures that:

Desktop and Web SMIL Runtimes

On desktop multimedia players or SVG/SMIL browser integrations, the host display may vary based on multi-monitor setups or variable window resolutions. While SMIL 3.0 allows layout scalability through percentage-based coordinates, systemScreenSize provides a discrete gatekeeper for asset selection, ensuring bitrate and memory usage align with output capabilities.

Role Inside the SMIL <switch> Element

While systemScreenSize can technically be placed on individual media tags, its primary utility is inside a SMIL <switch> container.

The <switch> element processes its child elements in sequential order, selecting the very first child whose test attributes evaluate to true. To ensure effective fallback behavior across varying display sizes, elements must be organized from the most restrictive (largest resolution) to the least restrictive (smallest resolution), concluding with an untagged default fallback.

<switch>
  <!-- Selected only on Ultra HD displays -->
  <layout systemScreenSize="3840X2160">
    <root-layout width="3840" height="2160" backgroundColor="black" />
    <region id="content" top="0" left="0" width="3840" height="2160" />
  </layout>

  <!-- Selected on standard High Definition displays -->
  <layout systemScreenSize="1920X1080">
    <root-layout width="1920" height="1080" backgroundColor="black" />
    <region id="content" top="0" left="0" width="1920" height="1080" />
  </layout>

  <!-- Default fallback layout for all other display sizes -->
  <layout>
    <root-layout width="1280" height="720" backgroundColor="black" />
    <region id="content" top="0" left="0" width="1280" height="720" />
  </layout>
</switch>

Complementary System Test Attributes

To achieve comprehensive adaptive rendering across diverse displays, systemScreenSize is frequently combined with other SMIL test attributes: