Changeset 0f973c08b964db1275e3a7379cd46660a974b7dd
- Timestamp:
- 03/06/11 17:09:37 (15 months ago)
- Author:
- Robin Gareus <robin@…>
- Parents:
- 87c08fa30db304b89c0e17a2c94909af0474fc0e
- Children:
- 6bb14a37382b8ebb9192f9d82432a2e03b67b558
- git-committer:
- Robin Gareus <robin@gareus.org> / 2011-03-06T18:09:37Z+0100
- Message:
-
sansarmes: notify, AVauth etc
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r87c08fa
|
r0f973c0
|
|
| 5 | 5 | layout="vertical" |
| 6 | 6 | verticalAlign="middle" |
| 7 | | backgroundColor="#dddddd" |
| | 7 | backgroundColor="#d0d0d0" |
| 8 | 8 | creationComplete="onAppInit()" > |
| 9 | 9 | |
| … |
… |
|
| 13 | 13 | fault="onPubFault(event)" |
| 14 | 14 | concurrency="single" |
| 15 | | method="GET" /> |
| | 15 | method="POST" /> |
| 16 | 16 | |
| 17 | 17 | <mx:Script> |
| … |
… |
|
| 33 | 33 | private var cam:Camera; |
| 34 | 34 | private var mic:Microphone; |
| | 35 | private var avallowed:Boolean |
| 35 | 36 | |
| 36 | 37 | private var server:String; |
| … |
… |
|
| 60 | 61 | password="f78b64c9e0f2ea24fddce2b0d809cb2855fed1a6"; |
| 61 | 62 | uploadName=null; |
| | 63 | avallowed=false; |
| 62 | 64 | |
| 63 | 65 | br.enabled=false; |
| … |
… |
|
| 68 | 70 | cam = Camera.getCamera(); |
| 69 | 71 | mic = Microphone.getMicrophone(); |
| | 72 | |
| | 73 | Security.showSettings("2"); |
| | 74 | mic.addEventListener(StatusEvent.STATUS, this.onAvStatus); |
| | 75 | |
| 70 | 76 | if (!cam || !mic) { |
| 71 | | bc.enabled=false; |
| 72 | | ta.enabled=false; |
| 73 | | te.enabled=false; |
| 74 | | tt.enabled=false; |
| 75 | | Alert.show('You do need a camera for live streaming.\nPlease connect one and then reload this Page.', |
| 76 | | 'No camera detected', mx.controls.Alert.OK); // XXX translate |
| | 77 | avdeny(); |
| 77 | 78 | return; |
| 78 | 79 | } |
| … |
… |
|
| 81 | 82 | mic.setSilenceLevel(0,2500); |
| 82 | 83 | mic.gain=80; |
| | 84 | mic.setUseEchoSuppression(true); |
| 83 | 85 | |
| 84 | 86 | cam.setMode(640,480,25); |
| … |
… |
|
| 98 | 100 | myVu.graphics.clear(); |
| 99 | 101 | vucanvas.rawChildren.addChild(myVu); |
| | 102 | } |
| | 103 | |
| | 104 | private function onAvStatus(event:StatusEvent):void { |
| | 105 | if (event.code == "Microphone.Muted"){ |
| | 106 | avdeny(); |
| | 107 | } else { |
| | 108 | avallowed=true; |
| | 109 | } |
| | 110 | } |
| | 111 | |
| | 112 | private function avdeny():void { |
| | 113 | bc.enabled=false; |
| | 114 | ta.enabled=false; |
| | 115 | te.enabled=false; |
| | 116 | tt.enabled=false; |
| | 117 | br.enabled=false; |
| | 118 | bp.enabled=false; |
| | 119 | bu.enabled=false; |
| | 120 | Alert.show('You do need a camera for live streaming.\nPlease connect one and then reload this Page.', |
| | 121 | 'No camera detected', mx.controls.Alert.OK); // XXX translate |
| 100 | 122 | } |
| 101 | 123 | |
| … |
… |
|
| 173 | 195 | conn.client = this; |
| 174 | 196 | conn.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler); |
| 175 | | conn.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); |
| | 197 | conn.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); |
| 176 | 198 | conn.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); |
| 177 | 199 | conn.connect(server,username,password,uploadName); |
| … |
… |
|
| 299 | 321 | |
| 300 | 322 | private function license_choise(eventObj:CloseEvent):void { |
| | 323 | var notify:int=cbNotify.selected?1:0; |
| 301 | 324 | if (eventObj.detail==Alert.YES) { |
| 302 | | service.send({file:uploadName}); |
| | 325 | service.send({notify:notify, file:uploadName}); |
| 303 | 326 | } |
| 304 | 327 | } |
| … |
… |
|
| 346 | 369 | } |
| 347 | 370 | .footer { |
| 348 | | font-size: 8; |
| | 371 | font-size: 7; |
| 349 | 372 | textAlign: right; |
| 350 | 373 | color: #f0fff0; |
| … |
… |
|
| 368 | 391 | |
| 369 | 392 | <mx:Box direction="horizontal" width="100%"> |
| 370 | | <mx:VBox width="388" height="420"> |
| | 393 | <mx:VBox width="388" height="440"> |
| 371 | 394 | <mx:Text width="370"> |
| 372 | 395 | <mx:htmlText> |
| … |
… |
|
| 414 | 437 | </mx:VBox> |
| 415 | 438 | |
| 416 | | <mx:VBox height="420"> |
| | 439 | <mx:VBox height="440"> |
| 417 | 440 | <mx:VideoDisplay id="video" width="340" height="240" /> |
| 418 | 441 | <mx:ProgressBar width="340" mode="manual" label="%3%%" labelPlacement="center" visible="false" id="soundProgress"/> |
| … |
… |
|
| 435 | 458 | </mx:htmlText> |
| 436 | 459 | </mx:Text> |
| | 460 | <mx:CheckBox id="cbNotify" width="340" label="Informez-moi par e-mail quand la vidéo est publiée." selected="false"/> |
| 437 | 461 | <mx:Button id="bu" click="ask_license()" label="publier"/> |
| 438 | 462 | </mx:VBox> |