Tutorial: How to Embed a Youtube Video into an Anki Card

I’ve mentioned before that I love having aesthetically pleasing Anki flashcards. And while Some of my cards [Mostly language and geography] are designed for only one purpose “testing my memory”, many of my other cards serves two purposes “the studying” as well as “the testing”.

These cards are like pages of a notebook. They have all the information I need when studying something for the first time. So I don’t have to reference any other source if later I didn’t remember the concept. I prefer this style of cards when it comes to subjects like simple Science, History, Psychology, etc…

Now, what could be more engaging and fun than having a short YouTube video on your Anki card?! In this post, I’ll teach you how to do that. But I first want to thank @Hector Bruce who sent me an email a couple of days ago asking about one of my screenshots from an older post. So that’s how this post came to life!

Resources Anki Tutorials for Beginners and non-techies: Changing the Card Background

Let’s spice up some Anki cards now! I’ll try to simplify everything as much as possible but feel free to comment or email me if something is not clear.

1.Choose The Note Type

First select Tools from the top menu and then Manage Note Types.

From Anki main menu select Tools 
 and then Manage Note Types

You can edit an existing note type or create a brand new note type. It’s up to you. For this tutorial, I’m going to edit The Basic Note. So I’m going to select it and then select Fields from the right side menu

select the Anki Note You want to edit and then select "Fields"

2. Add a new Field

You will find a list of all the fields in your Note. Since I’m using the Basic Note I only have Front and Back. Click Add to create a new field where we are going to add our YouTube links.

Click "Add" to add a video field to your Anki card

I called the field video, If you want to call it something else, that’s fine, but don’t forget to edit the code later too.

Don’t forget to save the Note.

3. Edit The Template

Now that we’ve added the new field, we need to edit the card template so it actually displays the video.

From the same dialogue box, make sure you are selecting the Note you are editing and then select Cards from the right side menu

I want my video to be on the backside of the card so I’m going to select Back Template

Copy and paste this code wherever you want the video to appear on the card. I wanted it at after the Back field so that’s where I put it.

<br>
{{#video}}
<iframe style="display:inline-block" width="70%" height="350px" src="{{text:video}}" frameborder="0" allowfullscreen></iframe>
{{/video}}

The first line of the code <br> is just to add a new line after the previous text.

If you want to change the dimensions of the video you can edit the width="70%" and height="350px" values

Creating a new Card

Now let’s actually create a new Anki card. Make sure You’re selecting the correct Note type.

In the Video Field copy and paste any YouTube video URL you want. It should look something like this

Now remove that highlighted part (from after the slash to the equal sign) and add embed/ instead. The link will now look like this

Let’s see how the card looks

That’s it! You’re done!

Happy Anking!