Salut à tous,
Afin de finir mon petit projet, je rencontre une dernière difficulté.
J'ai donc une page index.php qui contient plusieurs webcams.En voici un extrait :
Le membre cliquer alors sur le lien ../cam/macam2.php?cam=video2 ou ../cam/macam2.php?cam=video1 et ouvrira cette page macam2.php :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84 <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> <? require_once '../internals/$config.php'; require_once '../internals/Header.inc.php'; ?> <script type='text/javascript' src='./jwplayer.js'></script> <script type="text/javascript" src="/jwplayer/jwplayer.js"></script> </head> <body bgcolor="#d7dbf8"> <tr><A HREF="#" onClick="window.open('../cam/macam2.php?cam=video1', 'Ma cam', 'scrollbars=yes,width=330,height=250')"><IMG SRC="../layout/img/bouton.png" WIDTH="155" HEIGHT="55" BORDER=0 ALT="Allumer ma cam"></A></tr> <div id='player1'>This text will be replaced</div> <p id="message"></p> <script type='text/javascript'> jwplayer('player1').setup({ flashplayer: "jwplayer.swf", logo: "../layout/img/watermark2.png", 'logo.timeout': "60", type: "rtmp", streamer: "rtmp://monhost", autostart: "true", bufferlength: "3", file: "video1", controlbar: "bottom", width: "320", height: "260", skin: "skins/nexus.zip" }); jwplayer().onPlay(function() { setText("la variable $chat_user ici"); }); // ici jwplayer().onPause(function() { setText("??? a fait une pause"); }); jwplayer().onBuffer(function() { setText("En pause..."); }); jwplayer().onIdle(function() { setText("Personne en cam."); }); function setText(text) { document.getElementById("message").innerHTML = text; } var t; var timer=5000; jwplayer('player1').onIdle(function() { t=setTimeout("jwplayer('player1').play()",timer); }); </script> <tr><A HREF="#" onClick="window.open('../cam/macam2.php?cam=video2', 'Ma cam', 'scrollbars=yes,width=330,height=250')"><IMG SRC="../layout/img/bouton.png" WIDTH="155" HEIGHT="55" BORDER=0 ALT="Allumer ma cam"></A></tr> <div id='player2'>This text will be replaced</div> <p id="message"></p> <script type='text/javascript'> jwplayer('player2').setup({ flashplayer: "jwplayer.swf", logo: "../layout/img/watermark2.png", 'logo.timeout': "60", type: "rtmp", streamer: "rtmp://monhost", autostart: "true", bufferlength: "3", file: "video2", controlbar: "bottom", width: "320", height: "260", skin: "skins/nexus.zip" }); jwplayer().onPlay(function() { setText("l'autre $chat_user ici"); }); // ici jwplayer().onPause(function() { setText("??? a fait une pause"); }); jwplayer().onBuffer(function() { setText("En pause..."); }); jwplayer().onIdle(function() { setText("Personne en cam."); }); function setText(text) { document.getElementById("message").innerHTML = text; } var t; var timer=5000; jwplayer('player2').onIdle(function() { t=setTimeout("jwplayer('player2').play()",timer); }); </script> ...............
En sachant que je passe en parametre $ncam, comment, dans index.php, puis-je récupérer la valeur $chat_user ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69 <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <?php require_once '../internals/$config.php'; require_once '../internals/Header.inc.php'; $ncam = $_GET["cam"]; $sql = SK_MySQL::placeholder( "SELECT `profile_id`,`username`,`password` FROM `".TBL_PROFILE."` WHERE username='?'", $_SESSION['%http_user%'][username] ); $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); // on fait une boucle qui va faire un tour pour chaque enregistrement while($data = mysql_fetch_assoc($req)) { // on affiche les informations de l'enregistrement en cours $chat_user= $data['username']; $chat_id= $data['profile_id']; } ?> <body> <script> function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName]; } </script> <td> <center> <object type="application/x-shockwave-flash" data="VideoIO11.swf" id="<? echo $ncam;?>" width="320" height="240" quality="high"> <param name="movie" value="VideoIO11.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#000000" /> <param name="allowFullScreen" value="true" /> <param name="allowScriptAccess" value="always" /> <param name="flashVars" value="controls=true" /> </object> <center> <input id="src1" type="hidden" autocomplete="off" style="width:170px;" value="rtmp://monhost"/> <input id="publish1" type="hidden" autocomplete="on" style="width:50px;" value="<? echo $ncam;?>"/> <input value="Envoyer ma Cam" type="button" onclick="getFlashMovie('<? echo $ncam;?>').setProperty('src', document.getElementById('src1').value + '?publish=' + document.getElementById('publish1').value)"/> <input value="Arrêter" type="button" onclick="getFlashMovie('<? echo $ncam;?>').setProperty('src', null)"/> </center> </td> <span style=font-family:arial;color:#3d16e8;font-size:small;text-align:center;><?php echo $chat_user; ?></span> </body> </html>
Merci à tous de votre aide
Partager