Skip to content

Commit

Permalink
Merge branch 'feature/liveSyncOnStallIncrease' of https://github.com/…
Browse files Browse the repository at this point in the history
…vk342/hls.js into feature/liveSyncOnStallIncrease
  • Loading branch information
vk342 committed May 29, 2024
2 parents a8bc6ae + 363b774 commit 150ef8c
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 101 deletions.
36 changes: 19 additions & 17 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,60 +202,62 @@ const basePlugins = [
commonjs({ transformMixedEsModules: true }),
];

function getAliasesForLightDist() {
function getAliasesForLightDist(format) {
const emptyFile = format === 'esm' ? 'empty-es.js' : 'empty.js';

let aliases = {};

if (!addEMESupport) {
aliases = {
...aliases,
'./controller/eme-controller': './empty.js',
'./utils/mediakeys-helper': './empty.js',
'../utils/mediakeys-helper': '../empty.js',
'./controller/eme-controller': `./${emptyFile}`,
'./utils/mediakeys-helper': `./${emptyFile}`,
'../utils/mediakeys-helper': `../${emptyFile}`,
};
}

if (!addCMCDSupport) {
aliases = { ...aliases, './controller/cmcd-controller': './empty.js' };
aliases = { ...aliases, './controller/cmcd-controller': `./${emptyFile}` };
}

if (!addSubtitleSupport) {
aliases = {
...aliases,
'./utils/cues': './empty.js',
'./controller/timeline-controller': './empty.js',
'./controller/subtitle-track-controller': './empty.js',
'./controller/subtitle-stream-controller': './empty.js',
'./utils/cues': `./${emptyFile}`,
'./controller/timeline-controller': `./${emptyFile}`,
'./controller/subtitle-track-controller': `./${emptyFile}`,
'./controller/subtitle-stream-controller': `./${emptyFile}`,
};
}

if (!addAltAudioSupport) {
aliases = {
...aliases,
'./controller/audio-track-controller': './empty.js',
'./controller/audio-stream-controller': './empty.js',
'./controller/audio-track-controller': `./${emptyFile}`,
'./controller/audio-stream-controller': `./${emptyFile}`,
};
}

if (!addVariableSubstitutionSupport) {
aliases = {
...aliases,
'./utils/variable-substitution': './empty.js',
'../utils/variable-substitution': '../empty.js',
'./utils/variable-substitution': `./${emptyFile}`,
'../utils/variable-substitution': `../${emptyFile}`,
};
}

if (!addM2TSAdvancedCodecSupport) {
aliases = {
...aliases,
'./ac3-demuxer': '../empty.js',
'./video/hevc-video-parser': '../empty.js',
'./ac3-demuxer': `../${emptyFile}`,
'./video/hevc-video-parser': `../${emptyFile}`,
};
}

if (!addMediaCapabilitiesSupport) {
aliases = {
...aliases,
'../utils/mediacapabilities-helper': '../empty.js',
'../utils/mediacapabilities-helper': `../${emptyFile}`,
};
}

Expand Down Expand Up @@ -300,7 +302,7 @@ const buildRollupConfig = ({
? [alias({ entries: { './transmuxer-worker': '../empty.js' } })]
: []),
...(type === BUILD_TYPE.light
? [alias({ entries: getAliasesForLightDist() })]
? [alias({ entries: getAliasesForLightDist(format) })]
: []),
...(format === 'esm'
? [buildBabelEsm({ stripConsole: true })]
Expand Down
149 changes: 66 additions & 83 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"karma-rollup-preprocessor": "github:jlmakes/karma-rollup-preprocessor#7a7268d91149307b3cf2888ee4e65ccd079955a3",
"karma-sinon-chai": "2.0.2",
"karma-sourcemap-loader": "0.4.0",
"lint-staged": "15.2.2",
"lint-staged": "15.2.5",
"markdown-styles": "3.2.0",
"micromatch": "4.0.7",
"mocha": "10.4.0",
Expand Down
2 changes: 2 additions & 0 deletions src/controller/timeline-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export class TimelineController implements ComponentAPI {
canReuseVttTextTrack(textTrack, {
name: label,
lang: language,
characteristics:
'transcribes-spoken-dialog,describes-music-and-sound',
attrs: {} as any,
})
) {
Expand Down
5 changes: 5 additions & 0 deletions src/empty-es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file is inserted as a shim for modules which we do not want to include into the distro.
// This replacement is done in the "alias" plugin of the rollup config.
// Use a ES dedicated file as Rollup assigns an object in the output
// For example: "var KeySystemFormats = emptyEs.KeySystemFormats;"
module.exports = {};

0 comments on commit 150ef8c

Please sign in to comment.