Creates a new FallbackVideoProxy wrapping the given provider chain.
Ordered list of video providers to try. Must contain at least one entry for operations to succeed (an empty chain always throws).
EventEmitter on which video:generate:fallback events
are published so callers can observe the failover path.
const proxy = new FallbackVideoProxy(
[runwayProvider, pikaProvider],
new EventEmitter(),
);
Generate a video from a text prompt, falling back through the provider chain on failure.
The generation request forwarded to each provider.
The result from the first provider that succeeds.
When every provider in the chain fails.
When the chain is empty.
Generate a video from a source image, falling back through providers that support image-to-video.
Providers whose IVideoGenerator.supports returns false for
'image-to-video' are silently skipped.
The image-to-video request forwarded to each capable provider.
The result from the first provider that succeeds.
When every provider fails or does not support image-to-video.
Readonly providerIdentifier derived from the first provider in the chain.
Readonly isAlways true — the proxy is ready as soon as it is constructed.
Optional Readonly defaultDefault model from the first provider, if set.
An IVideoGenerator that wraps an ordered chain of video providers and implements automatic failover for every operation.
Retry chain logic
Providers are tried left-to-right (index 0 first). The first provider that succeeds returns immediately. When a provider throws:
video:generate:fallbackevent is emitted and the next provider is tried.AggregateErrorcontaining every collected error is thrown.Error('No providers in video fallback chain')is thrown immediately.For the optional
imageToVideooperation, providers whose IVideoGenerator.supports returnsfalsefor'image-to-video'are silently skipped, since they are structurally incapable rather than transiently failing.