Sunday, May 22, 2011

IE Extension: Bulk Player Mate for YouTube


This IE extension lets you play all or any of the YouTube video links on a page by just several clicks.

For example, if we want to watch some videos of Shania Twain, we can go to www.youtube.com and input Shania Twain into the search box. We would get so many results. To narrow it down, we input the owner's name as well -- Shania Twain by ShaniaTwainVEVO. Now we get some videos as the search result.

Right click on the result page and the context menu pops up. The Bulk Player Mate menu item is at the bottom. Clicking on it brings up the Select Video dialog.

The detected YouTube videos are split into 3 groups:
  • text links
  • {img} -- links with thumbnails.
  • {embed} -- embedded videos on the page.
These videos may be duplicated with the other group.

We can see there are many videos listed in the scroll box. We just ignore those we don't care and select the wanted videos by clicking on the little checkbox at the beginning of the record of the video.

After selecting all the videos we want to play, we can press the OK button to play them all.

A new tab will be opened to play the selected videos one by one. The features of the player are:

1) The videos you select are inserted into the input box automatically for you.

2) There are some controlling buttons at the bottom-left corner of the player. You can use them to play from the beginning (Play All button), go to the previous video (Previous button), go to the next video (Next button), or reload the current video (Reload button).

 3) Use the buttons at the bottom-right corner of the player to choose the size of the player.

4) The "Playing:" label shows which video in the list is being played.

5) You can use the full-screen button of the YouTube video. Once you click it for one video, the rest videos will all be played in full-screen mode, seamlessly.


Download and Installation
Download the extension from http://code.google.com/p/youtube-bulk-player-mate-for-ie/.

The extension is an open source project and you need to manually install it. Just follow these simple steps:

1. Create a new folder in disk C:, e.g. C:\YBPM\

2. Download the 3 files into that folder, e.g.
      C:\YBPM\ybpm.reg
      C:\YBPM\ybpm_rm.reg
      C:\YBPM\ybpm.html

   ybpm.reg is the REG file that create the menu item on the default context menu. ybpm_rm.reg is the uninstaller which remove the menu item from the default context menu. ybpm.html contains the script of Bulk Player Mate extension.

3. Double click on ybpm.reg to install it.

4. Restart your Internet Explorer and you can use it now.

Bulk Player is also a standalone tool. You can manually input videos and play them without install the Bulk Player Mate extension

The videos in this example are randomly searched and chosen. We do not own them and we are not in any way related to them or the people who own them.


Friday, May 13, 2011

A very simple example of Internet Explorer addon development


This is not a complete tutorial. It shows how easy it is to build an IE addon/extension in just 5 minutes. And it does not stop you from building a far more complex addon with the other mechanisms.

This example adds a menu item to the default context menu of IE. When right click on IE, the user can see the new menu item and click on it. A dialog pops up showing the title of the Web page you are viewing.

Adding extensions to IE usually requires adding keys to the Windows registry. We prepare a REG file to add the keys to the Windows registry. In our REG file, we also specify the location of an HTML file which contains a JavaScript to run when our context menu item is clicked.

Here is the step-by-step of building the simplest IE addon:

1. Create a new folder in disk C:, e.g. C:\YBPM\

2. Use your favorite editor to create 3 files in that folder, e.g.
      C:\YBPM\ybpm.reg
      C:\YBPM\ybpm_rm.reg
      C:\YBPM\ybpm.html

   ybpm.reg is the REG file that create the menu item on the default context menu. ybpm_rm.reg is the uninstaller which remove the menu item from the default context menu. ybpm.html contains the script that runs when the context menu item is clicked.

   *** file ybpm.reg***
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&YouTube Bulk Player Mate]
@="C:\\YBPM\\ybpm.html"
"Contexts"=dword:00000001
"Flags"=dword:00000001


Note: it adds a key "YouTube Bulk Player Mate" (don't mind the name, it is a piece of code from one of my open source projects. You should use your own one.) to the registry to create an item in the context menu. The default value (@) of the key is set to the URL of the file that contains the script that will run when the menu item is clicked.

   *** file ybpm_rm.reg ***
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&YouTube Bulk Player Mate]


Note: it simply deletes the key that was generated by ybpm.reg.

   *** file ybpm.html ***
<SCRIPT>

var parentwin = external.menuArguments;
var doc = parentwin.document;
var ttl = doc.getElementsByTagName("title");

if (ttl.length > 0)
   document.write(ttl[0].innerHTML);

</SCRIPT>


Note: external.menuArguments lets you access the window object of the current page.

3. Restart your Internet Explorer. Right click on any page. You will see "YouTube Bulk Player Mate" item in the context menu. Click on it and you will see a pop-up window showing the title of the current page.

If you are interested to see a live example, you can find the YouTube Bulk Player Mate addon for IE here.

Monday, May 2, 2011

Windows XP: add a Lock Screen icon to the desktop and the Quick Launch bar


Follow these steps:
  1. Right click on the desktop. Select New|Shortcut on the context menu.
  2. Input "rundll32.exe user32.dll, LockWorkStation" (without the quotes) as the location of the shortcut. Choose a name for the icon, e.g. Lock Screen.
  3. After the shortcut is created on the desktop, you can change its icon by right click on it and select Properties, and click on the "Change Icon ..." button. Input "%SystemRoot%\system32\SHELL32.dll" into the "Look for icons in this file" box and you can choose from hundreds of Windows' icons.
  4. Drag the icon to the Quick Launch bar. It will be copied there.
  5. Double click on our new Lock Screen icon on the desktop, or click on our new Lock Screen icon on the Quick Launch bar and the screen will be locked instantly.
 
Get This <