WWDC Quick Look 💓 By SwiftGGTeam
Improve global streaming availability with HLS Content Steering

Improve global streaming availability with HLS Content Steering

Watch original video

Increase global streaming availability with HLS Content Steering

Highlight

HLS Content Steering establishes a bypass channel with the player through the steering server, and the content provider can update the CDN priority policy in real time. When the Chinese CDN is overloaded, the steering server can instruct 30% of existing clients to switch to the Japanese CDN without regenerating the playlist.

Core Content

Global streaming distribution faces two core availability challenges: network congestion mitigation and failure recovery. In traditional scenarios, CDN priorities are hard-coded in the master playlist and cannot be changed once published. When a CDN is overloaded or down, existing clients continue to send requests to it, leaving the content provider helpless.

HLS Content Steering allows players to regularly pull CDN priority updates by embedding the steering server address in the master playlist. Content providers can adjust traffic distribution, perform load balancing, and respond to network failures in real time—all decisions are made on the server side, and the client only needs to follow the priority list in the steering manifest.

Detailed Content

Limitations of traditional solutions

Variant streams for multiple CDNs listed in the master playlist (04:45):

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=1280000,...
https://cdn-cn.example.com/video/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,...
https://cdn-cn.example.com/video/mid.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1280000,...
https://cdn-jp.example.com/video/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,...
https://cdn-jp.example.com/video/mid.m3u8

The playlist priority of this scheme is fixed. Content providers cannot change the CDN ordering during playback, nor can existing clients be directed to a different CDN.

Enable Content Steering

Add to master playlistEXT-X-CONTENT-STEERINGTags (05:03):

#EXTM3U
#EXT-X-CONTENT-STEERING:SERVER-URI="/steering?video=abc",PATHWAY-ID="CN"

#EXT-X-STREAM-INF:BANDWIDTH=1280000,PATHWAY-ID="CN"
https://cdn-cn.example.com/video/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,PATHWAY-ID="CN"
https://cdn-cn.example.com/video/mid.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=1280000,PATHWAY-ID="JP"
https://cdn-jp.example.com/video/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,PATHWAY-ID="JP"
https://cdn-jp.example.com/video/mid.m3u8

#EXT-X-STREAM-INF:BANDWIDTH=1280000,PATHWAY-ID="SG"
https://cdn-sg.example.com/video/low.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2560000,PATHWAY-ID="SG"
https://cdn-sg.example.com/video/mid.m3u8

Key attributes:

PropertiesFunction
SERVER-URIThe address of the steering server. The client periodically pulls updates from this URI
PATHWAY-IDDefine the path to which the variant flow belongs, each path usually corresponds to a CDN
PATHWAY-ID(on label)Specify the initial path when playback starts

Variants flow throughPATHWAY-IDGroup. After the client selects a path, it only selects the code rate from the variant streams of this path.

Playlist with media group

If the playlist contains media groups (such as multiple tracks), copy the media groups for each path and assign a unique GROUP-ID (06:28):

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="CN-audio",NAME="English",URI="..."
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="JP-audio",NAME="English",URI="..."
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="SG-audio",NAME="English",URI="..."

#EXT-X-STREAM-INF:BANDWIDTH=1280000,PATHWAY-ID="CN",AUDIO="CN-audio"
https://cdn-cn.example.com/video/low.m3u8

Steering Manifest Format

The steering server returns the Steering Manifest in JSON format (07:53):

{
  "VERSION": 1,
  "TTL": 300,
  "RELOAD-URI": "/steering?video=abc&session=xyz",
  "PATHWAY-PRIORITY": ["CN", "JP", "SG"]
}
FieldFunction
VERSIONmanifest format version
TTLThe number of seconds the client waits before the next request
RELOAD-URIThe URI for the next request, which can be injected with client state or session data
PATHWAY-PRIORITYPath priority list, the first one has the highest priority

The steering server can customize the manifest for each client to achieve refined traffic scheduling.

Client behavior

After loading the master playlist with the Content Steering tag, the client executes the following process (06:56):

  1. Initial Selection: Only from the initial path (PATHWAY-IDpath specified) is selected from the variant stream
  2. Start playback: Load the selected variant stream and media segment
  3. Background pull: Send Steering Manifest request to steering server in parallel
  4. Evaluation switching: After receiving the manifest, exclude variant streams that are penalized due to network errors and unsupported codecs, and select the path with the highest priority and at least one qualified variant stream
  5. Path switching: If the selected path is different from the current path, switch immediately
  6. Timed retry: Schedule the next request according to TTL

Network congestion scenario

Assume a Chinese CDN is overloaded by user surge (01:38):

  1. All Chinese users initially receive the manifest with the highest CN priority.
  2. The steering server detects that the CN CDN load is too high
  3. Send the new manifest with the highest JP priority to 30% of Chinese users
  4. After evaluation, these clients switch to the JP path and the traffic is redirected to Japan CDN
  5. China CDN load eased

Fault recovery scenario

Assume a regional outage on the network path from Japan to the Japan CDN (02:54):

  1. Before the failure, Japanese users regularly obtained the priority list from the steering server.[JP, SG, CN]
  2. After network outage, Japanese CDN is marked as penalized
  3. The client excludes variant flows of the JP path and selects the next highest priority SG path
  4. The traffic is automatically switched to Singapore CDN, and the user continues to watch without noticing.

TTL and load distribution

TTL controls how often clients pull (09:42). The steering server can:

  • Shorten TTL during congestion or failure, allowing clients to get new policies faster
  • Inject random TTL offsets for different clients to spread the load of the steering server
  • passRELOAD-URICarry session state in the URL to implement stateful scheduling decisions

Core Takeaways

  1. Group CDNs with PATHWAY-ID: Each path corresponds to a CDN, and variant flows are grouped by path. The initial path specifies the CDN when playback is started, and is subsequently dynamically adjusted through the steering manifest.

  2. steering server implements refined scheduling: a customized priority list can be generated for each client based on the user’s geographical location, CDN real-time load, network conditions and other dimensions.

  3. TTL is dynamically adjusted to cope with different scenarios: TTL is set to 300 seconds during normal operation, and shortened to 30-60 seconds when CDN degrades or fails, allowing the client to respond to policy changes faster.

  4. RELOAD-URI transfers session status: carries session ID, user area and other information in the URL, and the steering server makes more accurate scheduling decisions based on these states.

  5. Backwards compatible with existing clients: Old clients without Content Steering support will be ignoredEXT-X-CONTENT-STEERINGlabel, treating all variant streams as equal options and behaving as before.

Comments

GitHub Issues · utterances