Watching YouTube in Haiku Using Gnash
Last month we reported on a new version of the experimental port by Adrian Panasiuk of the open source Flash movie player Gnash. Development has continued, and after recent reports of it running quite nicely in Haiku, I decided to give it a spin to see how usable it was. I was pleasantly surprised to see that Gnash did in fact work quite nicely in Haiku. This tip gives step-by-step instructions on how to install Gnash, so that you can play YouTube videos in Haiku.
Requirements
This is what you will need to get Gnash working in Haiku:
- Latest version of Gnash for Haiku. I tested Gnash using the Dec. 13, 2009 release available on Haikuware.
- A GCC4 build of Haiku. You can get a build from Haiku Files. I successfully tested Gnash on revision 34760 of Haiku.
- Gnash dependencies (i.e., OpenSSL, Curl, libtdl, giflib, boost, ffmpeg and sdl), installed through a script included in the Gnash binary package.
- Firefox-based BezillaBrowser.
Installation
- Installing the BezillaBrowser: If you are using a nightly image of Haiku, then you need to install the BezillaBrowser, as it is not included in the nightly builds. To download the (most recent version as of this writing of) BezillaBrowser, run the following command from the Haiku Terminal:
~> wget http://haiku-files.org/files/optional-packages/BeZillaBrowser-2.0.0.22pre-x86-gcc4-2009-09-28.zip
This will download the BezillaBrowser package to your /boot/home directory. Move the package to the /boot folder and unzip it from there; this will install the BezillaBrowser binary in the /boot/apps/BezillaBrowser folder.
- Installing Gnash: Download the Gnash package and unzip it from your /boot folder.
- Installing Gnash dependencies: When you unzip the Gnash package, a script named install-gnash-deps is placed on your desktop. Run this script from a Terminal to install all Gnash dependencies.
~> /boot/home/Desktop/install-gnash-deps
Follow the instructions at the prompts displayed by the script to install only those dependencies needed by your particular Haiku installation. If using a nightly build from Haiku Files, answer Yes to all prompts. The script downloads all the dependencies, places them in the right locations and returns to the Terminal prompt when finished.
Testing Gnash in Haiku
Gnash and all its dependencies should be now installed. You can start by checking if BeZillaBrowser recognizes the plugin; to do so, open the url about:plugins. After than, to see if Gnash actually works, point the browser to a YouTube video URL such as http://www.youtube.com/haikuzone. If all is properly installed, then the YouTube video player should appear embedded in the browser, and you should be able to play the video as you would with the Flash player from Adobe. To the right you can see a screenshot of Gnash playing a YouTube video from the HaikuZone Video Channel in Haiku.
If instead of the embedded YouTube video player you get a black box with the "error - have you installed Gnash's dependencies?" message, that means that something went wrong with the installation of Gnash's dependencies. If that happens, delete the /boot/home/gnash-dependencies folder and try running the install-gnash-deps again.
The Gnash package also includes a standalone player, which you can use by issuing a command with the following syntax from the Terminal:
~> sdl-gnash filename.swf
In my testing on a 2.2GHz dual core machine, sound played well and video performance was smooth; CPU load during playback was between 40% - 50% for both cores, which is comparable to playing the same video using Adobe's Flash player in Ubuntu. I also tried Gnash on my old 1.4GHz single core AMD Athlon machine; in this case, CPU load was much higher than on the dual core machine, but both sound and video still played smoothly and the system remained quite responsive even at the higher load.

Comments
Re: Watching YouTube in Haiku Using Gnash
Hi:
Could I ask some question ?
Q: How to port Gnash open source 0.8.6 in Linux platform (STB) to play Adobe flash ?
Its CPU speed has only 300Mhz.
How to do step by step due to be beginner for me?
Thanks a lot.
Re: Watching YouTube in Haiku Using Gnash
Hi Frank,
Gnash is available for Linux, so you should be able to install it (how it's done, it will depend on the distro you are using). However, I suspect you may not be able to get adequate performance using Gnash with a 300MHz CPU (although I have never tried).
Re: Watching YouTube in Haiku Using Gnash
Very nice guide, but "unzip it from your /booth folder" should read "unzip it from your /booth folder."
Re: Watching YouTube in Haiku Using Gnash
Very nice guide, but "unzip it from your /booth folder" should read "unzip it from your /booth folder."
Yeah, it's boot, not booth. Going to too many trade shows has its side effects, does it not? :)
Anyway, thanks for the heads up. It's fixed now.
Re: Watching YouTube in Haiku Using Gnash
that is "unzip it from your /boot folder"
Re: Watching YouTube in Haiku Using Gnash
Wow... replied faster than I noticed my own typo.