Skip to content

React Example

See the example below of how to load a Spotify URI using the iFrame API in a React component. It also includes examples of calling playback control methods, such as play and pause.

Copy and try out this code in you dev machine or an online code sandbox where in React can be added as a dependency, like codesandbox.io

Code

JavaScript

Result