Not Showing Embeded youtube video in email template - html

Is it possible to embed video into an email that will allow the viewer to watch the video within the email itself?
<iframe width="560" height="315" src="https://www.youtube.com/embed/wbY_Szw8X7Q" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
When I use above iframe code in my email template instead of the video it showing blank.

The answer, unfortunately, is that it's not possible. You need to:
Provide a link to the video source (in your case https://www.youtube.com/embed/wbY_Szw8X7Q)
Attach this file as an mp4 to the email itself.

It depends on the E-mail provider. Each provider supports different "HTML E-mails". Some support iframes, others don't. I would encourage you to Google which E-mail providers support iframes, and which don't.
Some pointers:
https://www.campaignmonitor.com/blog/email-marketing/2010/08/do-iframes-work-in-email/
https://www.simplycast.com/interactive-marketing-support/faqs/are-iframes-compatible-with-emails/
https://mailchimp.com/help/limitations-of-html-email/
https://www.experts-exchange.com/questions/21773969/IFRAME-in-a-mail-possible.html
Etc...

You must not embed a video because it is not supported by major email clients. You may however show a thumbnail image, with a link. Once they click on on the thumbnail "play button", it redirects to the link URL, and plays the video, in a browser.

Related

What is the gesture="media" HTML attribute?

When using oembed to get embed codes for Youtube, I get this HTML:
<iframe allowfullscreen="" frameborder="0" gesture="media" height="270" src="https://www.youtube.com/embed/4B36Lr0Unp4?feature=oembed" width="480"></iframe>
Do you notice the gesture="media" HTML attribute? What is it? What does the "media" value do?
It’s a non-standard (or not-yet-standard) thing that’s so far only used for media autoplay in Chrome.
See https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe:
Iframe delegation
Once an origin has received autoplay permission, it can delegate that permission to iframes via a new HTML attribute. Check out the Gesture Delegation API proposal to learn more.
<iframe src="myvideo.html" gesture="media">
Without iframe delegation, videos will not be able to autoplay with sound.
And see also https://www.chromium.org/audio-video/autoplay:
By default embedded IFrames will only be able to play muted or silent videos. However, if site owners wish for IFrames on their site to be able to play unmuted content, they may pass the autoplay permissions to the IFrame via the gesture=media attribute. This attribute allows any video contained in the IFrame to play as if it were hosted on the site.
Those things both cite https://github.com/WICG/gesture-delegation/blob/master/explainer.md, but that document’s author says the gesture name was only ever intended as a “placeholder” and that a Chrome Intent to Ship will go out soon with the real name of the HTML markup attribute being delegatestickyuseractivation. So you’ll instead need to do:
<iframe src="myvideo.html" delegatestickyuseractivation="media">
media - delegates user activation to the iframe in the context of media playback (ie. autoplay).
More here https://github.com/WICG/gesture-delegation/blob/master/explainer.md

Embed youtube videos

I want to put a video on my website using the embed option on youtube.It shows up but when i try to play it appears a text saiyng that the video is restricted on some websites and gives me the option to watch on youtube . I saw that i need to accept some terms of conditions and that includes the youtube API from what i saw .
Is there another way to put a video on a website without the API ? Also i should mention that the website is not on a server.
I'm using this iframe to show the video :
<iframe width="560" height="315" src="https://www.youtube.com/embed/dgV1n57ejCY" frameborder="0" allowfullscreen></iframe>

Possible to display images and youtube video in email?

is it possible to display images and youtube videso in emails?
Example: if an email containing
<img src="img.jpg" /> and the youtube <iframe width="560" height="315" src="http://www.youtube.com/embed/2ItZFNegL80" frameborder="0" allowfullscreen></iframe>
Does it get display in the email?
If you use GMail, the YouTube link will automatically be expanded at the bottom of the message into a working video. Other clients may have similar functionality, but because JavaScript, HTML5 Video and Flash aren't supported by email clients, there's no general way for you to embed video.
If you want to include a preview image, you can build a URL for it from the video URL.
Video: http://www.youtube.com/watch?v=YOUTUBE_ID
Image: http://img.youtube.com/vi/YOUTUBE_ID/0.jpg
For example:
Video: http://www.youtube.com/watch?v=OwFbjJasW3E
Image: http://img.youtube.com/vi/OwFbjJasW3E/0.jpg

How do flash video downloaders work?

Consider the following embed code of this video from Vimeo - Popular video hosting site:
<iframe src="http://player.vimeo.com/video/41321504?title=0&byline=0&portrait=0&color=c8c8c8" width="400" height="300" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
the video embed url(http://player.vimeo.com/video/41321504) does open, if open directly in new browser window but doesn't contain location of video anywhere in html source code, thereby preventing downloads,i guess this is a feature of flash DRM. But then, a third-party website comes in & was able to give the direct urls to same video
http://av.vimeo.com/42007/964/95995392.mp4?aksessionid=96d0b8ffbb4c0c04b1c6b7f1562de7d5&token=1343971749_85ce464ec3361604fbda75e38e29f4e8
From a programmers standpoint, i was wondering how does it work? how are these video downloaders able to fetch direct url of the videos which are not even present in html source? what is their process if anyone can explain that step-by-step.
They do server-side analysis of the flash object, which will establish a conection to download the video. That connection can easily be captured. That even works in a browser, with Firebug for example:

Embedding videos from youtube in a generic way

I am creating a web site where users submit their (raw) youtube links and the system should automatically embed them. However, I cannot embed the youtube videos unless I get the special embed link given by youtube. How can I manage to embed any youtube link provided to the system ? Any suggestions ?
Can't you just drop this in, and update video_id as need be?
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>
Cenmre, I have the perfect solution for you.
YouTube supports oEmbed, which lets you send it any URL, and get back the appropriate embed code.
Read more about the standard, and how YouTube supports it.