Skip to content

Commit

Permalink
allow passing preferredAudioLanguage (dash only right now)
Browse files Browse the repository at this point in the history
  • Loading branch information
iSchluff committed Jun 5, 2020
1 parent ba2fc36 commit 58d7c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class VOCPlayer extends BaseObject {

let configPromise = Promise.resolve({});
if (options.vocStream) {
configPromise = getStreamConfig(options.vocStream, options.audioOnly, this._handleError.bind(this));
configPromise = getStreamConfig(options.vocStream, options.audioOnly, options.preferredAudioLanguage, this._handleError.bind(this));
} else if (options.vocLecture) {
configPromise = getLectureConfig(options.vocLecture);
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/sources.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {getMediaLectureSources} from "lib/util";
* @param {boolean} audioOnly
* @param {function} errorHandler
*/
export const getStreamConfig = (stream, audioOnly, errorHandler) => {
export const getStreamConfig = (stream, audioOnly, preferredAudioLanguage, errorHandler) => {
// Keep a tab on whether there are still browsers where we need vp9,vorbis vs vp9,opus
const hasMSE = "MediaSource" in window;
console.log(
Expand Down Expand Up @@ -47,6 +47,7 @@ export const getStreamConfig = (stream, audioOnly, errorHandler) => {
source: `//cdn.c3voc.de/dash/${stream}/manifest.mpd`,
};
config.shakaConfiguration = {
preferredAudioLanguage: preferredAudioLanguage,
abr: {
defaultBandwidthEstimate: 1000000,
},
Expand Down

0 comments on commit 58d7c48

Please sign in to comment.