Author Topic: Embedded youtube video doesn't work  (Read 433 times)

0 Members and 1 Guest are viewing this topic.

Offline ksotar

  • 25
Embedded youtube video doesn't work
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.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Embedded youtube video doesn't work
You only need the youtube ID in the [ yt ] tags. You've added the full URL. Do it like this:

Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Linux OBS Packages: FSO 3.7.0 | FSO BP Build | wxLauncher (?) | PCS2 (?) | wxVPView (?)
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: Embedded youtube video doesn't work
In fairness, that mistake is made often enough that it seems like using the full URL should be supported by the [ yt ] tag.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Embedded youtube video doesn't work
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.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Goober5000

  • HLP Loremaster
  • Administrator
  • 214
    • Goober5000 Productions
Re: Embedded youtube video doesn't work
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:
Code: [Select]
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,
),


 

Offline ksotar

  • 25
Re: Embedded youtube video doesn't work
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.