Repository navigation
fix correct hlsSegmentFormat for HLS streams with AAC audio in castable-video - #232
Merged
ronald-urbina merged 1 commit intoApr 29, 2026
Conversation
|
@ronald-urbina is attempting to deploy a commit to the Mux Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
R-Delfino95
approved these changes
Apr 29, 2026
ronald-urbina
added a commit
to ronald-urbina/media-elements
that referenced
this pull request
Apr 29, 2026
…n castable-video (muxinc#232)" This reverts commit 039b0cf.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Chromecast playback stalls silently for HLS streams that have separate audio
renditions using raw ADTS AAC segments (
.aac). The LOAD request sent to thereceiver had
hlsSegmentFormat: "ts"because format detection only inspectedthe video variant playlist then applied that format to the audio field too.
The receiver interprets
hlsSegmentFormatas the audio segment format. Tellingit "audio is MPEG-TS" when it receives raw
.aacfiles causes it to hangindefinitely with no error.
Fixes 224.
Changes
castable-utils.jsparseAudioRenditionUrl()— finds the first#EXT-X-MEDIA TYPE=AUDIOURI in the master playlist
getPlaylistSegmentFormat()now separately detects video and audio formats,fetching the audio rendition playlist when present
{ videoFormat, audioFormat }instead of a single stringparseSegment()to trim the returned line (handles CRLF line endings)castable-mixin.jshlsSegmentFormatfromaudioFormat,hlsVideoSegmentFormatfromvideoFormat.aacaudio →hlsSegmentFormat = AAC,hlsVideoSegmentFormat = MPEG2_TShlsSegmentFormat = TS,hlsVideoSegmentFormat = MPEG2_TS(also fixes the latent bug where
HlsVideoSegmentFormat.TSwasundefined)FMP4Note
Medium Risk
Changes HLS manifest parsing and Chromecast
LoadRequestmetadata for segment format selection; mistakes could regress casting playback for some HLS variants despite being scoped to HLS-only logic.Overview
Fixes Chromecast stalls on HLS streams that use separate AAC audio renditions by detecting audio and video segment formats independently.
getPlaylistSegmentFormat()now returns{ videoFormat, audioFormat }, trims parsed segment URLs, and (when present) fetches the#EXT-X-MEDIA TYPE=AUDIOplaylist to determine audio segment type. The senderLoadRequestmapping is updated to sethlsSegmentFormatfrom the audio format (including explicit AAC handling) andhlsVideoSegmentFormatfrom the video format, usingMPEG2_TSfor TS video.Reviewed by Cursor Bugbot for commit 947ef46. Bugbot is set up for automated code reviews on this repo. Configure here.