Be defensive about using the Wistia API
This commit is contained in:
1 parent
cf62045e26
commit
4708ccc7dc
1 file changed
+3
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user