@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Interface MediaEmbedProvider

    Strategy interface for resolving a media URL into an embeddable iframe configuration.

    Library consumers implement this interface to add support for additional video/audio hosting services. Built-in implementations are provided for YouTube, Vimeo, and Dailymotion.

    // Custom provider for a fictional service
    export class MyVideoProvider implements MediaEmbedProvider {
    readonly name = 'MyVideo';

    resolve(url: string): MediaEmbedConfig | null {
    const match = url.match(/myvideo\.com/watch/(\w+)/);
    if (!match) return null;
    return {
    iframeSrc: \`https://myvideo.com/embed/\${match[1]}\`,
    providerName: this.name,
    };
    }
    }
    interface MediaEmbedProvider {
        name: string;
        resolve(url: string): MediaEmbedConfig | null;
    }
    Index

    Properties

    Methods

    Properties

    name: string

    Human-readable name shown in diagnostics.

    Methods

    • Attempt to resolve a URL into an embed configuration.

      Parameters

      • url: string

      Returns MediaEmbedConfig | null

      The embed config if the URL matches this provider, or null to pass through to the next provider / native playback.