How do you embed a YouTube video into an Anki Card - youtube

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?

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

I'm not sure if this helps, but you can format a link to a Youtube video in Anki Cards with something like:
Play Video
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.

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.

Related

Youtube API 3 get latest videos - but I want the URL to just open and PLAY that video

So, I have read numerous sites and a bunch of code that can find "the newest video" uploaded or Published, but NONE of them show how to format a URL LINK to just open THAT most recent video in a new tab/window and PLAY it.
I am missing something, obviously, and would love direction and help.
Here is the code that locates the correct video listing...
https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=Myin&maxResults=1&order=date&type=video&key=MyinAlso
And it literally shows up in a new tab, but just white code on a black background - NO VIDEO.
I would love this URL to just open and play that Newest uploaded/streamed video.
I have tried appending "watch?v=" with such items as "playnext=1&index=1", "videos.xml?channel_id=Myin&orderedby=published&playnext=1&index=1" and many other variations of these and other switches/directories/commands - all as links only.
By channel, playlist {when correct one is chosen} works using some variation - but - the newest Live uploaded video only exists in a non-existent list under "/streams", named or "filtered" as "Recently Uploaded" on the "LIVE" tab, or also in another non-existent List/category on the "Home" tab, named "Past Live Streams".
I just want a link that I never have to change, to play the Most Recently Uploaded Live video. This should NOT be this hard and frustrating.

iFrame block not showing up in the iPhone

I have a hybrid mobile app in Mendix. In one page of the app, I am displaying some data with text and also video or website URL embedded.
<iframe id="quizWidget-454107" width="100%" height="900px" frameborder="0" border="none" src="https://www.qzzr.com/widget/quiz/fi9xdWl6emVzLzQ1NDEwNw"></iframe>
Here we are embedding this website, and we also embed youtube URL here.
The issue is, this embedded URL(video/website) shows up in a section on Android phone but not in iPhone. May be Safari does not render iFrame correctly.
Any idea what we can replace iFrame with?
please see an answer to a related question here. I believe You need to add <meta> tags to your index.html page to allow the app to load external content, preferable using a Content Security Policy (CSP).

How to generate link with youtube-dl for downloading video from YouTube with title?

With youtube-dl I can get url for video, which opens browser video player. I need download it with title.
This link from internet works:
http://r3---sn-8p8v-bg0ed.googlevideo.com/videoplayback?id=o-AMwj6zvohEaPL1fiBRIGkayxokFNVhQ4A1VF6u2HWlc5&ipbits=0&mm=31&mn=sn-8p8v-bg0ed&dur=0.000&expire=1498841617&lmt=1460236973006213&ip=152.250.251.21&usequic=no&ms=au&mt=1498819907&mv=m&sparams=dur%2Cei%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Csource%2Cusequic%2Cexpire&pl=24&ei=sS1WWePVKc6_wQT6mZSADQ&itag=43&ratebypass=yes&initcwndbps=1577500&beids=%5B9466591%5D&mime=video%2Fwebm&key=yt6&source=youtube&signature=51394917CC585F4286B1CD59AE11420FA6FA7065.73A2EC80BBF8087CCD4D3222E09AD5882B14CC78&title=SpaceX+lands+rocket+at+sea%2C+makes+history
Generated link by youtube-dl opens player:
https://r3---sn-a0gxoxu-ig3e.googlevideo.com/videoplayback?clen=1561370&key=yt6&requiressl=yes&gir=yes&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&expire=1498847588&lmt=1460152800626042&ei=BEVWWcOIGMOEd9S3p8AC&id=o-ALcFrC_nifKmVOUT4iWaoMn68Uec2eQweC8_glHx3Zws&initcwndbps=2220000&pl=24&dur=178.282&mime=video%2F3gpp&signature=97509B18D589AEC4A600EC18433750F74C598A46.B33CC6F4B98CB9500A634AFA6B8F79C84DBED85B&ms=au&source=youtube&mv=m&mt=1498825879&ipbits=0&mm=31&mn=sn-a0gxoxu-ig3e&itag=17&ip=176.109.219.108&ratebypass=yes
I'm trying to find differences inside parameters, and I see "usequic=no, title=", but adding it to my url doesn't help me
The second link works for me, it downloads a file named "videoplayback.3gpp". The first downloads a .webm file, with the original title I suppose. I use Chrome.

YouTube API to get the most recent videos (with share URL) from a given channel

can some help me in drafting the right API call to get the most recent video form channel with shared URL (URL which i can embed in my web site)
I was able to get the title and description using the YouTube API version 3. But i am not able to get the "share this video URL".
Thank you
If this is not what you want, I apologize.
If you are asking what I think you are asking. I would just go to the next tab to the right ("Embed"). There is box there with the full embed code for your website. You can either use that code or copy the url out of it.
Just to save you some trouble, here is the code for that particluar video:
<iframe width="420" height="315" src="//www.youtube.com/embed/HhHhacseGw0" frameborder="0" allowfullscreen></iframe>
And the url:
http://www.youtube.com/embed/HhHhacseGw0
If that is not what you are looking for, please let me know.

YouTube API, Can I add a developer tag to an uploaded video?

My youtube videos have no developer tag and now I want to add one for them
I can get the videoEntry for those videos
I can add new developer tag as new MediaCategory
I can add MediaCategory as new Category to my video entry (displayed fine)
After I called VideoEntry.update() and use my own function to display the developer tag, it shows me the video has no dev tag. The function is working since I tested with my newly uploaded video(with dev tag during uploaing process)
My question is, Is it possible to add a developer tag after a video had been uploaded.
If possible, What's the essential steps? Do I use VideoEntry.update() ?
I currently have the same problem. According to this, you cannot add developer tags after the video has been uploaded. I do not know why Youtube has this restriction.

Resources