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

fix(FEC-11697): 2 captions are selected in the menu #182

Merged
merged 9 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@babel/preset-env": "^7.10.4",
"@babel/preset-flow": "^7.10.4",
"@babel/register": "^7.10.5",
"@playkit-js/playkit-js": "canary",
"@playkit-js/playkit-js": "kaltura/playkit-js#FEC-11697",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
Expand Down Expand Up @@ -104,7 +104,7 @@
"webpack-dev-server": "^3.11.0"
},
"peerDependencies": {
"@playkit-js/playkit-js": "canary",
"@playkit-js/playkit-js": "kaltura/playkit-js#FEC-11697",
"shaka-player": "3.3.0"
},
"publishConfig": {
Expand Down
24 changes: 10 additions & 14 deletions src/dash-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,21 +990,17 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
* @private
*/
_getParsedTextTracks(): Array<TextTrack> {
let textTracks = this._shaka.getTextTracks();
let parsedTracks = [];
if (textTracks) {
for (let i = 0; i < textTracks.length; i++) {
let kind = textTracks[i].kind ? textTracks[i].kind + 's' : '';
kind = kind === '' && this._config.useShakaTextTrackDisplay ? 'captions' : kind;
let settings = {
kind: kind,
active: false,
label: textTracks[i].label,
language: textTracks[i].language,
index: i
};
parsedTracks.push(new TextTrack(settings));
}
for (const textTrack of this._shaka.getTextTracks()) {
let kind = textTrack.kind ? textTrack.kind + 's' : '';
kind = kind === '' && this._config.useShakaTextTrackDisplay ? 'captions' : kind;
let settings = {
kind: kind,
active: false,
label: textTrack.label,
language: textTrack.language
};
parsedTracks.push(new TextTrack(settings));
}
return parsedTracks;
}
Expand Down