OpenLaszlo YouTube Player Demo and Source Code
I've been working on developing streaming video support for OpenLaszlo: LZX classes to support improved audio and video, including RTMP streaming via Flash Media Server (aka Flash Communication Server) and also the Red5 Open Source Flash Server, as well as streaming video via http. It supports playback of recorded FLVs, recording from camera and microphone, live two-way (or multi-party) audio/video conferencing, and FLV streaming over http.
It's easy to use the OpenLaszlo video components, because they're nicely integrated with the OpenLaszlo programming model. They expose logical attributes and events which make it easy to integrate video into OpenLaszlo applications.
To test it out the code and demonstrate its functionality, I've developed a simple YouTube Player in OpenLaszlo [click here to open it in a window]. It uses the YouTube ReST Web API, and some simple html screen scraping to get the URL parameters to stream the FLV file directly.
Here is the source for the test application wrapper that puts the YouTube video player in a resizable window, and the more interesting source for the youtubeplayer component, that uses the new OpenLaszlo video classes I'm developing (whose source is in this directory).
The new video classes and the YouTube player demo will be checked into the OpenLaszlo svn repository soon.
Here's a live demo:
- dhopkins's blog
- Login or register to post comments
Webcam Snapshot
UI playground
Works in Firefox 1.07, but not IE 6
Fixed the problem, worked around IE bug.
Apparently IE has a bug when it comes to delivering gzip compressed downloaded content to plug-ins. If the page is compressed, then Flash get an empty results instead of the content that was actually downloaded. The YouTube viewer needs to scrape the html of YouTube's watch web page, to figure out the URL of the FLV Flash video file to play, so it fetches an html page from YouTube. Unfortunately that's compressed, so it fails on IE.
So I wrote a simple little jsp to provide a minimal YouTube query service that does all the dirty work. I just tested it, and it seems to work now (for me)! When I check the code into the Laszlo trunk, the YouTube player will be in the demos/youtube directory, along with the supporting jsp.
-Don