GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: the flash recorder for chirrp, written with haXe
Homepage: http://chirrp.net/
Clone URL: git://github.com/why/chirrup.git
Last step: publishing to chirrp.net.
why (author)
Thu Apr 17 16:18:00 -0700 2008
commit  d7120a4ff128b4b337a2d886d41e0132a74a9fdb
tree    adee8e84894febb89d921240515a0fa519d9925d
parent  4bed290208fb837ddda19e8fa12d36a369e132af
...
10
11
12
13
14
 
 
15
16
17
...
10
11
12
 
 
13
14
15
16
17
0
@@ -10,8 +10,8 @@ import flash.text.TextFormat;
0
 
0
 class Base {
0
 
0
- static var rtmp = "rtmp://localhost";
0
- static var server = "http://localhost:3000";
0
+ static var rtmp = "rtmp://chirrp.net";
0
+ static var server = "http://chirrp.net";
0
 
0
   static var nc : NetConnection;
0
   static var ns : NetStream;
...
6
7
8
9
 
 
10
11
12
 
13
14
15
16
17
18
19
20
 
 
 
 
21
22
...
6
7
8
 
9
10
11
12
 
13
14
15
16
17
18
19
 
 
20
21
22
23
24
25
0
@@ -6,17 +6,20 @@ class Play extends Base {
0
 
0
   static var url : String;
0
   static var file : String;
0
- static var re : EReg = ~/\/(\w+)\/(\w+)$/;
0
+ static var re : EReg = ~/\/(\w{2}\/\w+)$/;
0
+ static var re2 : EReg = ~/^(\w{2})(\w+)$/;
0
 
0
   static function playRecording(e) {
0
- Base.play(Base.server + "/new.flv");
0
+ Base.play(Base.server + "/" + file + ".flv");
0
   }
0
 
0
   static function main() {
0
     url = ExternalInterface.call("window.location.href.toString");
0
     file = flash.Lib.current.loaderInfo.parameters.file;
0
     if (file == null && re.match(url))
0
- file = re.matched(1) + re.matched(2);
0
- flash.Lib.current.addChild(Base.addLink("Play", playRecording));
0
+ file = re.matched(1);
0
+ else if (re2.match(file))
0
+ file = re2.matched(1) + "/" + re2.matched(2);
0
+ flash.Lib.current.addChild(Base.addLink("chirrp", playRecording));
0
   }
0
 }
0
...
1
2
3
 
4
5
6
...
25
26
27
 
28
29
30
...
70
71
72
 
 
 
 
 
 
 
 
73
74
75
...
81
82
83
 
84
85
86
...
190
191
192
193
 
194
195
196
...
1
2
3
4
5
6
7
...
26
27
28
29
30
31
32
...
72
73
74
75
76
77
78
79
80
81
82
83
84
85
...
91
92
93
94
95
96
97
...
201
202
203
 
204
205
206
207
0
@@ -1,6 +1,7 @@
0
 import flash.display.BitmapData;
0
 import flash.display.MovieClip;
0
 import flash.display.SimpleButton;
0
+import flash.external.ExternalInterface;
0
 import flash.net.NetStream;
0
 import flash.text.TextField;
0
 import flash.text.TextFormat;
0
@@ -25,6 +26,7 @@ class Rec extends Base {
0
   static var seconds : Float = 8;
0
 
0
   static var uuid : String;
0
+ static var user : String;
0
   static var url : String;
0
   static var clock : Timer;
0
   static var start : Float = 0;
0
@@ -70,6 +72,14 @@ class Rec extends Base {
0
     soundsgood.visible = false;
0
   }
0
 
0
+ static function publish(e) {
0
+ var r = new haxe.Http(Base.server + "/publish?id=" + uuid + "&user=" + user);
0
+ r.onData = function(r) {
0
+ ExternalInterface.call("window.location.reload");
0
+ };
0
+ r.request(false);
0
+ }
0
+
0
   static function stopRecording(e) {
0
     Base.stop();
0
     clock.stop();
0
@@ -81,6 +91,7 @@ class Rec extends Base {
0
 
0
   static function main() {
0
     uuid = Base.random(32);
0
+ user = flash.Lib.current.loaderInfo.parameters.user;
0
 
0
     //
0
     // Record button
0
@@ -190,7 +201,7 @@ class Rec extends Base {
0
     soundstxt.height = 50;
0
     soundstxt.setTextFormat(med);
0
 
0
- var okLink = Base.addLink("OK, I am very done!", function(e) {});
0
+ var okLink = Base.addLink("OK, I am very done!", publish);
0
     var noLink = Base.addLink("Nah, record it again.", reRecord);
0
 
0
     soundsgood = new MovieClip();
...
8
9
10
11
 
12
...
8
9
10
 
11
12
0
@@ -8,5 +8,5 @@
0
 
0
 -swf chirplay.swf
0
 -swf-version 9
0
--swf-header 400:40:24:FFFFFF
0
+-swf-header 70:22:24:FFFFFF
0
 -main Play

Comments

    No one has commented yet.