mpd-parser
mpd-parser copied to clipboard
Multi audio track
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
👋 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.
That code is from https://github.com/videojs/mpd-parser
Thanks @mister-ben plz help me with below also
how can i merge changes done here to the videojs . how it get reflect there , where i wwant to include this plugin or what.
@Prathik9 the mpd-parser is a dependency of videojs and VHS (the MSE video playback engine behind video.js' mpeg-DASH support). See the package.json.
I think this belongs in the mpd-parser so I moved it. We could potentially handle cases of lang being undefined a bit better, marking as an enhancement.
insted of language if we use id it shows in the ui otherwise , even the stream contain multi audio if its lack in laguage it shows single audio