|
From: <tre...@us...> - 2008-02-27 23:09:28
|
Revision: 779
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=779&view=rev
Author: trevorolio
Date: 2008-02-27 15:09:30 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
Revved chat widget source
Modified Paths:
--------------
maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
maven/trunk/ogoglio-avserver/client/html-template/index.template.html
Modified: maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml
===================================================================
--- maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 22:56:28 UTC (rev 778)
+++ maven/trunk/ogoglio-avserver/client/OgoglioChat.mxml 2008-02-27 23:09:30 UTC (rev 779)
@@ -5,7 +5,7 @@
<![CDATA[
import com.ogoglio.chat.client.UserStream;
- private var streamURL:String = "rtmp://10.0.2.2:1935/ogoglio/";
+ private var streamURL:String = null;
private var streamName:String = null;
private var username:String = null
private var spaceId:String = null
@@ -21,6 +21,15 @@
trace("Initializing Ogoglio Chat Client");
username = getParameter("username");
spaceId = getParameter("spaceID");
+ streamURL = getStreamURL();
+
+ if(streamURL == null){
+ statusLabel.text = "No stream url.";
+ pushToTalkButton.enabled = false;
+ muteCheckBox.enabled = false;
+ trace("Could not determine stream url");
+ return;
+ }
if(username == null || spaceId == null){
statusLabel.text = "No username or spaceID Parameter";
pushToTalkButton.enabled = false;
@@ -36,9 +45,29 @@
listen();
}
+ public function getStreamURL():String {
+ var paramURL:String = getParameter("streamURL");
+ if(paramURL != null){
+ return paramURL;
+ }
+ var hostname:String = getHostname();
+ if(hostname == null){
+ return null;
+ }
+ return "rtmp://" + hostname + ":1935/ogoglio/";
+ }
-
- public function getParameter(name:String):String {
+ public function getHostname():String {
+ var protocol:String = ExternalInterface.call("window.location.protocol.toString");
+ if(protocol == "file:") {
+ return "127.0.0.1";
+ } else {
+ return ExternalInterface.call("window.location.hostname.toString");
+ }
+ return null;
+ }
+
+ public function getParameter(name:String):String {
if(typeof getUrlParameters()[name] != undefined && getUrlParameters()[name] != null){
return getUrlParameters()[name];
}
@@ -175,7 +204,7 @@
muteCheckBox.enabled = true;
break;
case "NetConnection.Connect.Failed":
- trace("Failed to connect");
+ trace("Failed to connect to " + streamURL);
statusLabel.text = "Failed";
pushToTalkButton.enabled = false;
muteCheckBox.enabled = false;
Modified: maven/trunk/ogoglio-avserver/client/html-template/index.template.html
===================================================================
--- maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 22:56:28 UTC (rev 778)
+++ maven/trunk/ogoglio-avserver/client/html-template/index.template.html 2008-02-27 23:09:30 UTC (rev 779)
@@ -70,7 +70,7 @@
"quality", "high",
"bgcolor", "${bgcolor}",
"name", "${application}",
- "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + "&username=trevor" + "&spaceID=44",
+ "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + "&username=boo&spaceID=44&streamURL=rtmp://localhost:1935/ogoglio/",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|