More clearly indicate that `muxPlaybackId` is required?
When passing a data object to the VideoPlayer, muxPlaybackId (or playbackId) is required, but not indicated as such in the type:
export type Video = {
/** Title attribute (`title`) for the video */
title?: Possibly<string>;
/** The height of the video */
height?: Possibly<number>;
/** The width of the video */
width?: Possibly<number>;
/** The MUX playbaack ID */
muxPlaybackId?: Possibly<string>;
/** The MUX playbaack ID */
playbackId?: Possibly<string>;
/** A data: URI containing a blurhash for the video */
blurUpThumb?: Possibly<string>;
/** Other data can be passed, but they have no effect on rendering the player */
// biome-ignore lint/suspicious/noExplicitAny: we intentionally want to allow to add any other value to this video object
[k: string]: any;
};
As such, it causes situations where a missing ID can cause the player to appear as though it has a loading issue (the bottom player in this case), showing a loading spinner forever:
Should we do any of the following:
- Mark at least one of the playback ID parameters as required in the TypeScript
- Optionally also accept, and check for,
streamingUrlas a fallback and extract the ID from there - If no ID is present in either the param or a fallback, how a visual error (like a
divoverlay) instead of trying to actually load the video
Mark at least one of the playback ID parameters as required in the TypeScript
Let's go with this approach @arcataroger
@stefanoverna PR here for now: https://github.com/datocms/react-datocms/pull/115
Mux upstream released mux-player@v3 not too long ago (we're still on v2). Maybe for the next major release, we can hard remove one of the redundant props (muxPlaybackId vs playbackId)?