Skip to content

Can not find default audio group after switching qualitylevels #1471

@KaasJ

Description

@KaasJ

Description

Videos without audio (adaptionset) in the manifest get a forced default audio group (see media-groups.js). We run into an error when switching to another qualitylevels of the video available in the manifest. The exact error is "Cannot use 'in' operator to search for 'default' in undefined". This error originates from the 'removeOldMediaGroupLabels' function in the dash-playlist-loader.js file, which is called by one of the hooks.

It seems like that, after switching the qualitylevel of the video, its trying to remove the old (forced) default audio media group label in the newMain mediagroup while the group isn't there. This leads to an error in the console.

Sources

Default audio mediagroup is added here
Its trying to remove the default audio group label here

Steps to reproduce

  1. Play a video with multiple qualitylevels but without audio specified in its dash manifest (see example below).
  2. Switch qualitylevel. Either manually or automatically (e.g. by limiting your band width).
  3. Check error in console browser (tested in Chrome).

Results

Expected

No errors in the console. I would say if the default audio group can not be found in the new mediagroup, then skip deletion.

Also I'm wondering if its needed to have a forced audio group for videos without audio but im not to involved in the code.

Error output

Console error:
"ERROR TypeError: Cannot use 'in' operator to search 'default' in undefined"

videojs-http-streaming version

what version of videojs-http-streaming does this occur with?
videojs-http-streaming 3.9.0

videojs version

what version of videojs does this occur with?
video.js 8.7.0

Browsers

what browsers are affected? please include browser and version for each
Chrome Versie 120.0.6099.129

Manifest example

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.0-rev2.0.0+dfsg1-2 at 2023-12-15T08:45:28.815Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H0M53.760S" maxSubsegmentDuration="PT0H0M2.000S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>012_manifest.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H0M53.760S">
  <AdaptationSet segmentAlignment="true" maxWidth="2560" maxHeight="1440" maxFrameRate="25" par="16:9" lang="und" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640032" width="2560" height="1440" frameRate="25" sar="1:1" bandwidth="2992705">
    <BaseURL>123_video_high.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="952-1307">
     <Initialization range="0-911"/>
    </SegmentBase>
   </Representation>
   <Representation id="2" mimeType="video/mp4" codecs="avc1.640032" width="2560" height="1440" frameRate="25" sar="1:1" bandwidth="848291">
    <BaseURL>456_video_low.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="952-1307">
     <Initialization range="0-911"/>
    </SegmentBase>
   </Representation>
   <Representation id="3" mimeType="video/mp4" codecs="avc1.640032" width="2560" height="1440" frameRate="25" sar="1:1" bandwidth="1733251">
    <BaseURL>789_video_medium.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="951-1306">
     <Initialization range="0-910"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions