mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-30 20:33:55 +02:00
Add support for live HLS streams, add playlist refresh logic, add live input tracks
This commit is contained in:
+15
-1
@@ -821,7 +821,13 @@ export class Conversion {
|
||||
|
||||
if (this.onProgress) {
|
||||
// Compute duration using only the utilized tracks
|
||||
const durationPromises = this.utilizedTracks.map(x => x.computeDuration());
|
||||
const durationPromises = this.utilizedTracks.map(async (track) => {
|
||||
if (await track.isLive()) {
|
||||
return Infinity; // Upper bound (assuming no universe heat death)
|
||||
}
|
||||
|
||||
return track.computeDuration();
|
||||
});
|
||||
const duration = Math.max(0, ...await Promise.all(durationPromises));
|
||||
|
||||
this._computeProgress = true;
|
||||
@@ -882,6 +888,10 @@ export class Conversion {
|
||||
|
||||
/** @internal */
|
||||
async _processVideoTrack(track: InputVideoTrack, trackOptions: ConversionVideoOptions) {
|
||||
if (!track.isHydrated) {
|
||||
await track.hydrate();
|
||||
}
|
||||
|
||||
const sourceCodec = track.codec;
|
||||
if (!sourceCodec) {
|
||||
this.discardedTracks.push({
|
||||
@@ -1334,6 +1344,10 @@ export class Conversion {
|
||||
|
||||
/** @internal */
|
||||
async _processAudioTrack(track: InputAudioTrack, trackOptions: ConversionAudioOptions) {
|
||||
if (!track.isHydrated) {
|
||||
await track.hydrate();
|
||||
}
|
||||
|
||||
const sourceCodec = track.codec;
|
||||
if (!sourceCodec) {
|
||||
this.discardedTracks.push({
|
||||
|
||||
Reference in New Issue
Block a user