PageRenderTime 39ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/longlho/flowplayer
ActionScript | 52 lines | 32 code | 9 blank | 11 comment | 2 complexity | 2cb6a028d9932f030c34e2b7416a505a 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 org.flowplayer.bwcheck.detect.AbstractDetectionStrategy;
  11. /**
  12. * @author danielr
  13. */
  14. public class BandwidthDetectorOldfms extends AbstractDetectionStrategy {
  15. private var _host:String;
  16. public function set host(host:String):void {
  17. _host = host;
  18. }
  19. public function onBwCheck(... rest):Number {
  20. dispatchStatus(rest);
  21. return 0;
  22. }
  23. public function onBwDone(... rest):void {
  24. if (rest[0] != undefined) {
  25. log.debug("onBWDone() " + rest[0]);
  26. var obj:Object = new Object();
  27. obj.kbitDown = rest[0];
  28. obj.latency = rest[3];
  29. dispatchComplete(obj);
  30. }
  31. }
  32. override public function connect(host:String = null):void {
  33. connection.connect(host, true);
  34. }
  35. override public function detect():void {
  36. log.debug("detect() Using FMS Legacy ");
  37. connection.client = this;
  38. }
  39. public function close(... rest):void {
  40. log.debug("close()");
  41. }
  42. }
  43. }