#1  
Old 1st November 2010, 08:36
groma84 groma84 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 2
Question HTML/JavaScript API - Multiple players on one page

Hi,

I'm trying to have multiple players on one page, each in its own <div>.

I want to check for each player if the stream it shows is online or not, and set the visibility accordingly.

In the API Documentation it says:
http://www.livestream.com/userguide/...TML_Developers
"The player also calls a special function when an event occurs. The name of that function by default is livestreamPlayerCallback, but it can be configured by using the jscallback flashvar. It takes one parameter which is the type of the event that fired."

I tried setting the jscallback flashvar for each player when embedding it, but they all still use the same (default) callback handler:

"swfobject.embedSWF("http://media.xfire.com/swf/livevideoplayer.swf",
"livestreamPlayer2", "500", "400", "9.0.0", "expressInstall.swf", {channel: 'xfire_momojohn', autoPlay: 'true', jscallback: 'livestreamPlayerCallback2'}, params); "

I did not find any way to actually differ between each of the players in the callback handler (which would be okay, too).

I do not use the livestream.com player but the XFire player instead because I want to stream XFire live streams.

The testing page I'm trying to get this to work on for now can be reached here:
http://www.irae-guild.de/streamtest.htm
The streams there I took from the XFire Livestream page (may be offline at times).
Reply With Quote
  #2  
Old 3rd November 2010, 11:02
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

Using API features on xfire's player is not currently supported. Please use the Livestream API's swfs.
Reply With Quote
  #3  
Old 3rd November 2010, 11:12
groma84 groma84 is offline
Junior Member
 
Join Date: Nov 2010
Posts: 2
Post

Thanks for your reply.

I've given up handling my idea this way and am using the Livestream Channel API in combination with PHP:

1) Request status for each channel
2) If channel->isLive is true, output the HTML embed code for the player, if it is false output just some text
3) Repeat for all channels I want to check

+ caching to avoid problems with the 10000 requests per day limit in high-traffic situations.

I'm very confident it will work this way.

Thanks again and bye
Reply With Quote
Reply

Tags
html, javascript, multiple players, problem, xfire

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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