Play audio & video

Play remote audio and video through the device's native player.

Play audio

Play a remote audio track in the native player. The option keys are the native command contract, so the exact keys depend on your native build.

const bdk = createBdkNative();

await bdk.media.playAudio({ url: "https://example.com/tracks/song.mp3" });

Pause and stop audio

Pause the current track or stop playback entirely.

await bdk.media.pauseAudio();
await bdk.media.stopAudio();

Play a video

Play a remote video in the native player.

await bdk.media.playVideo({ url: "https://example.com/clips/demo.mp4" });

Play a video playlist

Play a sequence of videos back to back.

playVideoPlaylist is iOS only; elsewhere it doesn't run.

await bdk.media.playVideoPlaylist({
  videos: [
    "https://example.com/clips/one.mp4",
    "https://example.com/clips/two.mp4"
  ]
});