<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://asheron.info/wiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3AHow_To_Embed_a_YouTube_Video</id>
	<title>Talk:How To Embed a YouTube Video - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://asheron.info/wiki/index.php?action=history&amp;feed=atom&amp;title=Talk%3AHow_To_Embed_a_YouTube_Video"/>
	<link rel="alternate" type="text/html" href="https://asheron.info/wiki/index.php?title=Talk:How_To_Embed_a_YouTube_Video&amp;action=history"/>
	<updated>2026-05-22T16:28:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://asheron.info/wiki/index.php?title=Talk:How_To_Embed_a_YouTube_Video&amp;diff=248060&amp;oldid=prev</id>
		<title>imported&gt;Tlosk at 16:25, 14 April 2009</title>
		<link rel="alternate" type="text/html" href="https://asheron.info/wiki/index.php?title=Talk:How_To_Embed_a_YouTube_Video&amp;diff=248060&amp;oldid=prev"/>
		<updated>2009-04-14T16:25:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:25, 14 April 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;__ToC__&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Modification ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function depends on an added extension, the following code is saved as a php file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;YouTubeTag.php&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; in the extensions folder and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;require_once(&amp;#039;extensions/YouTubeTag.php&amp;#039;);&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is added to [[LocalSettings.php]]. Note that this code is a slight modification of the [http://www.mediawiki.org/wiki/Extension:YouTubeTag original] in that it allows the width to be specified.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This function depends on an added extension, the following code is saved as a php file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;YouTubeTag.php&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; in the extensions folder and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;require_once(&amp;#039;extensions/YouTubeTag.php&amp;#039;);&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is added to [[LocalSettings.php]]. Note that this code is a slight modification of the [http://www.mediawiki.org/wiki/Extension:YouTubeTag original] in that it allows the width to be specified.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Tlosk</name></author>
	</entry>
	<entry>
		<id>https://asheron.info/wiki/index.php?title=Talk:How_To_Embed_a_YouTube_Video&amp;diff=248059&amp;oldid=prev</id>
		<title>imported&gt;Tlosk: New page: This function depends on an added extension, the following code is saved as a php file named &#039;&#039;&#039;&lt;code&gt;YouTubeTag.php&lt;/code&gt;&#039;&#039;&#039; in the extensions folder and &#039;&#039;&#039;&lt;code&gt;require_once(&#039;extension...</title>
		<link rel="alternate" type="text/html" href="https://asheron.info/wiki/index.php?title=Talk:How_To_Embed_a_YouTube_Video&amp;diff=248059&amp;oldid=prev"/>
		<updated>2009-04-14T15:55:54Z</updated>

		<summary type="html">&lt;p&gt;New page: This function depends on an added extension, the following code is saved as a php file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;YouTubeTag.php&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; in the extensions folder and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;require_once(&amp;#039;extension...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This function depends on an added extension, the following code is saved as a php file named &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;YouTubeTag.php&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; in the extensions folder and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;require_once(&amp;#039;extensions/YouTubeTag.php&amp;#039;);&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; is added to [[LocalSettings.php]]. Note that this code is a slight modification of the [http://www.mediawiki.org/wiki/Extension:YouTubeTag original] in that it allows the width to be specified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;width:auto; overflow:auto&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
/*&lt;br /&gt;
 * YouTubeTag.php - Provides youtube tag for embedding a YouTube video into a page.&lt;br /&gt;
 * @author Jim R. Wilson&lt;br /&gt;
 * @version 0.1&lt;br /&gt;
 * @copyright Copyright (C) 2007 Jim R. Wilson&lt;br /&gt;
 * @license The MIT License - http://www.opensource.org/licenses/mit-license.php &lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 * Description:&lt;br /&gt;
 *     This is a MediaWiki extension which adds an additional tag, &amp;lt;youtube&amp;gt;, for embedding&lt;br /&gt;
 *     YouTube videos into wiki articles.&lt;br /&gt;
 * Requirements:&lt;br /&gt;
 *     MediaWiki 1.6.x, 1.8.x, 1.9.x or higher&lt;br /&gt;
 *     PHP 4.x, 5.x or higher&lt;br /&gt;
 * Installation:&lt;br /&gt;
 *     1. Drop this script (YouTubeTag.php) in $IP/extensions&lt;br /&gt;
 *         Note: $IP is your MediaWiki install dir.&lt;br /&gt;
 *     2. Enable the extension by adding this line to your LocalSettings.php:&lt;br /&gt;
 *            require_once(&amp;#039;extensions/YouTubeTag.php&amp;#039;);&lt;br /&gt;
 * Usage:&lt;br /&gt;
 *     Once installed, you may utilize YouTubeTag by placing the &amp;lt;youtube&amp;gt; tag in an&lt;br /&gt;
 *     article&amp;#039;s text:&lt;br /&gt;
 *         &amp;lt;youtube v=&amp;quot;aYouTubeId&amp;quot; /&amp;gt;&lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 * Copyright (c) 2007 Jim R. Wilson&lt;br /&gt;
 * &lt;br /&gt;
 * Permission is hereby granted, free of charge, to any person obtaining a copy &lt;br /&gt;
 * of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal &lt;br /&gt;
 * in the Software without restriction, including without limitation the rights to &lt;br /&gt;
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of &lt;br /&gt;
 * the Software, and to permit persons to whom the Software is furnished to do &lt;br /&gt;
 * so, subject to the following conditions:&lt;br /&gt;
 * &lt;br /&gt;
 * The above copyright notice and this permission notice shall be included in all &lt;br /&gt;
 * copies or substantial portions of the Software.&lt;br /&gt;
 * &lt;br /&gt;
 * THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, &lt;br /&gt;
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES &lt;br /&gt;
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND &lt;br /&gt;
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT &lt;br /&gt;
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, &lt;br /&gt;
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING &lt;br /&gt;
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR &lt;br /&gt;
 * OTHER DEALINGS IN THE SOFTWARE. &lt;br /&gt;
 * -----------------------------------------------------------------------&lt;br /&gt;
 */&lt;br /&gt;
 &lt;br /&gt;
# Confirm MW environment&lt;br /&gt;
if (defined(&amp;#039;MEDIAWIKI&amp;#039;)) {&lt;br /&gt;
 &lt;br /&gt;
# Credits&lt;br /&gt;
$wgExtensionCredits[&amp;#039;parserhook&amp;#039;][] = array(&lt;br /&gt;
    &amp;#039;name&amp;#039;=&amp;gt;&amp;#039;YouTubeTag&amp;#039;,&lt;br /&gt;
    &amp;#039;author&amp;#039;=&amp;gt;&amp;#039;Jim Wilson (wilson.jim.r&amp;amp;lt;at&amp;amp;gt;gmail.com)&amp;#039;,&lt;br /&gt;
    &amp;#039;url&amp;#039;=&amp;gt;&amp;#039;http://jimbojw.com/wiki/index.php?title=YouTubeTag&amp;#039;,&lt;br /&gt;
    &amp;#039;description&amp;#039;=&amp;gt;&amp;#039;Provides youtube tag embedding videos into a page.&amp;#039;,&lt;br /&gt;
    &amp;#039;version&amp;#039;=&amp;gt;&amp;#039;0.1&amp;#039;&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
# Register Extension initializer&lt;br /&gt;
$wgExtensionFunctions[] = &amp;quot;wfYouTubeTagExtension&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
# Extension initializer&lt;br /&gt;
function wfYouTubeTagExtension() {&lt;br /&gt;
    global $wgParser, $wgMessageCache;&lt;br /&gt;
    $wgParser-&amp;gt;setHook( &amp;quot;youtube&amp;quot;, &amp;quot;renderYouTubeTag&amp;quot; );&lt;br /&gt;
    $wgMessageCache-&amp;gt;addMessage(&amp;#039;youtubetag-bad-id&amp;#039;, &amp;#039;Invalid YouTube video ID supplied: [$1]&amp;#039;);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
/**&lt;br /&gt;
 * Callback function for embedding video.&lt;br /&gt;
 * @param String $input Text between open and close tags - should always be empty or null.&lt;br /&gt;
 * @param Array $params Array of tag attributes.&lt;br /&gt;
 * @param Parser $parser Instance of Parser performing the parse.&lt;br /&gt;
 */&lt;br /&gt;
function renderYouTubeTag( $input, $params, &amp;amp;$parser ) {&lt;br /&gt;
&lt;br /&gt;
    # Check for &amp;#039;v&amp;#039; parameter and ensure it has a valid value&lt;br /&gt;
    $v = htmlspecialchars($params[&amp;#039;v&amp;#039;]);&lt;br /&gt;
    if ($v==null || preg_match(&amp;#039;%[^A-Za-z0-9_\\-]%&amp;#039;,$v)) {&lt;br /&gt;
        return &amp;#039;&amp;lt;div class=&amp;quot;errorbox&amp;quot;&amp;gt;&amp;#039;.wfMsgForContent(&amp;#039;youtubetag-bad-id&amp;#039;, $v).&amp;#039;&amp;lt;/div&amp;gt;&amp;#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    # Check for &amp;#039;width&amp;#039; parameter and ensure it has a valid value&lt;br /&gt;
    $width = htmlspecialchars($params[&amp;#039;width&amp;#039;]);&lt;br /&gt;
    if ($width==null || preg_match(&amp;#039;[0-9]&amp;#039;,$width)) {&lt;br /&gt;
        $width=425;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width==0) {&lt;br /&gt;
        $width=425;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width&amp;gt;1024) {&lt;br /&gt;
        $width=1024;&lt;br /&gt;
    }&lt;br /&gt;
    if ($width&amp;lt;100) {&lt;br /&gt;
        $width=100;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    $ratio = 425 / 350;&lt;br /&gt;
    $height = round($width / $ratio);&lt;br /&gt;
&lt;br /&gt;
    # Build URL and output embedded flash object&lt;br /&gt;
    $url = &amp;quot;http://www.youtube.com/v/$v&amp;quot;;&lt;br /&gt;
    return&lt;br /&gt;
        &amp;#039;&amp;lt;object width=&amp;quot;&amp;#039;.$width.&amp;#039;&amp;quot; height=&amp;quot;&amp;#039;.$height.&amp;#039;&amp;quot;&amp;gt;&amp;#039;.&lt;br /&gt;
        &amp;#039;&amp;lt;param name=&amp;quot;movie&amp;quot; value=&amp;quot;&amp;#039;.$url.&amp;#039;&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&amp;#039;.&lt;br /&gt;
        &amp;#039;&amp;lt;param name=&amp;quot;wmode&amp;quot; value=&amp;quot;transparent&amp;quot;&amp;gt;&amp;lt;/param&amp;gt;&amp;#039;.&lt;br /&gt;
        &amp;#039;&amp;lt;embed src=&amp;quot;&amp;#039;.$url.&amp;#039;&amp;quot; type=&amp;quot;application/x-shockwave-flash&amp;quot; &amp;#039;.&lt;br /&gt;
        &amp;#039;wmode=&amp;quot;transparent&amp;quot; width=&amp;quot;&amp;#039;.$width.&amp;#039;&amp;quot; height=&amp;quot;&amp;#039;.$height.&amp;#039;&amp;quot;&amp;gt;&amp;#039;.&lt;br /&gt;
        &amp;#039;&amp;lt;/embed&amp;gt;&amp;lt;/object&amp;gt;&amp;#039;;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
} # Closing MW Environment wrapper&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;Tlosk</name></author>
	</entry>
</feed>