Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi audio track #8900

Open
Prathik9 opened this issue Oct 18, 2024 · 2 comments
Open

Multi audio track #8900

Prathik9 opened this issue Oct 18, 2024 · 2 comments
Labels
needs: triage This issue needs to be reviewed

Comments

@Prathik9
Copy link

Description

``I am not getting the core multi audio code where it is showing multi audio.
Current vidojs is showing multi audio based on language i worked in local code to change it to show using id.
because of in case language is undefined it show only one audio .
But in the source code i didnt get the code to that .
any one know please help me.

var organizeAudioPlaylists = function organizeAudioPlaylists(
    playlists,
    sidxMapping
  ) {
    if (sidxMapping === void 0) {
      sidxMapping = {};
    }
 
    var mainPlaylist;
    var formattedPlaylists = playlists.reduce(function (a, playlist) {
      var role =
        (playlist.attributes.role && playlist.attributes.role.value) || "";
 
      console.log("playlist.attributes.lang", playlist.attributes.lang);
      var language =
        playlist.attributes.lang == undefined
          ? playlist.attributes.lang
          : playlist.attributes.lang || "";
      var label = "main";
 
      if (language) {
        var label2 =
          playlist.attributes.lang == undefined
            ? playlist.attributes.id
            : playlist.attributes.lang || "";
        var label = "main";
        var roleLabel = role ? " (" + role + ")" : "";
        label = "" + label2 + roleLabel;
      } // skip if we already have the highest quality audio for a language
 
      if (
        a[label] &&
        a[label].playlists[0].attributes.BANDWIDTH >
          playlist.attributes.bandwidth
      ) {
        return a;
      }
 
      a[label] = {
        language: language,
        autoselect: true,
        default: role === "main",
        playlists: addSegmentInfoFromSidx(
          [formatAudioPlaylist(playlist)],
          sidxMapping
        ),
        uri: "",
      };
 
      if (typeof mainPlaylist === "undefined" && role === "main") {
        mainPlaylist = playlist;
        mainPlaylist["default"] = true;
      }
 
      return a;
    }, {}); // if no playlists have role "main", mark the first as main
 
    if (!mainPlaylist) {
      var firstLabel = Object.keys(formattedPlaylists)[0];
      formattedPlaylists[firstLabel]["default"] = true;
    }
 
    return formattedPlaylists;
  };

if i use .id insted of .lang it show multi audio option in ui even though language is undefined in manifest.
i found this in dist folder of videojs whre can i find these in source code

Reduced test case

locally

Steps to reproduce

Errors

No response

What version of Video.js are you using?

7.21

Video.js plugins used.

no in core

What browser(s) including version(s) does this occur with?

all

What OS(es) and version(s) does this occur with?

windows 11

@Prathik9 Prathik9 added the needs: triage This issue needs to be reviewed label Oct 18, 2024
Copy link

welcome bot commented Oct 18, 2024

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@mister-ben
Copy link
Contributor

That code is from https://github.com/videojs/mpd-parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage This issue needs to be reviewed
Projects
None yet
Development

No branches or pull requests

2 participants