mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
fix(player): version runtime protocol
This commit is contained in:
@@ -19,8 +19,19 @@ import {
|
||||
isRuntimeDurationAdapter,
|
||||
} from "./timeline-adapters.js";
|
||||
|
||||
declare const __HYPERFRAMES_RUNTIME_CDN_URL__: string;
|
||||
|
||||
export function runtimeCdnUrlForVersion(version: string): string {
|
||||
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version)) {
|
||||
throw new Error(`Invalid HyperFrames runtime version: ${version}`);
|
||||
}
|
||||
return `https://cdn.jsdelivr.net/npm/@hyperframes/core@${version}/dist/hyperframe.runtime.iife.js`;
|
||||
}
|
||||
|
||||
const RUNTIME_CDN_URL =
|
||||
"https://cdn.jsdelivr.net/npm/@hyperframes/core/dist/hyperframe.runtime.iife.js";
|
||||
typeof __HYPERFRAMES_RUNTIME_CDN_URL__ === "string"
|
||||
? __HYPERFRAMES_RUNTIME_CDN_URL__
|
||||
: runtimeCdnUrlForVersion("0.0.0-dev");
|
||||
|
||||
export interface ProbeResult {
|
||||
duration: number;
|
||||
|
||||
Reference in New Issue
Block a user