Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Multi audio track

未关闭
#182 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
javascript
领域
tooling

调研方向

Start by locating organizeAudioPlaylists in the source corresponding to the dist code shown. Compare how audio playlists are grouped when the manifest language is undefined and verify the behavior with the reporter's local multi-audio case. Done means distinct audio tracks are available in the UI without relying on a language value.

由索引模型根据 Issue 内容生成。

描述

enhancement
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

主要语言
JavaScript
星标
89
派生
60
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

videojs/mpd-parser 的其他 Issue

查看 videojs/mpd-parser 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。