Tous les exemples avec un DATAGRID disponibles sur:
Archive for October, 2007
red5 start avec ECLIPSE
1) Allez dans c:\program files\red5\webapps
copier test en demo2
2) garder le dossier source et classes mais effacer leur contenu
3) Ouvrir eclipse:Chosir le workspace:C:\Program Files\Red5\webapps\
4) dans Eclipse: Nouveau projet - demo2
5) Right click source: Build path->use as source folder
6) Bouton droit sur le projet (TOP) demo2->Propritétés
7) Java Build Path->Browse->classes
Effacer le dossier inutile Bin
9) Click droit sur demo2 projet et propriété: Java Build Path->Libraries->Add external JAR->
Red5.jar
commons-logging-1.1.jar
10) demo2->New->Package->demo2
11) demo2 package->New Class->Application
12) ecrire
package demo2;import org.red5.server.adapter.ApplicationAdapter;
public class Application extends ApplicationAdapter {
public double add(double a, double b){return a + b; }
}13) editer les fichiers: red5-web.xml effacer
Editer
class=”demo2.Application”
singleton=”true” />14) Editer red5-web.properties
webapp.contextPath=/demo214) Editer red5-web.properties15) Editer web.xml
Changer
webAppRootKey /demo2
SOUS FLASH taper:
var nc:NetConnection = new NetConnection();
// connect to the local Red5 server
nc.connect(”rtmp://localhost/demo2″);
nc.onResult = function(obj) {
trace(”the result is”+obj);
};
nc.onStatus = function(info:Object) {
trace(info.code);
trace(info.level);
trace(info);
if (info.code == “NetConnection.Connect.Success”) {
//trace(”susccess”);
}
};
nc.call(”add”, nc, 2,3);
resultat:5
Comment verifier qu’un lien pointe bien vers votre site ?
Une simple fonction PHP vous permer de le faire !
function check_back_link($remote_url, $your_link) {
$match_pattern = preg_quote(rtrim($your_link, “/”), “/”);
$found = false;
if ($handle = @fopen($remote_url, “r”)) {
while (!feof($handle)) {
$part = fread($handle, 1024);
if (preg_match(“/\”‘]”.$match_pattern.
“(\/?)[\”‘](.*)>(.*)<\/a>/”, $part)) {
$found = true;
break;
}
}
fclose($handle);
}
return $found;
}
// example:
//if (check_back_link(”http://www.capuccino.com”, “http://www.another.com”)) echo “link exists”;
?>
.., = ; ; ; ;
-
<script language=“javascript”>
-
var track_errors=1;
-
function noError()
-
{
-
if (track_errors==1)
-
{
-
return true;
-
}
-
}
-
window.onerror = noError;
-
</script>
-
<!– Put IE into quirks mode –>
-
<meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8″ />
-
<title></title>
-
<? $hh=100;
-
$hf=50; ?>
-
-
<style type=“text/css”>
-
-
body {
-
height:100%;
-
max-height:100%;
-
overflow:hidden;
-
padding:0;
-
margin:0;
-
border:0;
-
}
-
-
#content {
-
display:block;
-
overflow:auto;
-
position:absolute;
-
z-index:3;
-
top:<?=$hh;?>px;
-
bottom:<?=$hf;?>px;
-
width:100%;
-
border-left:1px solid #000;
-
border-right:1px solid #000;
-
}
-
-
* html #content {
-
top:0;
-
bottom:0;
-
height:100%;
-
width:100%;
-
border-top:<?=$hh;?>x solid #fff;
-
border-bottom:<?=$hf;?>px solid #fff;
-
}
-
-
#head {
-
position:absolute;
-
top:0;
-
width:100%;
-
min-width:640px;
-
height:<?=$hh;?>px;
-
font-size:1em;
-
z-index:5;
-
border:1px solid #000;
-
}
-
-
-
-
#foot {
-
position:absolute;
-
bottom:0;
-
width:100%;
-
min-width:640px;
-
height:<?=$hf;?>px;
-
z-index:5;
-
border:1px solid #000;
-
}
-
-
-
-
</style>
-
</head>
-
-
<div id=“head”>hello world</div>
-
<div id=“foot”>THIS IS FOOTER</div>
-
<div id=“content”>
-
A layout with a fixed width, a fixed header and a fixed footer that stays on the bottom. The content area fits between the header and footer and scrolls if necessary. Plus the bonus of a CSS navigation menu that works in all browsers.
RED5 client info
Comment creer un client avec paramètres (role, id, username) sous red5 ?
Creer un objet client
public class Client{
String clientId = null;
String clienName = null;
String clientRole = null;
public String getRole(){
return clientRole;
}
public String getName(){
return clientName;
}
public String getId(){
return clientId;
}
public void setRole(String role){
clientRole = role;
}
public void setName(String name){
clientName = name;
}
public void setId(String id){
clientId = id;
}
}
(…)
public boolean roomConnect(IConnection iconnection, Object params[]){
if(!super.roomConnect(iconnection, params)){
log.info((new StringBuilder()).append(”Application failed to connect room: “).append(iconnection.getScope().getName()).toString());
return false;
}
else{
log.info((new StringBuilder()).append(”Application room connect initiated for room “).append(iconnection.getScope().getName()).append(”: “).toString());
//AJouter les infos du client ici
Client client = new Client();
client.setId(params[0].toString());
client.setName(params[1].toString());
client.setRole(params[2].toString());
iconnection.getClient().setAttribute(”client”, client);
return true
}
}
public boolean roomJoin(IClient iclient, IScope iscope){
/*ICI on accede aux infos de notre client !*/
Client client = ((Client)iclient.getAttribute(”client”));
String clientName = client.getName();
String clientId = client.getId();
String clientRole = client.getRole();
return true;
}
red5 search engine
les maiing peuvent etre cherchés :
commentaires récenets