Jump to content
  • Advertisement
Sign in to follow this  
Anet39

[web] Html Help?

This topic is 3074 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having trouble embedding stuff (ex. a youtube embed code) is there a way to create an embed tag yourself or is that too hard???


Thanks,
Anet39

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure about creating your own embed tag but embedding youtube content is fairly easy in my experience... Are you using a WYSIWYG editor (Dreamweaver, Kompozer)or Notepad (Coding all the HTML yourself) ? I have no idea about WYSIWYG editors but in Notepad, you just copy and paste in the code!

As far as making your own embed tag, maybe you're looking for the Object tag and the Param tag?

That's about all I can say!

Share this post


Link to post
Share on other sites
Do you mean you want BBCode like [youtube]
[/youtube]? You will need to write a string parser for that in a dynamic language (PHP, Python, javascript, ...). HTML is just a markup language, it's not able to do such things without some help.

In my code I do something like this:

match = re.search(r'(?:http://)?(?:(?:www\.)?(?:youtube\.com/(?:v/|watch\?v=)))?([A-Za-z0-9_]{4,})', code)
if not match:
return '[Invalid Youtube link]'

id = match.group(1)
return "<object class='video' type='application/x-shockwave-flash'>
<param name='movie' value='http://www.youtube.com/v/" + id + "' />
<a href='http://www.adobe.com/go/EN_US-H-GET-FLASH'>
<img src='/data/noflash.png' alt='Flash needed for Youtube' />
</a>
</object>"




This code uses Regex to find a youtube video ID in a given string and replaces it. To parse BBCode you probably want to create a recursive parsing function. Just google for all these keywords.

If you just want to embed a youtube manually, use the <object>...</object> part above

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!