Type Alias VideoOptions
type VideoOptions = {
autoplay?: "keep" | "defer";
preload?: "none" | "metadata" | false;
when?: "always" | "save-data" | "slow";
}
autoplay?: "keep" | "defer";
preload?: "none" | "metadata" | false;
when?: "always" | "save-data" | "slow";
}
What
spoolProxy({ video })does to<video>start tags.preloadis the value to set, orfalseto leave the attribute alone.autoplay: 'defer'removes theautoplayattribute, marks the tagdata-spool-autoplay, addscontrolsso a visitor can start the video, and setspreloadtononeunless the option ismetadata. With'keep'theautoplayattribute stays, and a video that autoplays loads its file whateverpreloadsays.whenlimits the rewrite to a visitor who sentSave-Data: on(save-data) or who also has anECTofslow-2g,2gor3g(slow). Defaults:preload: 'none',autoplay: 'keep',when: 'always'.