Skip to content
Snippets Groups Projects
Commit 4708ccc7 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Be defensive about using the Wistia API

parent cf62045e
No related branches found
No related tags found
No related merge requests found
......@@ -104,6 +104,9 @@ class VideoStep extends React.Component {
// We use the Wistia API here to update or pause the video dynamically:
// https://wistia.com/support/developers/player-api
componentDidUpdate (prevProps) {
// Ensure the wistia API is loaded and available
if (!(window.Wistia && window.Wistia.api)) return;
// Get a handle on the currently loaded video
const video = window.Wistia.api(prevProps.video);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment