7

I am trying to make an Anki card that includes how to complete a specific type of task, and a description or collection of pictures isn't quite cutting it. I'd like to include a YouTube video into the card answer to test myself on how well I can perform the procedure. From my understanding I could download the YouTube video and include it directly, but I would really prefer not to store the video locally for storage-space reasons. I've attempted to embed the video using the "Edit HTML" option in the Anki card generator, and can get the YouTube frame to appear in the card, but it reports that "Playback isn't supported on this device" (see attached image).

Is there a way to embed the video as I'm trying to do?

Failed Embedded Youtube Video

Dan
  • 175
  • 1
  • 12

3 Answers3

4

This is what worked for me: Simply go to the video that you want to include, and click on "Share" and go to the "embed" option:: enter image description here

. You should get a link with this format:

<iframe width="560" height="315" src="https://www.youtube.com/embed/dmcfsEEogxs?start=30" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Copy the link, go to the card that you want to embed the video in, and press Ctrl + Shift + X to open the HTML Editor. Paste the embed link in the editor and close the window.

You'll be able to see the YouTube video now in your anki card: enter image description here

If this is what you tried before, try it again. It seems to work with the latest version of anki (mine is ⁨2.1.38).

Mohamed Bdr
  • 967
  • 3
  • 9
  • 20
SJY
  • 56
  • 3
2

I'm not sure if this helps, but you can format a link to a Youtube video in Anki Cards with something like:

<a href="https://youtu.be/{{Video}}">Play Video</a>

With {{Video}} being a field in your Notes that contains the remainder of the YouTube URL after "https://youtube.be/"

To start at a particular point in a YouTube video, right click the video and select "Copy video URL at current time" and paste the part after the "/" into your {{Video}} field.

Seems to work in Linux Version 2.0.32 of Anki Desktop and in Anki Mobile.

Steve S.
  • 21
  • 2
1

I couldn't find any documentation, so I opened up my test profile and determined that YouTube is right. Playback isn't supported on that device. The video tag isn't implemented in the web browser behind Anki, so you can't use YouTube directly.

The <canvas> tag, however, is implemented (even if only partially), so in theory you could get at least the video part of the... erm... video up and running by decoding it using JavaScript.

This sounds like an interesting project. I'm not saying I'll commit to it... but if I don't update this answer regularly feel free to comment on this answer to poke me about it.


There seems to be partial support for flash objects (width and height are acknowledged, and right-clicking doesn't work) but I can't get it to display anything, so that seems like a dead end.

wizzwizz4
  • 6,140
  • 2
  • 26
  • 62
  • @Dan I've determined that the easiest way to get this to work would be to implement the ` – wizzwizz4 Apr 07 '18 at 08:37
  • @Dan GIF plus ` – wizzwizz4 Jul 12 '19 at 16:32
  • Thanks for checking this out! I’m going to leave it unanswered as a reference in case this becomes possible in the future. – Dan Feb 10 '20 at 22:39