boxee :: forums  

Go Back   boxee :: forums > boxee developers > boxee applications

Reply
 
Thread Tools Display Modes
  #1  
Old May 8th, 2009, 01:49 PM
xmcnuggetx xmcnuggetx is offline
Senior Member
 
Join Date: Feb 2009
Posts: 219
Default Specify flash:// javascript file

How would you specify a js file to control a flash movie that is "found" on a website? If you send boxee a normal http:// link with a flash movie on it, then it is smart enough to play that movie within boxee. With this behavior how do you specify the .js for pausing, play, ect?
Reply With Quote
  #2  
Old May 8th, 2009, 02:15 PM
ameno ameno is offline
Senior Member
 
Join Date: Jan 2009
Location: Los Angeles, CA
Posts: 111
Default

Quote:
Originally Posted by xmcnuggetx View Post
How would you specify a js file to control a flash movie that is "found" on a website? If you send boxee a normal http:// link with a flash movie on it, then it is smart enough to play that movie within boxee. With this behavior how do you specify the .js for pausing, play, ect?
If you are asking how you would use js controls with an already existing player, the answer is... you can't.

The reason is that you have to have ExternalInterface.AddCallback functionality already existent within the player and the domain that the .js is on has to be allowed with Security.AllowDomains.

What I have done, however, with players that I have found, is to pull down the .swf and decompile it using SWF Decompiler. I then load that up into Flash and add the necessary lines of code. note, this will work with many more simple players where the site is not ultra secure. In the case of the big boys, this is going to be difficult.

Alternatively, you could create your own player and instead pull the flvs in directly.

So, in otherwords, you need access to be able to change both the code in your js AND the code in the player to be able to add Boxee controls.
Reply With Quote
  #3  
Old May 8th, 2009, 02:31 PM
xmcnuggetx xmcnuggetx is offline
Senior Member
 
Join Date: Feb 2009
Posts: 219
Default

boxee does allow this already if you use the flash:// url. Using a specially formatted .js file it allows you to send commands to the flash movie (like mouse clicks). Check http://developer.boxee.tv/rss-specification/ at the bottom of the page.

Example (hulu's .js): http://dir.boxee.tv/apps/hulu/player.js
Reply With Quote
  #4  
Old May 8th, 2009, 02:39 PM
ameno ameno is offline
Senior Member
 
Join Date: Jan 2009
Location: Los Angeles, CA
Posts: 111
Default

Quote:
Originally Posted by xmcnuggetx View Post
boxee does allow this already if you use the flash:// url. Using a specially formatted .js file it allows you to send commands to the flash movie (like mouse clicks). Check http://developer.boxee.tv/rss-specification/ at the bottom of the page.
Yes, I know, I have built several already (check out the LP33 application in your app box... I built most of that). BUT, the .swf player itself has to be able to receive those commands and know what to do with them.

Communication between flash and javascript is accomplished via the ExternalInterface class.

http://livedocs.adobe.com/flash/9.0/...Interface.html

Be sure to also note the security sandbox settings there that will need to be set.

Essentially, if the security is allowed, you can fire calls into the swf all day, but if the call itself is not registered and assigned to a function within the swf, the call from js is not going to do anything.

Also, to have FULL functionality (progress bar, volume), you need to have two way calls. So, the swf needs to also call into the js. You need to be able to alter the players actionscript.
Reply With Quote
  #5  
Old May 8th, 2009, 03:06 PM
xmcnuggetx xmcnuggetx is offline
Senior Member
 
Join Date: Feb 2009
Posts: 219
Default

I understand it can be done through the external interface, but check the hulu example it isn't using scriptable() it's simply using js to move the mouse and click the buttons as if it were the user.
Reply With Quote
  #6  
Old May 8th, 2009, 04:01 PM
ameno ameno is offline
Senior Member
 
Join Date: Jan 2009
Location: Los Angeles, CA
Posts: 111
Default

Quote:
Originally Posted by xmcnuggetx View Post
I understand it can be done through the external interface, but check the hulu example it isn't using scriptable() it's simply using js to move the mouse and click the buttons as if it were the user.
Right. Ok, so what you are asking is not about a player "found" on a web page, but a player EMBEDDED in a web page. Looks pretty straight forward to me. You are able to move the mouse and execute actions (like click) with those undocumented methods: FWMouseMove,FWGetPixel,FWMouseClick.

The thing you need to do in that case is pop the browser and center it as opposed to just playing a flash player.

That part is undocumented.

I haven't really dug crazily into hulus code, but it looks like (for example)

path = http://www.hulu.com/watch/56907/30-d...2Fshow%2F8.rss

url = "flash://hulu.com/src=" + urllib.quote( path ) + "&bx-ourl=" + urllib.quote( path )

Then you build out the list item and run

xbmc.Player( xbmc.PLAYER_CORE_AUTO ).play( url, listitem )

Somehow that is popping the browser into the player. I'm sure it could be reverse engineered, but it's actually a lot more work to set that up for a website than it is to just find the flash files (screen scrape or whatever) and bring them in.
Reply With Quote
  #7  
Old May 9th, 2009, 09:17 AM
vulkan vulkan is offline
team boxee
 
Join Date: Jul 2008
Posts: 234
Default

@xmcniggetx - you need to add "&bx-jsactions=http://...." to the end of the flash:// url.
this parameter (bx-jsactions) tells boxee where to take the controlling .js from.

happy debugging

-vulkan.
Reply With Quote
  #8  
Old October 19th, 2009, 03:53 PM
jdchmiel jdchmiel is offline
Junior Member
 
Join Date: Oct 2009
Posts: 7
Default

I am trying to accomplish just including my own js file during development:

boxee.enableLog(true);
boxee.log('Find abcxyz in the log');

is the entire contents of my js file currently, just for proof of it loading.
In a windows environment, is the path:
C:\Program Files\Boxee\system\players\flashplayer\myjs.js
accurate for the location of my file?
is there any better documentation out there at all? I must say that the 3 days of struggling to find documentation for this boxee system as a whole has been a very negative experience. I am now resorting to just blindly asking questions...
Reply With Quote
  #9  
Old October 19th, 2009, 10:46 PM
DPK DPK is offline
Super Moderator
 
Join Date: Feb 2009
Posts: 1,542
Default

Quote:
Originally Posted by jdchmiel View Post
is there any better documentation out there at all? I must say that the 3 days of struggling to find documentation for this boxee system as a whole has been a very negative experience. I am now resorting to just blindly asking questions...
http://developer.boxee.tv
http://wiki.boxee.tv/JavaScript_API
__________________
Common issues w/ Boxee:
Beta Important Info | FAQ & Support Requests | Hulu Mature Content | Search

UnBoxeed app development:
Comics.com | ESPN360 | Weather

For more info, follow app development on Twitter!
Reply With Quote
  #10  
Old October 20th, 2009, 09:00 AM
jdchmiel jdchmiel is offline
Junior Member
 
Join Date: Oct 2009
Posts: 7
Default

yeah... figured that was all there was...
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 05:22 PM.


skin based on greenzero from vBSkins.com

 
Powered by vBulletin® Version 3.7.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.