HTML 5 Canvas Experiment Hints At Things To Come 321
An anonymous reader writes with an interesting and impressive demonstration of modern browsers' HTML 5 capabilities. "From the 9elements blog: 'HTML5 is getting a lot of love lately. With the arrival of Firefox 3.5, Safari 4 and the new 3.0 beta of Google Chrome, browsers support some great new features including canvas and the new audio/video tags. [...] We've created a little experiment which loads 100 tweets related to HTML 5 and displays them using a javascript-based particle engine.' The site warns "(beware: sophisticated browser needed)"; Firefox 3.5 seems to work fine.
Slideshow (Score:2, Insightful)
Is a slideshow on my old Dell D820 (core duo, 2 gigs of ram, FF 3.5, Ubuntu Hardy)
Re: (Score:2)
I really, really want to start playing with this for casual game development now. I loved the old embedded Java Applet style but it grew too heavyweight and the Java API became too unstable and turdy. The same thing back with the original simplicity plus more speed and no runtime needed? Sign me up!
Re: (Score:3, Interesting)
Re: (Score:3, Informative)
You can load a sound and have it buffer without playing it, but there's a limited media cache so it may require some juggling to have all the right sounds available at the right time. Probably enough to run a decent game :)
Source: https://developer.mozilla.org/En/HTML/Element/Audio [mozilla.org]
Re: (Score:2)
Works fine on my old Athlon XP running Windows 2000 with 1GB of RAM and a 7800GS.
Re: (Score:3, Informative)
Runs quite well on my old Toshiba Satellite Pro M10 (Pentium M 1.5, 512MB RAM, FF3.5.2, Windws XP)
Re: (Score:2)
Gotta be something wrong with your machine then.. since it runs just fine on my Sempron 3500 laptop with a GeForce Go 6150, 1.5 gigs of ram, ff 3.0.13, ubuntu jaunty.
Re:Slideshow (Score:4, Funny)
Re: (Score:2)
It runs smooth on my 1.2GHz Toshiba Satellite Pro with 1GB ram, XP.
Re: (Score:2)
It runs alright on this laptop with an intel chip running Debian... pretty hearts and stuff. In Konqueror, though, not firefox.
Re: (Score:2)
A slideshow? A SLIDESHOW? Oh, what I wouldn't give to have a slideshow. Bloody favouritism.
I've got Firefox 3.5.2 on Fedora 11 and it won't even get beyond a black page with "Loading" on it and lots of brief "transferring data" messages :\
Re: (Score:2)
I get the same effect, and no my computer is not slow at all. I have Ubuntu, Firefox was updated yesterday.
I just checked it out with Firefox 3.5.2 (Score:5, Funny)
...And I see a lot of floating dots.
"HTML 5 Canvas Experiment Hints At Things To Come"
Seizures?
Re:I just checked it out with Firefox 3.5.2 (Score:5, Insightful)
I was sort of thinking the same things.
Now I'm wondering if the things I hate about Flash wasn't the actual software but what people were doing with it.
Re: (Score:2)
Re: (Score:2)
Welcome to zombo.com! You can do everything with zombo.com!
Re: (Score:2)
Well Firefox 3.5.2 running on an old 3GHz P4 had a seizure trying to show all these dots. I got about one frame a second.
Firefox 3.5.2 PowerBook G4 worked perfectly (Score:2)
The animation was smooth, the audio played without a hitch, it was great.
Awesomely CPU Hungry (Score:5, Insightful)
It was so awesome it pegged a whole core on my E8400. I expect to web to fuel larger hard drives, but faster CPUs? That's gettinga little out of hand.
Re: (Score:2, Interesting)
It's sad that it has to eat an entire core's worth of processing time, the whole time I was on the page I had an extremely powerful GPU sitting idle.
I think before anything like that can truly take off, they need a means of taking advantage of the hardware we have.
Re: (Score:2)
Re:Awesomely CPU Hungry - not here (Score:2)
AMD x2 64 @ 3000 on win xp 64.
4 gb ram
firefox 3.5.2 1280x1024
By default it was utilizing both cores, but even when I forced it to one it rarely went over 10%, with the average under 6%.
Re: (Score:2)
Works fine on my 5-year-old PowerBook G4, so I'm guessing it's not really the CPU that's the problem...
Re: (Score:3, Informative)
Weird. My iBook isn't fast enough to play YouTube videos, but handled this with no problem at all.
Re: (Score:2)
Yep 60% total load on a core2duo 6400. 1080p video uses less than that so I don't know what the hell they are doing.
Re: (Score:2, Informative)
It's not surprising since this is a tech demo, and in reality most javascript animations you see today already do this to maximize fluidness.
Re: (Score:2)
You're right something must b.........all you computer are belong to us.................
Re: (Score:2)
Using Opera 9.64, it pushed the cpu to about 30% (i.e. Opera used about half of one core).
Using Firefox 3.5.1, it pushed the cpu to over 50% (i.e. Firefox used all of one core).
Both appeared to be smooth enough. So there's a browser dependency in the cpu load.
Re: (Score:2)
Sure about that? My Core2Duo P7370 (2GHz) is pretty much pegged on the first core as well...
Maybe this thing automatically scales to CPU power?
How do I mute the audio? (Score:3, Insightful)
And no, I don't want to just turn off my speakers. Maybe I'm listening to some music, now all of a sudden I've got some cheezy web-site music blaring in my headphones or out my speakers. Not cool...
Re: (Score:2, Insightful)
It is even more fun if you are feeding sound into a stereo system playing music and a random sound comes on loud enough to deafen you. This is why I disable sound on any program possible.
Lost a speaker once because even with the volume controls on the stereo and computer turned to almost maximum whatever was playing was extremely quiet, all of a sudden either a program or website (I forget) started playing sound unexpectedly.
Yes windows allows per program control and pulse audio on linux probably allows co
Re: (Score:2)
Re: (Score:2)
How about the web pages where I *want* sound? Do I have to go to the volume control manager to restore the sound level every time I want to watch something on youtube?
If this thing happens, the very first plugin I want for firefox is one which disables web page sound by default.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Ok... this alone would make the feature worthwhile (eg. Firefox plugin to play "unknown" sites at very low volume by default)
Re: (Score:2)
Use a browser that runs in more than one process? Like say, IE?
*ducks*
Re: (Score:2, Funny)
For XP and Linux, there's PulseAudio which has the same feature.
When it works, you can control volumes individually. When it doesn't, you don't get sound at all. Either way, no cheesy music.
I dunno... (Score:2, Insightful)
Is compiling a bunch of "tweets" really the best use of all the great new HTML5 capabilities?
Re: (Score:3, Funny)
It's the only use for it.
Re: (Score:2)
Is compiling a bunch of "tweets" really the best use of all the great new HTML5 capabilities?
Oh, come on, think of the amazing new advertising possibilities!
Curious if JS/HTML5/Canvas could play SVG movies (Score:2)
Re: (Score:2)
Probably, but why? Unless it's a vector animation to begin with, converting video to SVG will just increase its size several times if you want to maintain any quality at all. Continuously fetching a JPEG frame would probably be faster/better quality (and in fact that is what some webcam sites do at the moment).
And then of course there's always the video element...
Re: (Score:2)
Usabiliteless awkwardness (Score:2, Interesting)
This demo reminds me of fancy flash sites with horrible usability.
Re: (Score:2, Interesting)
Well, remember the utility of Flash 10 years ago? It was basically a 400MB flash applet that loaded to play some crappy downloaded metal song while spinning some text 360 degrees. No doubt this will be abused to high hell before it gets some pretty useful utility. I prefer this demo rather than those stupid angelfire sites that crippled my computer because someone had a hardon for spinning text and Fear Factory.
Re: (Score:2)
Only far more resource demanding this time.
Re: (Score:2)
Indeed this does seem odd.
Vomit inducing graphics: Check
Vomit inducing music: Check
Runaway CPU usage: Check
All it needs is the random browser crashes and you've reinvented Flash. Except this time it's built into the browser and you can't turn the damned thing off.
Re: (Score:2)
Yep, but at least we can dump flash now, and have the potential for a browser to make things (say links) accessible anyway, by ignoring the animation/css and just looking at the structured HTML.
Dots? (Score:5, Interesting)
Re: (Score:2)
http://ajaxian.com/archives/canvas-reflectionjs [ajaxian.com]
Or canvas reflection?
Re: (Score:2)
Some friendly competition from the bogeymen:
http://www.newgrounds.com/portal/view/470460 [newgrounds.com] [Doom/Hexen in Flash]
http://www.innoveware.com/ql3/QuakeLight.html [innoveware.com] [Quake in Silverlight]
Re: (Score:2)
A more complete version with sound and real gameplay is here:
http://www.nihilogic.dk/labs/wolf/ [nihilogic.dk]
FPS? (Score:4, Interesting)
Explore the raw power of the canvas on an Apple II emulated in Javascript!
http://scripple-2.appspot.com/ [appspot.com]
Paste this in and press enter:
10 TEXT : HGR
20 HCOLOR=3
30 FOR I = 0 to 279 step 4
40 HPLOT I,0 TO 279-I,191
50 NEXT I
RUN
(Only hires is on the canvas.)
SLM
Re: (Score:3, Interesting)
10 TEXT : HGR
20 HCOLOR=3
30 FOR I = 0 TO 16
40 HPLOT I+130,30 TO I+80,161
50 NEXT I
60 FOR I = 0 TO 15
70 HPLOT I+150,145 TO I+150,161
80 NEXT I
RUN
Re: (Score:2)
Interesting.
Re: (Score:2)
Personally I find it not so much impressive, but worrying that the current state of the art is "a 2GHz box struggling to play a stripped-down wolfenstein at 320x200 at 30fps", and this is after the browser makers have had an arms race resulting in javascript being 100x as fast as a simple reference implementation...
WTF is up with javascript as a language that means the latest most advanced researchers can't bring it within an order of magnitude of software rendering in C? And why is everyone in such a rus
One particle, one tweet? (Score:2)
Each particle represents a tweet - click on one of them and it'll appear on the screen.
Is it just me or does it seem to pick a random one regardless of where you click?
Re: (Score:2)
It does seem to - you can click anywhere on the screen.. the particles are fairly meaningless.
Compared to flash... (Score:4, Insightful)
Re: (Score:3, Interesting)
The demo uses processing.js - essentially a Java library. Whether this has any more utility than Flash (remembering that the flash of today is not the monstrosity most of /. seems to remember and think it still is) could be debated, but it's definitely more in line with standards compliance.
Re: (Score:3, Informative)
Processing is a Java library, parts of which has been ported to javascript.
http://en.wikipedia.org/wiki/Processing_(programming_language) [wikipedia.org]
Re: (Score:2)
Wow. Great contribution, yes I know what Java and JavaScript are, Processing.js renders Processing.org based code, a Java based library.
Re: (Score:2)
I did read it, the difference between you and I is that I understood what I was reading.
The original particle engine was ported from a Flex/AS3 project that weâ(TM)ve created to javascript. Weâ(TM)re using processing.js for particle rendering on canvas which is a very useful graphics library created by John Resig.
Processing.js is used to render Processing code, a subset of Java, not JavaScript. FFS, if you're going to accuse someone of not RTFM, at least be sure you did so yourself.
Re:Compared to flash... (Score:5, Insightful)
Is eliminating Flash not enough? HTML5 is open and (being) standardised; anyone is free to implement it. (And you can see there are already several competing implementations in progress) Flash is a proprietary platform and you are solely dependant on the whims of Adobe. If even just for the lack of choice, Flash is a worse platform. Nothing's forcing Adobe to fix their player, while the HTML5 browsers definitely have some competition going on and are improving at an amazing rate - and in fact when HTML5 starts to pick up, Adobe will be forced to do something, as HTML5 itself will be competition to Flash.
Some people complain about how fast that thing runs (or how much CPU usage it takes), but I bet a flash version would not be even twice as fast, and Flash has existed for how long compared to browser support for HTML5 technologies?
Re: (Score:3, Informative)
Re: (Score:3, Insightful)
That demo is so quick it was done before rendering on FF 3.5.2 on Centos 5.3, with 64bit flash.
Hoooray for Flash.
Re: (Score:2)
I suppose that is the killer app feature that will ensure its adoption by web design agencies around the world. Goodbye flash and silverlight, you won't be missed.
Now.. just don't tell them that the state of the art in adblocking technologies will quickly have a solution.
Re:Compared to flash... (Score:5, Interesting)
Here's a fantastic example of the sorts of things this'll make possible, which simply can't be done with flash:
http://www.double.co.nz/video_test/video.svg [double.co.nz]
I actually think this is a better HTML5 example than the article. There you have video transparency, which can be a variable, you can selective audio based on the last thing you clicked, it can be moved, rotated, and resized freely by dragging the corners, etc. You can pause, play, mute, and adjust volume to each one completely independently of the other (though the volume control is blocked by the draggable corners, remember you can right click the video and click Show Controls in firefox). I once even saw a demo where the edges of video were distortable, allowing you to skew it, etc, and it was smoothly done too, better than most compiled applications I've seen. Not to mention effects like reflecting video content below the video in real-time (like it's on a glassy surface).
What'll be really impressive is when SVG is finally fully implemented, because that'll give us an open standard for filters and many other things (you can alter colors in a video on the fly, generate images, gradients, and effects dynamically, etc, as well as animations without any javascript at all.
What it comes down to is changing the notion of what's possible with just a browser... If you think that AJAX webapps are impressive now, just you wait...
Re: (Score:3, Informative)
More control for one. Flash is essentially a self contained program running in your browser. HTML5 will allow things like audio volume per tab, or per domain, more interaction between the page itself, the content, and the user.
The fact it's self-contained doesn't mean it's isolated from the page. It's in fact a benefit, because it quickly becomes a burden to serve your app as a hundred of tiny images and js files. The "minification" and "sprite" techniques the community is forced to use in JS/HTML/CSS apps, are tedious, limited and just a poor-man's compilation technique, a sign that in practice a compressed one-off-download container is the better choice for web apps.
There is also fast two-way connection between JS and Flash tha
To my very pleasant surprise... (Score:5, Interesting)
Anyway, it's pretty neat. I think I'll start making some pages for the heck of it and put it on my local network.
Re:To my very pleasant surprise... (Score:5, Informative)
Extremely impressive indeed! (Score:5, Funny)
In fact, it looks just like an Amiga demo from 20+ years ago!
Canvas as Video Codec? (Score:2)
Canvas can't play video directly. The video tag is currently halted in the HTML 5 spec. Is there a way to deliver video in canvas anyway? Is there anything like a "video to SVG" converter that could give canvas some SVG to play instead? Or some other actual canvas feature that could be used (without resorting to ASCII art animation)?
Re: (Score:2, Informative)
CPU hungry (Score:2)
For what looks like a demo that people did on 8 bit computers with 4MHz processors, Safari uses 80% CPU on a 1.3GHz PowerBook G4 (although the animation is smooth) to run this. Trying to draw stuff on the screen with fragments of HTML and JavaScript, HTML5 or not, seems to be enormously inefficient, setting us back to 80s levels of performance.
I also note that recently the YouTube flash player has become a lot less efficient, even in standard definition mode. It used to run completely smoothly on my PowerBo
vs Flash (Score:3, Insightful)
Flash isn't that bad, it's just used very often for irritating purposes. Just as anything that could replace it will be.
The difference between this and Flash (Score:2)
Re:Awesome (Score:4, Funny)
Re: (Score:2)
I am wondering if HTML 5 can provide most of the functionality of Javascript without posing as much of a security risk.
What are the security risks of Javascript? I grant that different interpreters often have buffer overrun issues/string parsing shenanigans, but Javascript, taken as a thing independent of the different interpreters, really doesn't expose enough of the client's resources to the server to pose a "security risk," as that term is defined by prevailing consensus.
Re: (Score:3, Informative)
What the GP said is that Javascript doesn't expose enough of the client's resources to the server to be a problem in and of itself. As in, the server doesn't get to know stuff about the client that the client wouldn't want.
Alas, I somewhat disagree. The point is very much that Javascript makes it easy to find yourself typing personal information somewhere you shouldn't.
Re: (Score:2)
Sure, if you like static pages. You still need javascript to do the scripting parts - this page might be an 'html 5 experiment' but it's 99% javascript.
Re: (Score:2)
Only if your target browser supports the canvas tag. The canvas tag is only standardized in HTML5, but browsers starting with WebKit/Safari (around the time 10.4 came out -- Apple invented it for their Dashboard thing), and followed later by Opera, KHTML and FF, have suppported the tag ad hoc.
Re: (Score:3, Informative)
Re: (Score:3, Insightful)
IE6 is dead. You might as well ask if it runs under Firefox 1.0. It'll probably run under IE8 which is being pushed out as a critical update right now..
Re: (Score:2)
Re: (Score:3, Insightful)
Lots of key sites (eg. youtube [techradar.com]) are dropping IE6 support. Use rates on most top sites have dropped below 10%. The web is not useable with IE6. Most sites in development now are not supporting it, except by accident. IE6 is dead. Hooray!!
Re: (Score:3, Informative)
YouTube are going to be dropping support for IE6 soon. Bet you see the numbers drop off rapidly then.
Re: (Score:2)
Yeah it does. Even works in FF and Opera at the same time, but if you put one window over the other the background one slows to a crawl. Also, it won't resize properly unless you reload the window.
I stared at this thing much longer than any sane person should have.
Re:Works great in Opera 10.... (Score:4, Funny)
I stared at this thing much longer than any sane person should have.
Programming is complete. Return to your normal activities. You will receive instructions when required.
And you can turn off the music... (Score:2)
Quick preferences (F12) -> uncheck "Enable Sound in Web Pages"
Re: (Score:2)
Quick preferences (F12) -> uncheck "Enable Sound in Web Pages"
Is it the html5 page or some obscure browser using F12?
It doesn't work in FF3 & 3.5 nor Konqueror.
Re: (Score:2)
I heard some music at a volume level which is way louder than everything else on my machine and no way to adjust it. I'm wearing headphones so the page was closed after five seconds.
This is the future? Count me out.
Re: (Score:2)
Sound was fine for me. Volume was on par with everything else(Ventrilo, videos, games, etc.)
The only thing way too loud is the old "find failed" sound in Firefox 2.x. Man, that thing was like a bullet going off. Easily 8x the volume of everything else.
Re: (Score:2)
I don't hear any sound. :(
Sound?
There was sound?
>clickety..< >tap< >tap!<
>rustle< >tap!< >tap!<
#@$^!
>tap< >tap< >TAP!< >BASH!<
>BASH< >BASH!< >BASH!!!<
Shit. PulseAudio crashes again on my laptop.
Re: (Score:2)
I don't think anyone has proposed an audiocanvas yet...
Re:No audio here thank god (Score:5, Insightful)
That's why I think it's awesome that HTML5 includes sound. You can't block the sound from a plugin that's executable code that does whatever it wants, however browser makers (and extension writers) can put settings options to let you opt-out for the sounds. Or prevent things from playing until you switch to the tab that wants to play them.
Re: (Score:2)
Browsers need a volume control, just like music players.
They also need zoom bars for some of the small fonts combines with 30" monitors...
Re: (Score:3, Informative)
They do on Vista and Windows 7. In fact, every application has its own volume control.
See this link [msdn.com] on MSDN
Re: (Score:2)
The W3C is a vendor consortium, so pretty much everything past HTML2 originated somewhere else first.
Speaking of which, HTML5 also finally gets around to completely standardizing the Netscape v2.0 form objects.