php - append &showinfo=0 youtube api iframe src -
i have spent of day trying find way append '&showinfo=0' end of iframe src attribute - have failed miserably.
i building joomla site allvideos plugin uses youtube-api. want load videos without info-bar can't find way remove other adding &showinfo=0 iframe src - hoping possible using jquery used using, have limited experience of php - whatever works really.
edit
i have added class iframe using jquery tried
(".hide-info").attr("src" +="&showinfo=0");
plus lots of variations on theme, not working.
the problem if iframe exists, has loaded embedded video, , changing attributes jquery won't reload what's within iframe.
i had quick peek @ source plugin mention, , seems pretty trivial edit php want; block:
if($plg_tag=="youtube"){ $tagsource = preg_replace("~(http|https):(.+?)youtube.com\/watch\?v=~s","",$tagsource); $tagsourceyoutube = explode('&',$tagsource); $tagsource = $tagsourceyoutube[0]; if(strpos($tagsource,'?')!==false){ $tagsource = $tagsource.'&rel=0&fs=1&wmode=transparent'; } else { $tagsource = $tagsource.'?rel=0&fs=1&wmode=transparent'; } if($final_autoplay=='true'){ $tagsource = $tagsource.'&autoplay=1'; } }
in jw_allvideos.php file. after lastly if block, before final curly brace, add together this:
$tagsource = $tagsource.'&showinfo=0';
of course, lead plugin incompatible future updates, more reliable way create patch has code apply time updated, that's beyond scope of question.
php jquery youtube-api append joomla2.5
No comments:
Post a Comment