Docs
Player ExpoAPI reference

API reference

Complete props and options reference for MoviieProvider, useMoviiePlayer, MoviieVideo, and MoviieErrorBoundary.

API reference

<MoviieProvider>

Place at the root of your app. Provides the Moviie client and viewer token store to the component tree.

PropTypeRequiredDescription
publishableKeystringPublishable key (mvi_pub_*) from your Moviie organization settings. Never use a secret key on the client.
childrenReactNodeYour app tree.
<MoviieProvider publishableKey={process.env.EXPO_PUBLIC_MOVIIE_PUBLISHABLE_KEY}>
  <App />
</MoviieProvider>

useMoviiePlayer(options)

Fetches playback metadata, creates the expo-video player, and manages native state. Spread its return value onto <MoviieVideo>.

Options

OptionTypeDefaultDescription
embedIdstringRequired. UUID of the embed from the Moviie dashboard.
autoplaybooleandashboardOverride the embed's autoplay setting. Omit to use the dashboard value.
pictureInPicturebooleandashboardOverride 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.
rememberPositionbooleandashboardOverride the embed's "remember position" setting. Requires expo-secure-store.

Return value

FieldTypeDescription
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.

<MoviieVideo>

Main playback component. Accepts the full return value of useMoviiePlayer spread as props, plus overrides.

Core props

PropTypeDefaultDescription
playerVideoPlayer | nullPlayer instance from useMoviiePlayer.
playbackMoviiePlaybackData | nullPlayback metadata from useMoviiePlayer. Controls dashboard defaults.
aspectRationumberWidth ÷ height ratio. E.g. 16 / 9, 4 / 3, 1.
isLoadingbooleanFrom useMoviiePlayer. Shows a loading indicator in the chrome.
errorError | nullFrom useMoviiePlayer. Triggers the built-in error shell.
retry() => voidFrom useMoviiePlayer. Called by the built-in retry button.

Chrome and controls

PropTypeDefaultDescription
nativebooleanfalseUse the platform's native VideoView chrome. When false, renders the Moviie custom skin.
nativeControlsbooleanautoShow 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.

Picture-in-Picture

PropTypeDefaultDescription
pictureInPicturebooleanhook / dashboardOverride 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.

Cast (Chromecast)

PropTypeDefaultDescription
castAdapterMoviieCastAdapter | nullChromecast adapter. Create with createGoogleCastAdapter() from @moviie/player-expo/cast. Without this, the cast button is hidden.
castbooleandashboardOverride 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).

Error handling

PropTypeDefaultDescription
onRetry() => voidReplace the default retry behaviour. You must call moviie.retry() yourself if you want the fetch to re-run.

Web (Expo Web / iframe)

PropTypeDefaultDescription
onEmbedIframeRef(iframe: MoviieWatchEmbedIframeHandle | null) => voidCallback 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).


<MoviieErrorBoundary>

React error boundary that catches crashes inside <MoviieVideo> and prevents them from taking down the rest of your app.

PropTypeDefaultDescription
childrenReactNodeComponent tree to protect. Wrap <MoviieVideo> here.
fallback({ error: Error, reset: () => void }) => ReactNodebuilt-in shellCustom fallback UI rendered on crash. Call reset() to unmount and remount the player tree.
onError(error: Error, info: React.ErrorInfo) => voidCalled on each caught error. Pass Sentry.captureException directly.

See Error handling.


MoviiePlaybackData

Shape of the object returned by useMoviiePlayer as playback (and useMoviiePlayback as data).

Top-level fields

FieldTypeDescription
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.

controls fields

These reflect the toggles set in the Moviie dashboard. Pass playback to <MoviieVideo> and the component reads them automatically.

FieldTypeDescription
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).

On this page