Virals Youtube Autoplay

Autoplay youtube video in virals

  1. // ==UserScript==
  2. // @name Virals Youtube Autoplay
  3. // @version 0.1.3
  4. // @description Autoplay youtube video in virals
  5. // @author Saqfish
  6. // @include https://www.mturk.com/mturk/*
  7. // @grant none
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
  9. // @namespace saqfish
  10. // ==/UserScript==
  11.  
  12. $(document).ready(function(){
  13. var videoid = $('#directVideoLinkDiv > a').attr('href').match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);
  14. $('#ss-form > ol > div:nth-child(2) > div > div > div.ss-q-title > iframe').replaceWith('<iframe width="640" height="360" src="http://www.youtube.com/embed/' + videoid[1].substring(6) + '?autoplay=1" frameborder="0" allowfullscreen autoplay="1"></iframe>');
  15. });