API reference Complete props and options reference for MoviieProvider, useMoviiePlayer, MoviieVideo, and MoviieErrorBoundary.
Place at the root of your app. Provides the Moviie client and viewer token store to the component tree.
Prop Type Required Description publishableKeystring✓ Publishable key (mvi_pub_*) from your Moviie organization settings. Never use a secret key on the client. childrenReactNode✓ Your app tree.
< MoviieProvider publishableKey = {process.env. EXPO_PUBLIC_MOVIIE_PUBLISHABLE_KEY }>
< App />
</ MoviieProvider >
Fetches playback metadata, creates the expo-video player, and manages native state. Spread its return value onto <MoviieVideo>.
Option Type Default Description embedIdstring— Required. UUID of the embed from the Moviie dashboard.autoplaybooleandashboard Override the embed's autoplay setting. Omit to use the dashboard value. pictureInPicturebooleandashboard Override the embed's Picture-in-Picture setting. Omit to use the dashboard value. pictureInPictureAutoStartbooleanfalseAutomatically enter PiP when the app moves to the background. Requires PiP enabled. backgroundPlaybackbooleanfalseKeep audio playing when the app is backgrounded. Requires backgroundPlayback: true in the config plugin. lockScreenNowPlayingbooleanfalseShow a Now Playing notification and lock screen controls. rememberPositionbooleandashboard Override the embed's "remember position" setting. Requires expo-secure-store.
Field Type Description playerVideoPlayer | nullThe expo-video player instance. null on web (use the iframe path instead). playbackMoviiePlaybackData | nullFull playback metadata from the API. null while loading or on error. errorError | nullTyped error object when the fetch fails. null when healthy. See Error handling . isLoadingbooleantrue while the initial playback fetch is in-flight.videoPresentationMoviieVideoPresentationPropsPre-computed PiP and linear playback flags derived from playback and options. Spread directly onto <MoviieVideo>. retry() => voidRe-triggers the playback fetch. Called automatically by the built-in error shell.
Main playback component. Accepts the full return value of useMoviiePlayer spread as props, plus overrides.
Prop Type Default Description playerVideoPlayer | null— Player instance from useMoviiePlayer. playbackMoviiePlaybackData | null— Playback metadata from useMoviiePlayer. Controls dashboard defaults. aspectRationumber— Width ÷ height ratio. E.g. 16 / 9, 4 / 3, 1. isLoadingboolean— From useMoviiePlayer. Shows a loading indicator in the chrome. errorError | null— From useMoviiePlayer. Triggers the built-in error shell. retry() => void— From useMoviiePlayer. Called by the built-in retry button.
Prop Type Default Description nativebooleanfalseUse the platform's native VideoView chrome. When false, renders the Moviie custom skin. nativeControlsbooleanauto Show or hide native VideoView controls. Only relevant when native={true}. controlsAutoHideMsnumber3000Milliseconds of inactivity before the Moviie chrome auto-hides. controlsVisibleByDefaultbooleanfalseShow the chrome immediately on mount without requiring a tap.
Prop Type Default Description pictureInPicturebooleanhook / dashboard Override PiP availability for this component. pictureInPictureAutoStartbooleanfalseAuto-enter PiP when the app moves to the background.
See Native features: Picture-in-Picture and the PiP recipe .
Prop Type Default Description castAdapterMoviieCastAdapter | null— Chromecast adapter. Create with createGoogleCastAdapter() from @moviie/player-expo/cast. Without this, the cast button is hidden. castbooleandashboard Override the embed's Chromecast toggle. false hides the button and silences the missing-adapter warning. true forces the button on even if the dashboard has it off.
See Cast (Chromecast) .
Prop Type Default Description onRetry() => void— Replace the default retry behaviour. You must call moviie.retry() yourself if you want the fetch to re-run.
Prop Type Default Description onEmbedIframeRef(iframe: MoviieWatchEmbedIframeHandle | null) => void— Callback receiving the iframe element reference. Use to call Player API methods via postMessage. loadEmbedScriptbooleantrueLoad the Moviie embed.js Player API script inside the iframe. Set false only if you manage the script yourself.
MoviieVideo also accepts all VideoViewProps from expo-video, except player (managed internally).
React error boundary that catches crashes inside <MoviieVideo> and prevents them from taking down the rest of your app.
Prop Type Default Description childrenReactNode— Component tree to protect. Wrap <MoviieVideo> here. fallback({ error: Error, reset: () => void }) => ReactNodebuilt-in shell Custom fallback UI rendered on crash. Call reset() to unmount and remount the player tree. onError(error: Error, info: React.ErrorInfo) => void— Called on each caught error. Pass Sentry.captureException directly.
See Error handling .
Shape of the object returned by useMoviiePlayer as playback (and useMoviiePlayback as data).
Field Type Description embedIdstringUUID of the embed. titlestringEmbed title from the dashboard. durationSecondsnumber | nullVideo duration. null for live streams. isVerticalbooleantrue for portrait-oriented videos.posterUrlstring | nullProxied thumbnail URL, or null if no thumbnail. smartProgressEnabledbooleanWhether the smart progress bar is active for this embed. playbackMoviiePlaybackPayloadHLS stream URI and content metadata. branding{ primaryColor, showWatermark, organizationName }Branding values from the dashboard. controlsMoviiePlaybackControlsAll dashboard control toggles. captionsMoviieCaption[]Available caption tracks. chaptersMoviieChapter[]Chapter markers. ctasMoviieCTA[]Calls to action configured in the embed. telemetry{ bootstrapUrl: string }Telemetry bootstrap endpoint.
These reflect the toggles set in the Moviie dashboard. Pass playback to <MoviieVideo> and the component reads them automatically.
Field Type Description autoplaybooleanAuto-start playback on load. preloadbooleanPre-buffer the stream before play. mutedbooleanStart muted. loopbooleanLoop playback. showSpeedbooleanShow speed selector in the chrome. rememberPositionbooleanResume from last position. chromecastbooleanShow the Chromecast button (requires castAdapter). disableAirplaybooleanSuppress the AirPlay button. showProgressbooleanShow the progress/timeline bar. showPlaybooleanShow the play/pause button. showPlayLargebooleanShow the large centre play button. showCaptionsbooleanShow the captions toggle. showSettingsbooleanShow the settings menu. showPipbooleanShow the PiP button. showFullscreenbooleanShow the fullscreen button. showCurrentTimebooleanShow the current time counter. showDurationbooleanShow the total duration. showMutebooleanShow the mute button. showVolumebooleanShow the volume slider. seekBackwardEnabledbooleanEnable the seek-back 10s button. seekForwardEnabledbooleanEnable the seek-forward 10s button. showChaptersbooleanShow the chapters menu. turboStartEnabledbooleanEnable turbo start (fast initial render). playbackRatenumberInitial playback rate resolved by the server (creator/org default).