PageRenderTime 120ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/plugins/bwcheck/src/actionscript/org/flowplayer/bwcheck/detect/BandwidthDetectorRed5.as

https://github.com/longlho/flowplayer
ActionScript | 47 lines | 26 code | 10 blank | 11 comment | 1 complexity | 7e72a905932493c892dfbb9c66284745 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause
  1. /*
  2. * This file is part of Flowplayer, http://flowplayer.org
  3. *
  4. * By: Daniel Rossi, <electroteque@gmail.com>, Anssi Piirainen Flowplayer Oy
  5. * Copyright (c) 2008-2011 Flowplayer Oy *
  6. * Released under the MIT License:
  7. * http://www.opensource.org/licenses/mit-license.php
  8. */
  9. package org.flowplayer.bwcheck.detect {
  10. import flash.net.Responder;
  11. import org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
  12. /**
  13. * @author danielr
  14. */
  15. public class BandwidthDetectorRed5 extends AbstractDetectionStrategy {
  16. private var info:Object = new Object();
  17. public function BandwidthDetectorRed5() {
  18. _service = "bwCheckService.onServerClientBWCheck";
  19. }
  20. public function onBWCheck(obj:Object):void {
  21. dispatchStatus(obj);
  22. }
  23. public function onBWDone(obj:Object):void {
  24. dispatchComplete(obj);
  25. }
  26. override public function connect(host:String = null):void {
  27. connection.connect(host);
  28. }
  29. protected function onStatus(obj:Object):void {
  30. switch (obj.code) {
  31. case "NetConnection.Call.Failed":
  32. dispatchFailed(obj);
  33. break;
  34. }
  35. }
  36. }
  37. }