2009-03-08, 03:01
rwparris2 Wrote:I've been kind of rolling the idea in my head of just launching an actual webbrowser, and simulating a 'click' on the 'fullscreen' button.
Yeah, I had been working on that too. Using AIR since it contains WebKit and is scriptable via Flash.
Sometimes the video loads and plays, sometimes it gets "this video can only be watched at Hulu". Also the fake mouse event doesn't work yet. Hulu player is also supposed to go fullscreen when you type "F" but that doesn't seem to work either.
Here's the code if anyone wants to play more.
HuluTV.mxml
Code:
<!-- Compile ~/flex-3.2.0/bin/amxmlc HuluTV.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*"
applicationComplete="stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE">
<mx:Script><![CDATA[
import flash.events.Event;
import flash.events.MouseEvent;
private function onPageLoad(event:Event):void {
var player:Object = html.domWindow.document.getElementById('player');
trace(player.offsetTop)
trace(dispatchEvent(new MouseEvent(MouseEvent.CLICK, true, false, 828, 250)))
}
]]></mx:Script>
<mx:HTML id="html" width="100%" height="100%" complete="onPageLoad(event)" location="http://www.hulu.com/watch/58602/my-name-is-earl-my-name-is-alias"/>
</mx:Application>
Run via ~/air-1.5.1/bin/adl HuluTV.xml
HuluTV.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
<id>com.rectalogic.HuluTV</id>
<filename>HuluTV</filename>
<initialWindow>
<content>HuluTV.swf</content>
<visible>true</visible>
<width>500</width>
<height>400</height>
</initialWindow>
</application>