import { getLatestMediaEngine } from "../tasks/makeMediaEngineTask.js";
import { Task } from "@lit/task";
const makeAudioInitSegmentFetchTask = (host) => {
	return new Task(host, {
		args: () => [host.mediaEngineTask.value],
		onError: (error) => {
			console.error("audioInitSegmentFetchTask error", error);
		},
		onComplete: (_value) => {},
		task: async ([_mediaEngine], { signal }) => {
			const mediaEngine = await getLatestMediaEngine(host, signal);
			return mediaEngine.fetchInitSegment(mediaEngine.getAudioRendition(), signal);
		}
	});
};
export { makeAudioInitSegmentFetchTask };
