foo-webview-sdk
    Preparing search index...

    Variable mediaConst Experimental

    media: {
        canPlay: (
            track: ContainerTrack,
            limits?: MediaVideoDecodingLimits,
        ) => Promise<MediaCanPlayResult>;
        getContainerInfo: (path: string) => Promise<MediaGetContainerInfoResponse>;
        getStreamUrl: (path: string) => Promise<MediaGetStreamUrlResponse>;
    } = ...

    Local media access and advisory browser decoding capabilities.

    Type Declaration

    • ExperimentalcanPlay: (
          track: ContainerTrack,
          limits?: MediaVideoDecodingLimits,
      ) => Promise<MediaCanPlayResult>

      Ask the browser about a declared track without filling missing metadata. Video needs actual maximum frame rate and bitrate in the limits argument.

    • ExperimentalgetContainerInfo: (path: string) => Promise<MediaGetContainerInfoResponse>

      Read container metadata without decoding; missing fields remain unknown. The result describes the whole container, not a subsong timeline. An unrecognized file resolves successfully with recognized:false; read or parse failures use a failure envelope. Bridge transport errors may reject.

    • ExperimentalgetStreamUrl: (path: string) => Promise<MediaGetStreamUrlResponse>

      Issue a local media URL usable only by the requesting document. Navigation, file changes and token eviction invalidate the URL; do not persist it. Requires a trusted HTTP(S) page and a host with WebView2 media routing support. Set an element's crossOrigin to 'anonymous' before assigning src. For fetch, files larger than 2 MiB require Range; each response contains at most 2 MiB. Resolves with a success or failure envelope; bridge transport errors may reject.