package org.red5.core;
/*
* RED5 Open Source Flash Server - http://www.osflash.org/red5
*
* Copyright (c) 2006-2007 by respective authors (see below). All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later
* version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this library; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import org.red5.server.adapter.ApplicationAdapter;
import org.red5.server.api.IConnection;
import org.red5.server.api.IScope;
import org.red5.server.api.Red5;
import org.red5.server.api.service.ServiceUtils;
import org.red5.server.api.stream.IBroadcastStream;
import org.red5.server.api.stream.IStreamAwareScopeHandler;
import org.red5.server.framework.ClientManager;
import org.red5.server.framework.LayoutManager;
import org.red5.server.framework.StreamManager;
import org.red5.server.framework.*;
/**
* Red5Server Framework.
*
* @author The Red5 Project (red5@osflash.org)
* @author Dominick Accattato
* @author Joachim Bauch (jojo@struktur.de)
*/
public class Application extends ApplicationAdapter implements IStreamAwareScopeHandler {
/** Manager for the clients. */
private ClientManager clientMgr = new ClientManager("clientlist", false);
private StreamManager streamMgr = new StreamManager("streamlist", false);
private LayoutManager layoutMgr = new LayoutManager("layoutlist", false);
public Application() {
System.out.println("test");
}
/** {@inheritDoc} */
@Override
public boolean connect(IConnection conn, IScope scope, Object[] params) {
// Check if the user passed valid parameters.
if (params == null || params.length == 0) {
// NOTE: "rejectClient" terminates the execution of the current method!
rejectClient("No username passed.");
}
// Call original method of parent class.
if (!super.connect(conn, scope, params)) {
return false;
}
String username = params[0].toString();
String uid = conn.getClient().getId();
Client client = new Client();
client.setUsername(username);
client.setAge(100);
client.setUid(uid);
// Register the user in the shared object.
clientMgr.addClient(scope, client);
// Notify client about unique id.
ServiceUtils.invokeOnConnection(conn, "setClientID",
new Object[] { uid });
return true;
}
/** {@inheritDoc} */
@Override
public void disconnect(IConnection conn, IScope scope) {
// Get the previously stored username.
String uid = conn.getClient().getId();
// Unregister user.
String username = clientMgr.removeClient(scope, uid);
// Call original method of parent class.
super.disconnect(conn, scope);
}
@Override
public void streamBroadcastClose(IBroadcastStream stream) {
// TODO Auto-generated method stub
super.streamBroadcastClose(stream);
// Get connection and Scope
IConnection conn = Red5.getConnectionLocal();
IScope scope = conn.getScope();
streamMgr.removeStream(scope, stream.getName());
}
@Override
public void streamBroadcastStart(IBroadcastStream stream) {
// TODO Auto-generated method stub
super.streamBroadcastStart(stream);
// Get connection and Scope
IConnection conn = Red5.getConnectionLocal();
IScope scope = conn.getScope();
streamMgr.addStream(scope, stream.getPublishedName(), stream.getName());
}
@Override
public void streamPublishStart(IBroadcastStream stream) {
// TODO Auto-generated method stub
super.streamPublishStart(stream);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
red5-plugin-for-eclispe-1.0x.zip (94个子文件)
red5-plugin-for-eclispe-1.0x
features
org.red5.feature_1.0.0
feature.xml 26KB
plugins
org.red5.wizard_1.0.0
bin
org
red5
eclipse
Red5CoreFacetInstallPage.class 2KB
Red5CoreFacetInstallConfig.class 729B
Red5CoreFacetInstallConfig$Factory.class 614B
Utils.class 6KB
Red5CoreFacetInstallDelegate.class 9KB
Red5Plugin.class 2KB
META-INF
MANIFEST.MF 881B
templates
version
0_2
Red5
WEB-INF
red5-web.properties 87B
web.xml 2KB
src
logback.xml 627B
org
red5
core
SimpleApplication.java 2KB
Application.java 4KB
red5-web.xml 1KB
FlexUnit
.actionScriptProperties 845B
.flexProperties 132B
html-template
index.template.html 4KB
history
historyFrame.html 778B
history.css 365B
history.js 23KB
playerProductInstall.swf 657B
AC_OETags.js 8KB
src
flexunit
framework
tests
TestAsynchronous.as 8KB
FailureTestCase.as 2KB
TearDownTestCase.as 2KB
TearDownErrorTestCase.as 2KB
TestTestListener.as 5KB
ValueEvent.as 2KB
ErrorTestCase.as 2KB
TestTestCase.as 9KB
TestAssert.as 8KB
SetupErrorTestCase.as 2KB
AllFrameworkTests.as 2KB
SetupErrorTearDownTestCase.as 2KB
AsynchronousTestCase.as 7KB
AsynchronousValueDispatcher.as 3KB
SuccessTestCase.as 2KB
Main.mxml 548B
.project 451B
libs
flexunit-.85.swc 457KB
Flex
.actionScriptProperties 835B
.flexProperties 132B
html-template
index.template.html 4KB
history
historyFrame.html 778B
history.css 365B
history.js 23KB
playerProductInstall.swf 657B
AC_OETags.js 8KB
src
Test.mxml 962B
JedaiTemplate.mxml 712B
applicationContext.xml 970B
.project 449B
libs
papervision3d-2.0.swc 741KB
JedaiLib-0.1.swc 886KB
JedaiLib-0.2.swc 886KB
flexmdi-1.1.swc 411KB
paperworld3d-0.2.swc 1.15MB
flexunit-.85.swc 457KB
Jedai.swc 893KB
flexlib-2.4.swc 291KB
Cairngorm-2.2.swc 12KB
icons
red5.gif 13KB
red5-ext.gif 318B
red5-cat.gif 590B
red5-core.gif 590B
org
red5
eclipse
Red5CoreFacetInstallPage.class 2KB
Red5CoreFacetInstallConfig.class 729B
Red5CoreFacetInstallConfig$Factory.class 614B
Utils.class 6KB
Red5CoreFacetInstallDelegate.class 9KB
Red5Plugin.class 2KB
build.properties 286B
plugin.xml 2KB
build_red5.xml 1KB
libs
xml-apis.jar 191KB
asm-util-2.2.3.jar 34KB
log4j-over-slf4j-1.4.3.jar 9KB
xercesImpl.jar 1.16MB
formgen-core.jar 6KB
commons-logging-1.1.1.jar 59KB
groovy-1.0.jar 1.71MB
js-14.jar 963KB
ant-contrib-1.0b3.jar 219KB
jedai.jar 7KB
ant.jar 1.23MB
asm-2.2.3.jar 34KB
commons-dbcp-1.2.2.jar 119KB
formgen-ext.jar 3KB
ant-apache-bsf-1.6.1.jar 12KB
antlr-2.7.6.jar 433KB
ant-launcher.jar 11KB
bsf-2.4.0.jar 111KB
org.red5.server_1.0.0.jar 40KB
org.red5.doc_1.0.0.jar 7KB
共 94 条
- 1
资源评论
- xch802015-04-21不好用,可能版本原因
- jewarn2015-05-07不是很好用,后面也没有用这个了,
- FengWu9x242015-05-23该插件可以安装:直接解压到dropin目录下 ,用red5.link文件里填解压地址的方法不行。
沼川
- 粉丝: 3
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功