pyqtyoutubepyqt4anki

How do you embed a YouTube video into an Anki Card


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


Solution

  • 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).