Introducing the Live Player SWF API

170 views
Skip to first unread message

Paul Sawaya

unread,
Jun 18, 2009, 6:31:56 PM6/18/09
to justintv-ap...@googlegroups.com
Embedding the live player SWF into your application allows you to play streams from justin.tv inside of Flash. The SWF itself is available at http://www.justin.tv/widgets/live_api_player.swf. Full documentation of the live player API and example code is available on the API wiki at http://apiwiki.justin.tv/mediawiki/index.php/Live_Video_SWF_Documentation.

Using the live player SWF is very simple. Like the Broadcaster, you'll want to load it into your ActionScript program using the Loader class, and then you'll be able to access the live video API through the api member of the live player.

For example, after you've successfully loaded the live player SWF into a Loader instance named api_loader, playing a stream is as simple as calling api.play_live. Here's a full example:

flash.system.Security.allowDomain("*");

stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
stage.align = flash.display.StageAlign.TOP_LEFT;

var loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e){
    Object(loader.content).api.play_live("apidemo");
    stage.addChild(loader);
});
var jtv_api_url = 'http://www.justin.tv/widgets/live_api_player.swf';
loader.load(new URLRequest (jtv_api_url));

Mark Vaughn

unread,
Jul 2, 2009, 4:09:23 PM7/2/09
to Justin.tv API Developers
Is there a way to disable the "on_video_click"?

Mark Vaughn

On Jun 18, 5:31 pm, Paul Sawaya <p...@justin.tv> wrote:
> Embedding the live player SWF into your application allows you to play
> streams from justin.tv inside of Flash. The SWF itself is available athttp://www.justin.tv/widgets/live_api_player.swf. Full documentation of the
> live player API and example code is available on the API wiki athttp://apiwiki.justin.tv/mediawiki/index.php/Live_Video_SWF_Documenta....

Emmett Shear

unread,
Jul 2, 2009, 4:18:13 PM7/2/09
to justintv-ap...@googlegroups.com
Hey Mark -

No, there is not, and we don't plan to add a way to disable it.

E

Devon H. O'Dell

unread,
Jul 2, 2009, 4:39:34 PM7/2/09
to justintv-ap...@googlegroups.com
2009/7/2 Emmett Shear <emmett...@gmail.com>:
> Hey Mark -
> No, there is not, and we don't plan to add a way to disable it.
> E

Would it be possible to consider changing the functionality to open
the Justin page in a new (window|tab), then? The only reason I see
this being a problem is because I've had ads pop up on our site before
that I've attempted to close, but either the X has been too small or I
clicked 1 pixel over to the transparent part and it's taken me to the
Justin.tv user page. I don't have a problem with this behavior when
the click is blatantly in the middle of the window, but it is a
complaint our users voice with some frequency, as they then have to
navigate back to the show they were watching on our site.

I'm all for crediting Justin.tv for the API, but it is a bit of a pain
that it trashes the user experience at our site.

--dho

Emmett Shear

unread,
Jul 2, 2009, 4:44:36 PM7/2/09
to justintv-ap...@googlegroups.com
Ah, yes. We've had that issue before. There are actually two issues:

1. Ad close buttons are too small, and easy to miss, causing the user to navigate off the page accidentally. We will see if we can make the buttons bigger.
2. Some times ad units fail to actually catch the click event, and it falls through to the video background *even though you clicked the button*. I think we've resolved all those cases, but if you've found that occurring please let me know and I will fix it.

We'll consider the option to make the click pop open the Justin.tv channel in a new window. Thanks for the feedback!

E

Mark Vaughn

unread,
Jul 2, 2009, 4:45:51 PM7/2/09
to justintv-ap...@googlegroups.com
I simply hate this feature, mainly because I'm always accidentally clicking
on the video area and loading up the channel page.

Mark Vaughn

Devon H. O'Dell

unread,
Jul 2, 2009, 4:54:00 PM7/2/09
to justintv-ap...@googlegroups.com
2009/7/2 Mark Vaughn <itsm...@charter.net>:
>
> I simply hate this feature, mainly because I'm always accidentally clicking
> on the video area and loading up the channel page.

It's not desirable, but considering the fact that it *is* their
service (and it costs a lot of money to run such a service -- I
calculated around $3,000 a month for one of our mildly popular users),
I can understand the business decision to have the feature in the
first place. I do think that opening it in a new window is a great
compromise for all involved. To my knowledge (and I've been speaking
with Ustream marketing / tech and searching the web for at least a
year about this) this is the only free, `brandable' service. I rarely
make accidental clicks (probably since I'm used to precise mousing due
to my heavy use of Plan 9), but can understand how that can be
annoying. If the compromise was made to open in a new window, I'd
consider that a huge win: it doesn't explicitly remove the user from
my page, and I still am able to `market' a better service to my
12,000-or-so users. I'm certainly not going to bite the hand that
feeds (and my apologies if that statement adds unintended negative
connotation towards Justin regarding the service).

Emmett, regarding the ad layer not catching the click: it's probably
been at least a week or two since I've experienced that (and that's
what I figured it might be), so it's good to know that it's a known
issue that has been / is being addressed. Thanks a bunch!

--dho

BS

unread,
Jul 27, 2009, 1:42:47 AM7/27/09
to Justin.tv API Developers
I just looked over the wiki for the API. Your event model seems
broken: You have multiple events all with the type 'video,' then you
have a custom property 'event' that does when type is supposed to do.

Why don't you send your event types over event.type like all the other
APIs?

Emmett Shear

unread,
Jul 27, 2009, 1:46:00 AM7/27/09
to justintv-ap...@googlegroups.com
Probably because when I was designing that part of the API I wasn't thinking very hard about it.

Clearly you are right - it should go over event.type. I'll see about updating it.

E

Rampage0

unread,
Aug 10, 2009, 11:37:32 PM8/10/09
to Justin.tv API Developers
Hello,

Yes i know this is bring up an old topic, but I have found a way
around this and am now able to block it from going onto your website
when a user clicks on the video. Should i report this somewhere or
something because you guys might not want too many people starting to
use it ????

On Jul 2, 4:18 pm, Emmett Shear <emmett.sh...@gmail.com> wrote:
> Hey Mark -
> No, there is not, and we don't plan to add a way to disable it.
>
> E
>

Kyle Vogt

unread,
Aug 11, 2009, 2:05:12 AM8/11/09
to justintv-ap...@googlegroups.com
Hi Rampage0,

It would be great if you could report this to ky...@justin.tv or emm...@justin.tv so we can review it.

Thanks,
Kyle
Reply all
Reply to author
Forward
0 new messages