Note that there are some explanatory texts on larger screens.

plurals
  1. POyoutube embedded video pregreplace with start timing
    primarykey
    data
    text
    <p>On our forum we currently replace all youtube links with embedded objects, thanks to the following answer:</p> <p><a href="https://stackoverflow.com/questions/5830387/how-to-find-all-youtube-video-ids-in-a-string-using-a-regex">How do I find all YouTube video ids in a string using a regex?</a></p> <p>The trouble is, many of our users wish to post a link directly to a particlar time within a video. E.g.:</p> <p><a href="http://www.youtube.com/watch?v=jECIv7zlD4c&amp;feature=player_embedded#t=1m15s" rel="nofollow noreferrer">http://www.youtube.com/watch?v=jECIv7zlD4c&amp;feature=player_embedded#t=1m15s</a></p> <p>Note the "#t=1m15s"</p> <p>As per the youtube documentation, when you are embedding a start time into a video requires a 'start' parameter, you can't use the '1m15s' string. 'start' is a value based on the number of seconds.</p> <pre><code>&lt;object width="425" height="344"&gt; &lt;param name="movie" value="http://www.youtube.com/v/jECIv7zlD4c?fs=1&amp;start=75"&lt;/param&gt; &lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt; &lt;param name="allowScriptAccess" value="always"&gt;&lt;/param&gt; &lt;embed src="http://www.youtube.com/v/jECIv7zlD4c?fs=1&amp;start=75" type="application/x-shockwave-flash" allowscriptaccess="always" width="425" height="344"&gt; &lt;/embed&gt; &lt;/object&gt; </code></pre> <p>Is their a way to replace '#1m15s' in regex with '&amp;start=75'?</p> <p>If not, how would you suggest it would be done with PHP so it will recursivly build the objects in a forum post (sometimes people post multiple youtube video links)?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload