Monday, November 29, 2010

Youtube ETA - Chrome extension

If you have ever tried to watch a youtube video on a slow network connection, you will know the frustration I often face. Wondering when that red progress bar will reach its end. Thanks to a chrome extension like Stop Autoplay, I can let the youtube video open in background tab and let it buffer as I browse other webpages. But still I have to go back to the youtube video's tab to find out if the video is downloaded, can I start watching it?

So I always wished someone had written an extension which will do something about this problem. After going through 3-4 pages of search results on chrome extension website with the query 'Youtube', I figured no such extension exists. This weekend, the itch became unbearable. So I peeked into the Stop Autoplay's short code and with some searching found out there exists a Javascript API to control the youtube player's behavior. It provided the API calls that were sufficient for me to calculate the speed (in bytes-per-sec) at which youtube video is downloading. Combine that with total size and total duration of the video and I had the solution I was looking for.

So I decided to write an extension out of it. You can get it from here

It does following things:
  1. Pauses the video at the start, i.e. disables the autoplay
  2. It calculates an estimated time it would take to download the video completely. Shows it in a red box in the top left corner.
  3. It also prepends a short version of this estimated time to the title of page. So even if you are browsing in other tabs or windows, you can tell how much longer it is going to take, without visiting the youtube page.
  4. There is an instant of time, when the video is not yet downloaded completely, but if you start watching the video after that point, you can be assured that the entire video will be downloaded by the time you reach the end. That way it is guaranteed that you won't have any interruption while watching the video. The extension smartly calculates that instant and informs you by turning the red box into orange. It also adds '*' to the timestamp in title after this point.
Give it a shot. The extension won't yet work with HTML5 player, I will fix that soon though.

Monday, November 15, 2010

Why secure airports when it's planes that fly?

With all the debate going over TSA's naked scanners and intimate pat-downs, I think one simple question is being totally ignored.

Why secure the entire airport when it's only the planes that fly in the sky. The reason we need added security for air travel is their unique vulnerability as compared to other forms of transport. An accident or attack in mid-air can lead to nearly 100% fatality. Also planes can be used as weapons in even more significant disasters as demonstrated by 9/11. So the objective of securing air travel should be to keep the flying objects safe. Anything and anyone that boards the airliner should be thoroughly checked. But why secure the entire airport?

Airport is tens of square miles of area with hundreds of access points. To try to secure this entire area is to make the task at hand enormously difficult than it has to be. There is nothing more special about an airport than is about Grand central railway station. A terrorist group is not going to achieve anything more significant by blasting a bomb at airport gate than he would by blasting it on a railway platform. Consequently, security of airport can be as tight (or loose) as that of a railway station. All the extra vigilance however should be concentrated at the gates where passengers and crew board the airplane - the real vulnerable entity that needs protection.

It is a matter of common sense that smaller the area to protect, more effectively it can be done. Why not apply that to air travel security?

Moreover, securing entire airport varies from country to country. Flights fly to US from all over the world, in multiple hops. Securing the safety of a flight bound to US, then depends on securing the boundaries of all the airports where the flight was boarded. Imagine how behemoth that task is and how easy to breach. Establishing the checks at the doors of the actual plane simplifies that problem by magnitudes.