[Red5] Livestreaming: Check if a user is already publishing !
Mathias Menrath
MenrathMathias at t-online.de
Mon May 11 14:19:56 PDT 2009
Hi Walter,
thanks for your answer.
However, your solution would only work for a Java-based Client or for the RED5-server-application
itself. But in my case, i use a Flex-Client. That's why i define a new property for the sharedObject
by the "setProperty"-method (clientside way).
The serverside part of my sharedObject is:
/**SharedObject for streaming informations. */
private ISharedObject streamSo;
...
createSharedObject(myScope, "streamlist", false);
streamSo = getSharedObject(myScope, "streamlist");
I'm at a loss here.
Any further hint would be greatly appreciated.
Mathias
----- Original Message -----
From: Walter Tak
To: red5 at osflash.org
Sent: Monday, May 11, 2009 8:54 PM
Subject: Re: [Red5] Livestreaming: Check if a user is already publishing !
Try to change: if (soStream.data.id == "notPublishing")
to:
if (soStream.data.id.equals("notPublishing") );
See http://leepoint.net/notes-java/data/expressions/22compareobjects.html
Walter
----- Original Message -----
From: Mathias Menrath
To: red5 at osflash.org
Sent: Monday, 11 May 2009 18:15
Subject: [Red5] Livestreaming: Check if a user is already publishing !
Hi,
i want to use a Remote Shared Object to store the information if a specific user
(with an unique user ID) is currently publishing or not, so that the "Play"-Button for
all the other Receivers is getting enabled or disabled within the corresponding Video-
Component.
I thought i could simply do the following:
1. Setup the SharedObject for the streaming informations:
soStream = SharedObject.getRemote( "streamlist", nc.uri, false );
soStream.addEventListener( NetStatusEvent.NET_STATUS, soStreamNetStatusHandler );
soStream.addEventListener( AsyncErrorEvent.ASYNC_ERROR, soStreamAsyncErrorHandler );
soStream.addEventListener( SyncEvent.SYNC, soStreamSyncHandler );
soStream.client = this;
soStream.connect( nc );
2. Within my Video-Component: set the property for the sharedObject (as Sender) ...
... and check this property (as Receiver)
// "id" is a unique user ID (type String)
As Sender: soStream.setProperty(id, "notPublishing"); // by default
soStream.setProperty(id, "publishing"); // when publishing
As Receiver:
if (soStream.data.id == "notPublishing")
{
btnAV.enabled = false;
}
else if (soStream.data.id == "publishing")
{
btnAV.enabled = true;
title += "-> ON AIR";
setStyle("backgroundColor", "yellow")
}
However: Neither the first if-block (blue) nor the second one (green) are getting called !!!
Though the data in the sharedObject is definately getting set by the Sender.
Any ideas what could be the problem here ?
Greetz
Mathias
----------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
Red5 at osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org
----------------------------------------------------------------------------
Internal Virus Database is out-of-date.
Checked by AVG.
Version: 7.5.557 / Virus Database: 270.12.11/2089 - Release Date: 30-04-09 17:53
------------------------------------------------------------------------------
_______________________________________________
Red5 mailing list
Red5 at osflash.org
http://osflash.org/mailman/listinfo/red5_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090511/ea73c56a/attachment-0001.html>
More information about the Red5
mailing list