UPDATE 3: YouCube 3.0 (based on Google Chromium) right here.
UPDATE 2: Now interactive! See here for details.
UPDATE: Added a directional light, specular highlight and trackball / mouse control… Just because I could
As you know, .NET 3.5 SP1 includes a WebBrowser control. The current implementation is just a wrapper around the MSHTML ActiveX control, which unfortunately prevents you from doing crazy things to it through WPF.
The ActiveX control itself can be queried for the IViewObject interface and have its Draw method called. The WPF WebBrowser doesn’t expose this directly, but fortunately the Windows Forms WebBrowser does (alternatively you could host MSHTML directly).
All that remains is to get the image into a WriteableBitmap… Then the fun can begin
:
You can try the result here (ClickOnce application). The source code is available here. Note the browser isn’t interactive [yet]
…



21 comments
Comments feed for this article
September 4, 2008 at 2:04 am
Arnoud
Very nice, if you could make this interactive you would be my personal hero
September 4, 2008 at 9:41 am
Jeremiah Morrill
Great work! I can’t wait to see more!
This reminds me of my very, very old project on codeplex to render any Win32 control to WPF and keep them interactive (http://codeplex.com/WPFWin32Renderer). It works fairly well (you can watch youtube videos with it), but the performance wasn’t all there. I’ve been wanting to update to to support the new WriteableBitmap or even my VRE project which is a super-fast WriteableBitmap (http://codeplex.com/VideoRendererElement), but I just can’t find the energy to pick it back up again
-Jer
September 4, 2008 at 9:46 am
Chris Cavanagh
Jer – Wish I’d found your project sooner! (although I obviously didn’t spend much time on it
). I’ll take a closer look at it; the interactivity sounds sweet
September 4, 2008 at 9:47 am
Chris Cavanagh
Arnoud – Check out Jer’s project on Codeplex! (mentioned in other comment). It looks pretty awesome
September 4, 2008 at 11:41 am
Frank La Vigne
This would make for a great screen saver
September 4, 2008 at 1:16 pm
Michael Washington
Very nice. Also shows how Click Once works nicely. I may have to start considering it more.
September 4, 2008 at 1:29 pm
Chris Cavanagh
Michael – I agree on ClickOnce
It’s a breeze to set up too; I’ve updated some older demos & apps to use it: http://chriscavanagh.wordpress.com/2008/09/04/demos-clickonce-deployment/
September 5, 2008 at 6:06 am
Silverlight Cream for September 04, 2008 -- #361
[...] a couple author names this morning, but they’re correct on this post. From SilverlightCream.com: WPF 3D web browser Note this is WPF, but it is definitely interesting… I didn’t have a chance to download this before [...]
September 15, 2008 at 7:40 am
YouCube - 3D Web browser
[...] Очень интерестный пример применения WPF на сайте http://chriscavanagh.wordpress.com/2008/09/04/youcube/ [...]
September 15, 2008 at 11:07 am
Francis
Hello Chris, very nice piece of work indeed
.
It is great to see its performance too. However, i was trying to use the url trick ( “/v/”) to make the video fullscreen and but it didn’t work.
April 11, 2009 at 10:15 am
WARLOCKMAN
Вот это да! Занятный поворот событий!
July 26, 2009 at 8:01 pm
A web browser suitable for Harry Potter in WPF! « Robotic Pandas
[...] Li SiYu, and a former intern Wang Chao who worked on the browser part) started with code from Chris Cavanagh’s Blog to render a background IE instance into a WPF writeable bitmap, which we optimized using some [...]
July 26, 2009 at 11:11 pm
Tune Up Your PC » Post Topic » A web browser suitable for Harry Potter in WPF!
[...] Li SiYu, and a former intern Wang Chao who worked on the browser part) started with code from Chris Cavanagh’s Blog to render a background IE instance into a WPF writeable bitmap, which we optimized using some [...]
August 27, 2009 at 1:47 am
WPF 3D Chromium Browser « Chris Cavanagh’s Blog
[...] 27, 2009 · Leave a Comment There’s an updated version of YouCube (WPF 3D Web Browser) available based on my Awesomium / Chromium control. Try it [...]
December 26, 2009 at 3:23 am
Гарри
Даа… Ну у вас или талант писать, или это скопипастено откуда-то!
December 27, 2009 at 3:02 pm
Сергей
Где-то я уже нечто то же самое читал, причём один в один…
January 10, 2010 at 7:50 am
Visão Widescreen » Blog Archive » YouCube – Navegador 3D em WPF
[...] Interessante…Leia mais: http://chriscavanagh.wordpress.com/2008/09/04/youcube/ [...]
May 3, 2011 at 2:06 am
Simon Theuma
http://www.youtube.com/watch?v=yGmutPrOmvo – this is a spinoff I made for my Final Year Project in college using the Cjc.AwesomiumWrapper. Hope you like it
Any suggestions and comments are welcome.
May 3, 2011 at 6:13 am
Chris Cavanagh
Simon – That’s very original & cool
Any plans to give it a touch interface?
May 3, 2011 at 7:01 am
Simon Theuma
Not at the moment, though it’s a proof-of-concept which I intend to take forward slowly in my spare time
Thanks for the idea!
February 26, 2013 at 4:58 pm
Mitigating Airspace Issues In WPF Applications - Presentation Source - Site Home - MSDN Blogs
[...] A 3D cube with standard WebBrowser controls on each face, much like Chris Cavanagh’s YouCube.YouCube [...]