Hard Light Productions Forums
Site Management => Site Support / Feedback => Topic started by: ksotar on November 18, 2017, 06:20:19 pm
-
Here it is: http://www.hard-light.net/forums/index.php?topic=94136.msg1858243#msg1858243
It shows player window, but if I press "Play" there is an error.
-
You only need the youtube ID in the [ yt ] tags. You've added the full URL. Do it like this:
-
In fairness, that mistake is made often enough that it seems like using the full URL should be supported by the [ yt ] tag.
-
In fairness, that mistake is made often enough that it seems like using the full URL should be supported by the [ yt ] tag.
It's been requested before and denied.
-
It's been requested before and denied.
The problem is the need to extract the video ID from the URL. I don't think anyone has specifically ruled it out (correct me if I'm wrong), just expressed doubt on the proper way to code it.
Here is the current code for the yt BBCode tag. If someone can enhance it, I'll be happy to merge the changes:
array(
'tag' => 'yt',
'type' => 'unparsed_content',
'parameters' => array(
'time' => array('optional' => true, 'value' => '?start=$1', 'match' => '(\d+)'),
'size' => array('optional' => true, 'value' => ' media-$1', 'match' => '(small|medium|large|max)')
),
'content' => '
<div class="mediaWidthLimit{size}">
<div class="mediaWrapper">
<iframe id="$1" width="560" height="315" src="//www.youtube-nocookie.com/embed/$1{time}" frameborder="0" allowfullscreen></iframe>
</div>
</div>',
'block_level' => true,
),
array(
'tag' => 'yt',
'type' => 'unparsed_content',
'content' => '
<div class="mediaWidthLimit">
<div class="mediaWrapper">
<iframe id="$1" width="560" height="315" src="//www.youtube-nocookie.com/embed/$1" frameborder="0" allowfullscreen></iframe>
</div>
</div>',
'block_level' => true,
),
-
You only need the youtube ID in the [ yt ] tags. You've added the full URL. Do it like this:
Thank you, I fixed it.
But yes, to be fair - I've never encountered such a way to embed video on any forums.