Skip to main content

Migration

Breaking changes and upgrade steps for each release.

2.0.0

Adds React Native New Architecture (Fabric & TurboModules) support while keeping the old architecture working. Check the details of the updated APIs below -

playWhenReady and playbackSpeed props -> methods

What changed: both props are gone. Call play(), pause() and setPlaybackSpeed() on the component ref.

Why: React Native's newer versions changed a few things internally and to cater to these changes, certain props are now exposed as methods.

// before
<VdoPlayerView embedInfo={embedInfo} playWhenReady={isPlaying} playbackSpeed={1.5} />

// after
<VdoPlayerView ref={(r) => (this.player = r)} embedInfo={embedInfo} />

this.player.play(); // was playWhenReady={true}
this.player.pause(); // was playWhenReady={false}
this.player.setPlaybackSpeed(1.5); // was playbackSpeed={1.5}

New autoPlay prop

Why: playWhenReady also decided whether playback started automatically on first load. Since it's gone, that initial-load behaviour is now the autoPlay prop (default true).

<VdoPlayerView embedInfo={embedInfo} autoPlay={false} /> // loads paused; call play() when ready

getPlaybackProperties() removed -> getPlaybackPropertiesV2()

What changed: the deprecated getPlaybackProperties() and its onPlaybackProperties callback prop are removed.

Why: it was already deprecated and event-based. getPlaybackPropertiesV2() is the direct replacement and works the same on both platforms.

const {totalPlayed, totalCovered} = await this.player.getPlaybackPropertiesV2();

enterFullscreen() / exitFullscreen() removed -> V2

What changed: the deprecated enterFullscreen() / exitFullscreen() are removed. Use enterFullscreenV2() / exitFullscreenV2().

Why: the V1 methods were long deprecated. The V2 methods are the supported ones for the player with native controls.

this.player.enterFullscreenV2();
this.player.exitFullscreenV2();

After upgrading, rebuild natively

This ensures the latest code changes are picked up and the codegen files are regenerated.

  • iOS: cd ios && rm -rf Pods Podfile.lock build && pod install, then clean build.
  • Android: cd android && ./gradlew clean, then rebuild.