How do you embed youtube videos in a blogpost ?

Topics: ASP.NET 2.0
Jun 13, 2007 at 9:27 AM
Hey guys,

I'd love to know... seems when I use the embed media, it doesn't show up when I use the object code I get from youtube for the video.
When I just copy/paste the object code directly into the post, it doesn't work either.

So - is it possible ? :)

Jaob
Coordinator
Jun 13, 2007 at 9:41 AM
Have you tried copying it into the html?
I'll take a look at it and find a way. Stay tuned
Jun 13, 2007 at 11:29 AM
Hey Mads,

could you also have a look at the "embed media" popup ? When I try to pick a file, I get a browser callback error, and can't select a file to upload.

When I upload it manually and just give it the url (it's an flv file - flash video), it sometimes show up in the preview part, but never when I submit the page.

Or should I go post it as an issue ?

Jacob
Jun 13, 2007 at 11:42 AM
I tried copying the embedding code directly into the html, and that works. However, you HAVE to press update before you switch to another window (e.g. if you need to copy more than one object in there), or the changes are lost.
Jan 13, 2009 at 9:22 PM
Copying the embedded HTML into the HTML editor does not work if you use the HTML button in the upper left. As soon as you click Update the <object> tags are lost. I've had the same problem with trying to assign css to tags. The post editor just wipes it out.

You must use the Use raw HTML checkbox to embed object tags.
Jan 15, 2009 at 3:37 PM
(While Mads is off hunting)

I was using (happily) your (Mads Kristensen's) YouTube plug-in. It's listed on the extensions page, but doesn't resolve back on your Blog. I can repost here for anyone if wanted.

This .CS Extension just needed some formatting of your YouTube URL (e.g. http://www.youtube.com/watch?v=LxxBxvOGXm0) into [YouTube:LxxBxvOGXm0].

I've now moved onto Windows Live Writer which has far better support for more formats of video such as (YouTube), Vimeo, MSN SoapBox, LiveLeak, etc. where you paste the URL or embed code into WLW. Combine that with great image formatting functions and you can compose some impressive posts.

Hope that helps someone.

Nick Harrington
team Ambay Software | blog
Jan 16, 2009 at 12:48 AM
Thanks for the great Safe for Work tip, Nick!

Feb 18, 2009 at 9:05 PM
Hi everyone - sorry to re-open an old issue ... I just did my first post with a YouTube video and was having the issue described here.  So I selected the "Use raw HTML editor" to put in the <object> tag and it worked great.

Now, however, I can't edit the post!  If I make any changes to the text, they are lost when I "save post" and when I select the "use raw HTML Editor" nothing happens - it just stays in the normal "text entry" mode.  The only thing I can think of to tweak my post is to go directly into the xml - but that's always dangerous.

Any suggestions?

Thanks,
David Workman
www.HalfBakedLunatic.com
Coordinator
Feb 18, 2009 at 9:40 PM
Two suggestions come to mind ...

1.  Create/edit your post with Windows Live Writer which shouldn't tamper with or remove the <object> tag.

2.  Upgrade to the latest build of BlogEngine (available on the Source Code tab above).  Since changeset 23719, BE has been using the new version of tinyMCE which seems to leave the <object> tag alone when you're editing the raw html.  The tinyMCE version before this changeset is from around January 2007 ... so a much older version.
Feb 18, 2009 at 10:15 PM
Thanks Ben - I'm not sure what Windows Live Writer is, or how to get it - but I know my build is about two months old, so I'll try your suggestion #2 first.

Best,
David Workman
www.HalfBakedLunatic.com
Coordinator
Feb 18, 2009 at 10:32 PM
Okay, and Windows Live Writer can be downloaded here.  If you ever decide to try WLW, after installing it, when you go to setup an account within WLW, these setup instructions will probably help.
Feb 19, 2009 at 2:29 PM
Thanks again Ben, you're the greatest!

I'm playing with LiveWriter now ... but just a quick update on my experience with tinyMCE. I've upgraded to the newest build - so this is all with the latest version of tinyMCE:

If you use the "Raw HTML" mode to put in the <object> tag, it works fine - as long as you just hit "save post" without unchecking the "Use raw HTML editor".  If you go back to edit the post, you can only edit the post in HTML mode if the <object> tag is there. If you try to edit using the regular text box, you changes don't get saved. Problem is, if you go into the normal "text" mode, even once, the checkbox to go back into HTML mode doesn't work after that!!! You are stuck.

Two ways I found to work around the problem:
1 -    In the text editor, delete the video clip.  Once you do that, everything works normally again.  You can then make your edits, save them, then go back and put the <embed> tag back in using HTML mode.
2 -    Alternately, go to a different post and go into raw HTML mode, and it stays in that mode when you exit.  You can then go back into the posting you want to edit and at least do your edits in HTML.  You'll still need to temporarily remove the <embed> tag to use the normal editor.

If you're curious, here's the post that's caused all the troubles:
http://www.halfbakedlunatic.com/post/2009/02/19/AloeBoost-and-AloeRest-two-new-products-from-USAloe.aspx

Best,
David
Jun 19, 2009 at 8:20 PM

hi All,

Hate to do this to you all, but has this issue been fixed or has anyone found a better way than David's work arounds?  Don't mean to be unappreciative David.. :)

Steven

 

Jun 19, 2009 at 8:32 PM

What I do is write my message in the regular post editor. Then switch to HTML view and add the video object tags, save the entire HTML to the clipboard before clicking Post in case I need to modify. Then if you need to edit the post later, create a new post and switch to HTML view before opening the post with the video. Otherwise the object tags will be erased if you open it in the regular view. Irritating but it works.

Jun 19, 2009 at 9:36 PM

hi everyone, the code that LowTide put here (http://blogengine.codeplex.com/Thread/View.aspx?ThreadId=29200) works.  And it makes it easier, you can either use the media button or paste it into HTML and you can switch back to WYSIWYG mode and it all still works.  The lines that need changing are

tinyMCE.ascx

line 11:   plugins: "inlinepopups,fullscreen,contextmenu,emotions,table,media,iespell,advlink",

line 15: <font size="2">

theme_advanced_buttons1: 

</font>

"fullscreen,code,|,cut,copy,paste,|,undo,redo,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,outdent,indent,|,iespell,link,unlink,media,sub,sup,removeformat,cleanup,charmap,emotions,|,formatselect,fontselect,fontsizeselect",

Is there anyway to get that into the main build?

Jul 22, 2009 at 4:20 AM

To throw another idea out there, I built a couple extensions to embed videos for you...

YouTube Extension for BlogEngine

Vimeo Extension for BlogEngine

Cheers,
AL