Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function embedVideoHTML(
type: string,
id: string,
options: IEmbedVideoOptions,
): string {
try {
const videoId: IVideoId = readVideoId(type, id);
const videoService = getVideoService(videoId.service);
const url = createUrl(videoId.id, videoService, options);
return createIframe(url, videoService, options);
} catch (e) {
return `<p style="color: red">Error: ${e.message}</p>`;
}
}