Browse Source

added NetStream and NetConnection.

Nicolas Cannasse 19 năm trước cách đây
mục cha
commit
65118a3fb2
4 tập tin đã thay đổi với 50 bổ sung0 xóa
  1. 2 0
      std/flash/Boot.hx
  2. 17 0
      std/flash/NetConnection.hx
  3. 29 0
      std/flash/NetStream.hx
  4. 2 0
      std/haxe/ImportAll.hx

+ 2 - 0
std/flash/Boot.hx

@@ -276,6 +276,8 @@ class Boot {
 			flash.TextSnapshot = _global["TextSnapshot"];
 			flash.Video = _global["Video"];
 			flash.XMLSocket = _global["XMLSocket"];
+			flash.NetConnection = _global["NetConnection"];
+			flash.NetStream = _global["NetStream"];
 
 			Lib._global = _global;
 			Lib._root = _root;

+ 17 - 0
std/flash/NetConnection.hx

@@ -0,0 +1,17 @@
+package flash;
+
+extern class NetConnection implements Dynamic
+{
+	var isConnected : Bool;
+	var uri : String;
+
+	function new() : Void;
+	function connect( targetURI : String) : Bool;
+	function call( remoteMethod : String, resultObject : Dynamic) : Void;
+	function onStatus(infoObject : Dynamic) : Void;
+	function onResult(infoObject : Dynamic) : Void;
+	function addHeader() : Void;
+	function close() : Void;
+}
+
+

+ 29 - 0
std/flash/NetStream.hx

@@ -0,0 +1,29 @@
+package flash;
+
+extern class NetStream
+{
+	var time : Float;
+	var currentFps : Float;
+	var bufferTime : Float;
+	var bufferLength : Float;
+	var liveDelay : Float;
+	var bytesLoaded : Int;
+	var bytesTotal : Int;
+
+	function new( connection : NetConnection ) : Void;
+	function onMetaData( info : Dynamic ) : Void;
+	function onStatus( info : Dynamic ) : Void;
+	function publish( name : Dynamic, type : String ) : Void;
+	function play( name : Dynamic, start : Float, len : Float, reset : Dynamic ) : Void;
+	function receiveAudio( flag : Bool ) : Void;
+	function receiveVideo( flag : Dynamic ) : Void;
+	function pause( flag : Bool ) : Void;
+	function seek( offset : Float ) : Void;
+	function close() : Void;
+	function attachAudio( theMicrophone : Microphone ) : Void;
+	function attachVideo( theCamera : Camera, snapshotMilliseconds : Float ) : Void;
+	function send( handlerName : String ) : Void;
+	function setBufferTime( bufferTime : Float ) : Void;
+}
+
+

+ 2 - 0
std/haxe/ImportAll.hx

@@ -70,6 +70,8 @@ import flash.TextFormat;
 import flash.TextSnapshot;
 import flash.Video;
 import flash.XMLSocket;
+import flash.NetStream;
+import flash.NetConnection;
 
 import flash.text.StyleSheet;
 import flash.system.Capabilities;