# Platform support

What each platform's engine does differently from the media player's contract, as the conformance scenarios measure it.

The same conformance scenarios run against every engine: on Windows, macOS, Linux, an Android
phone, the iOS simulator and Chrome. Where an engine cannot follow a rule, the scenario reports a deviation
instead of hiding it. This page lists them.

## Engines

| Platform | Engine | Rendering |
| -------- | ------ | --------- |
| Windows | Media Foundation (`IMFMediaEngine`) | A shared Direct3D 11 texture, no CPU copy |
| macOS | AVFoundation (`AVPlayer`) | An IOSurface drawn by Metal, no CPU copy |
| Android | Media3 ExoPlayer | A `TextureView` |
| iOS | AVFoundation (`AVPlayer`) | A Metal layer |
| Web | `<video>`, hls.js, dash.js | A WebGL texture drawn by Compose (Compose 1.13+) |
| Linux | GStreamer (`playbin3`) | A DMA-BUF drawn by the GPU, no CPU copy (a software decoder's frames are uploaded) |

## Features by platform

| Feature | Windows | macOS | Linux | iOS | Android | Web |
| ------- | ------- | ----- | ----- | --- | ------- | --- |
| Files: MP4, MP3, AAC, FLAC, WAV | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| HLS | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| DASH | ✓ | — | ✓ | — | ✓ | ✓ |
| Smooth Streaming | — | — | No seeks, see below | — | ✓ | ✓ |
| Track selection | Audio only, see below | Variants cap, see below | ✓ | Variants cap, see below | ✓ | ✓ |
| Subtitles carried by a stream | — | ✓ | ✓ | ✓ | ✓ | ✓ |
| Timed metadata | — | HLS ID3 | ✓ | HLS ID3 | ✓ | ✓ |
| Key-frame seeks (`CLOSEST_SYNC`) | Exact instead | ✓ (files) | ✓ | ✓ (files, iOS 16+) | ✓ | Firefox, Safari |
| `preservesPitch` | Fixed behaviour | ✓ | ✓ | ✓ | ✓ | ✓ |
| `skipSilence` | — | — | — | — | ✓ | — |
| Loudness and equalizer | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ (CORS) |
| Stats | ✓ | ✓ | ✓ | Frames estimated | ✓ | ✓ |
| Thumbnails | ✓ | ✓ | ✓ | ✓ | ✓ | Files only |
| Offline: files and HLS | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Offline: DASH and Smooth Streaming | — | — | — | — | ✓ | — |
| Picture-in-picture | — | — | — | ✓ | ✓ | — |

## Windows: Media Foundation

- **Adaptive streams show one video track.** Media Foundation's HLS and DASH sources adapt the
  variants themselves: `tracks` lists the variant on screen only, and none can be locked.
- **Alternate audio renditions are listed but the default plays.** The engine accepts a selection
  and keeps the default rendition.
- **No subtitles carried by a stream.** External SRT and WebVTT files work.
- **A missing segment is played over.** Its HLS and DASH sources fetch with their own HTTP stack
  and report nothing when a segment fails: playback goes on to the end without an error.
- **A live seek lands on the start of a segment**, not on the frame.
- **No timed metadata, no key-frame seeks, no silence skipping, no pitch setting.**
- **No Smooth Streaming**: opening one reports an error at once.

## Android: ExoPlayer

- **Smooth Streaming seeks right after opening.** The manifest has no frame rate and ExoPlayer
  shows the first frame at or after a target: until playback has shown the frame interval, a
  paused seek between two frame starts shows the next frame.
- **Skipping silences holds the position** while ExoPlayer analyses a silent passage, then jumps
  past it.

## Web

- **Chrome has no key-frame seek** (`fastSeek`): `CLOSEST_SYNC` seeks exactly.
- **Loudness and equalizer route the element through WebAudio**, which plays media from another
  origin silently unless it allows CORS.
- **Thumbnails** work for files the element plays, not HLS or DASH.
- **Timed ID3 in HLS** arrives within a `timeupdate` (about 250 ms) of its time.
- **No silence skipping.**

## macOS and iOS: AVFoundation

- **No DASH, no Smooth Streaming.** AVFoundation plays neither: opening one reports an error at
  once, and their downloads fail.
- **A chosen variant caps the adaptation.** AVPlayer has no way to lock a variant: selecting one
  makes it the highest AVPlayer may play, reached when it adapts up by itself.
- **Key-frame seeks in files only.** AVFoundation lands exactly on any target, so Nucleus finds the
  closest key frame itself; an HLS track gives no access to its samples and seeks exactly.
- **iOS stats estimate the frames shown.** `AVPlayerLayer` counts none: they come from the media
  played at the track's frame rate. Dropped frames and the buffer are measured.
- **Timed metadata is HLS ID3 only**, the DASH events having no engine on Apple platforms.
- **No silence skipping.**

## Linux: GStreamer

- **Smooth Streaming plays, without seeks.** GStreamer answers a seek in a Smooth Streaming
  stream with a gap to the end instead of its fragments: no frame shows after a seek. Playback
  from the start, the end and errors follow the contract.
- **A chosen audio language is heard once the buffered audio has played.** It is reported
  selected at once; GStreamer's adaptive demuxer switches renditions at its output, after the
  audio it already downloaded at the previous one.
- **Key-frame seeks**: in MP4 and QuickTime files Nucleus reads the key frames from the file's
  index and seeks exactly to the closest one (GStreamer's own key-unit seek lands on the one
  before); other sources use GStreamer's key-unit seek.
- **Formats are the system's plugins.** WMV plays with `gstreamer1.0-libav`; without a decoder for
  a codec, opening reports a codec error.
- **No silence skipping.**

Each video fixture paints its frame number in its bottom band, so a read-back of the screen says
exactly which frame is shown. The scenarios also compare state traces (loading, playing, paused,
ended, errors) and latency budgets. They live in the Nucleus repository, under
`examples/media-player-conformance`.
