Youtube video in popup modal

It is simple iframe similar to this solution just with stop video after modal is closed with Esc

<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="videoModal" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-body">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <iframe width="100%" height="350" src=""></iframe>

 <a href="#" class="btn btn-default" data-toggle="modal" data-target="#videoModal" data-theVideo="" >VIDEO</a>

$('[data-theVideo]').click(function () {
  var theModal = $(this).data( "target" ),
  videoSRC = $(this).attr( "data-theVideo" ), 
  videoSRCauto = videoSRC+"?autoplay=1" ;
  $(theModal+' iframe').attr('src', videoSRCauto);
  $(theModal+' button.close').click(function () {
      $(theModal+' iframe').attr('src', videoSRC);

$('#videoModal').on('', function() {
  $(this).find('iframe').attr('src', null);

Google pdf preview

If you want to preview pdf or image file, you can use Google

$('#viewerBox').attr('src','<%= %>' );

or you can use directly pdf.js

yt gem access youtube api. Creators Private or non existing video url raise exceptions so you need to rescue Yt::Errors::NoItems, Yt::Errors::RequestError. Video could be public but not accessible (because of deactived account).

Gmail API

Someone can break to your account simple by adding his email as recovery email. Than he can easily change password.


Register on and you can use in in javascript <div class="g-recaptcha" data-sitekey="6LdrgFQUAAAAALvyQvT3fpoagmnb-ik9f73Y0Zaz"></div> but on rails and devise just follow and gem

It is not possible to edit configuration using api so use selenium script to update redirect URIs. You can use 50 domain with one key.