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