Broken videos: YouTube API change

On Dec 9th, 2020, YouTube changed the code that powers embedded YouTube videos, causing some videos to stop playing in free and premium Shopify themes. We've sent an auto-update to Shopify but if you're still experiencing this issue, you have two options:

Upgrade to the latest version of your theme

Our latest versions have fixed YouTube's latest bug and also include a number of speed improvements and new features, including Shopify's new integrated support for 3d and video product media. Upgrading does require that you re-apply any code changes you previously made to your current theme.

Or...apply a small code change to your current theme

1. Open assets/theme.js.liquid for your current theme

2. Search for this line (open search with ⌘ + F, paste the code from below, press ):

var $player =

If you don't find anything that starts with that, search for this instead. 

var $player = $(

You'll find the above code 4 times throughout the file, looking like this:

var $player = ? $( : $(;
var $player = $(;

You'll need to replace each of those 4 instances with these few lines:

var videoId =;
var $player = $('[data-video-id="'+videoId+'"]');
if (!$player.length) { $player = $('[data-youtube-id="'+videoId+'"]') }

Note: Pressing in the search box switches to the next search result

Impulse support Motion support Streamline support