Archive for the 'javascript' Category

No Sound Fix for Your Embedded YouTube Video

Sometimes the embedded (chromeless) YouTube player will fall silent on video playback for an apparently unexplained reason, with no immediate way to fix. I think it has to do with YouTube/flash caching muted sound settings from youtube.com or other non-chromeless player and somewhere along the way these are carried over to your chromeless video.

Just include these two calls in the javascript player prior to calling playVideo():

player.unMute();
player.setVolume(10);

thus guaranteeing sound playback regardless of previous state. Similar solution for Actionscript. Further API details at http://code.google.com/apis/youtube/js_api_reference.html

Things to Look Forward to in HTML 5

the HTML 5 spec is being developed with the intention of updating the language to better reflect what it is used for in today’s web.  Namely web applications.  It notes the rise of third party addons such as Flash and marks itself out as an open alternative.


Real 2-Way Communication between Browser and Web Server – no more ajax hacks?


Cross Document Messaging – a way to allow interdomain communication without resorting to json and without the issue of xss?


Real Drag n Drop – no more ugly multiple browser workarounds or bloated client side apis?


Embedding Video, etc Directly in a Document – no more cpu-hogging, memory leaking flash-based video sites?


Firefox  3.1 beta 2 has support for several elements of the spec, including the video element and Canvas (Scripting access to images).  IE8 beta 2 is working on bits and pieces too (Cross Document Messaging) the production release of which is thought to be pencilled in for the first half 2009.Both IE & FF are also having a stab at cross site XmlHttpRequests, which while I think is not specifically referring to the above HTML5 spec, should still provide the necessary power.

Chromed

I arrived late last night to the news that Google has entered the browser wars.  First impressions for me – something needs to be done about the slowdown/freezing that js-heavy webapps such as gmail create on IE and Firefox.  Having multiple flash based sites open causes similar non-responsive issues.  Chrome’s js engine, known as V8, responds favourably in benchmarks - although Firefox minions are countering this.

It would be nice if respective browser teams could fix these issues and quit with the endless ergonomic tabbed browsing memes.  No one cares where you put them…

 I’ll not be changing from Firefox (2!) anytime soon though.  I’ve got too many plugins to drop – Chrome has no framework in place yet.  And besides, Chrome is very much beta