1

I am doing email newsletter and Want to send newsletters to the clients. In which I want to show my youtube channel video in autoplay mode to my clients.

I have tried some HTML and CSS for that but I can't see it's autoplay.

I have done it form my local video but I want to give my youtube channel video.

Here is code for my local video.

<!doctype html>
<html>
<head>
<title>Video in Email Test</title>
<style type="text/css">
 .video-wrapper {display:none;}
 @media (-webkit-min-device-pixel-ratio: 0) and (min-device-width:1024px) 
 {
  .video-wrapper { display:block!important; }
 }
  @supports (-webkit-overflow-scrolling:touch) and (color:#ffffffff) {
    div[class^=video-wrapper] { display:block!important; }

  }
  #MessageViewBody .video-wrapper { display:block!important; }
</style>
</head>
<body>
<B>Video in Email Test</B><BR>

<!-- video section -->
<div class="video-wrapper" style="display:none;">
  <p>Video Content</p>
<video width="320" height="176" controls="controls" src="video/Photo Orange With Teglines_WhatsApp.mp4" autoplay muted >
      <!-- fallback 1 -->
</video>
</div>


<!-- fallback section -->

</body>
</html>

But I want to use this embed code in my email news letter.

<!doctype html>
<html>
<head>
<title>Video in Email Test</title>
<style type="text/css">
 .video-wrapper {display:none;}
 @media (-webkit-min-device-pixel-ratio: 0) and (min-device-width:1024px) 
 {
  .video-wrapper { display:block!important; }
 }
  @supports (-webkit-overflow-scrolling:touch) and (color:#ffffffff) {
    div[class^=video-wrapper] { display:block!important; }

  }
  #MessageViewBody .video-wrapper { display:block!important; }
</style>
</head>
<body>
<B>Video in Email Test</B><BR>

<!-- video section -->
<div class="video-wrapper" style="display:none;">
  <p>Video Content</p>
<iframe width="853" height="480" src="https://www.youtube.com/embed/u48etdTdscA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>


<!-- fallback section -->

</body>
</html>

I want to give instruction to autoplay for this video

Bhavin
  • 473
  • 1
  • 5
  • 15
  • Does this answer your question? [How to embed an autoplaying YouTube video in an iframe?](https://stackoverflow.com/questions/7281765/how-to-embed-an-autoplaying-youtube-video-in-an-iframe) – empiric Jul 14 '20 at 06:52
  • @empiric I have visited this and not found any proper answer so I have selected no – Bhavin Jul 14 '20 at 11:16

1 Answers1

1

I can confirm that iframe elements aren't rendered in most email clients

Potentially you could upload the video somewhere other than YouTube that gives you a direct URL that you can use in the <video> element similar to how you did it in your "local video" example.

cam
  • 3,179
  • 1
  • 12
  • 15