Skip to content

Commit

Permalink
Fix wrong matching of lang attribute for embedded texttracks (#4047)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy authored Sep 20, 2022
1 parent 3d8ce30 commit 33c58ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/dash/DashAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Event from './vo/Event';
import FactoryMaker from '../core/FactoryMaker';
import DashManifestModel from './models/DashManifestModel';
import PatchManifestModel from './models/PatchManifestModel';
import bcp47Normalize from 'bcp-47-normalize';

/**
* @module DashAdapter
Expand Down Expand Up @@ -1090,7 +1091,7 @@ function DashAdapter() {
mediaInfo.codec = 'cea-608-in-SEI';
mediaInfo.isEmbedded = true;
mediaInfo.isFragmented = false;
mediaInfo.lang = lang;
mediaInfo.lang = bcp47Normalize(lang);
mediaInfo.roles = ['caption'];
}

Expand Down
2 changes: 1 addition & 1 deletion src/dash/parser/matchers/LangMatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
import BaseMatcher from './BaseMatcher';
import DashConstants from '../../constants/DashConstants';
var bcp47Normalize = require('bcp-47-normalize')
import bcp47Normalize from 'bcp-47-normalize';

class LangMatcher extends BaseMatcher {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/streaming/controllers/MediaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Events from '../../core/events/Events';
import EventBus from '../../core/EventBus';
import FactoryMaker from '../../core/FactoryMaker';
import Debug from '../../core/Debug';
var bcp47Normalize = require('bcp-47-normalize')
import bcp47Normalize from 'bcp-47-normalize';
import {extendedFilter} from 'bcp-47-match';

function MediaController() {
Expand Down

0 comments on commit 33c58ff

Please sign in to comment.