Created
March 26, 2010 12:05
-
-
Save dagi3d/344809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OUTPUT: | |
* NetConnection.Connect.Success | |
* Error opening URL 'http://video-origin.hola.com/cine/no-existe.flv' | |
* NetStream.Play.StreamNotFound | |
*/ | |
import com.akamai.net.*; | |
import org.openvideoplayer.events.*; | |
var video:Video = new Video(); | |
video.width = 400; | |
video.height = 300; | |
addChild(video); | |
var host:String = null; | |
var stream:String = "http://video-origin.hola.com/cine/no-existe.flv"; | |
var nc:NetConnection = new NetConnection(); | |
nc.client = this; | |
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
nc.connect(host); | |
var ns:NetStream; | |
function netStatusHandler(e:NetStatusEvent):void { | |
trace(e.info.code); | |
switch(e.info.code) { | |
case "NetConnection.Connect.Success": | |
ns = new NetStream(nc); | |
video.attachNetStream(ns); | |
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
ns.client = this; | |
ns.play(stream); | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OUTPUT: | |
* NetConnection.Connect.Success | |
* NetStream.Play.Reset | |
* NetStream.Play.Start | |
*/ | |
import com.akamai.net.*; | |
import org.openvideoplayer.events.*; | |
var video:Video = new Video(); | |
video.width = 400; | |
video.height = 300; | |
addChild(video); | |
var host:String = "rtmp://cp74777.edgefcs.net/ondemand"; | |
var stream:String = "ESTE-STREAM-NO-EXISTE"; | |
var nc:NetConnection = new NetConnection(); | |
nc.client = this; | |
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
nc.connect(host); | |
var ns:NetStream; | |
function netStatusHandler(e:NetStatusEvent):void { | |
trace("flash: " + e.info.code); | |
switch(e.info.code) { | |
case "NetConnection.Connect.Success": | |
ns = new NetStream(nc); | |
video.attachNetStream(ns); | |
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
ns.client = this; | |
ns.play(stream); | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OUTPUT: | |
* NetConnection.Connect.Success | |
* NetStream.Play.Start | |
* NetStream.Buffer.Full | |
*/ | |
import com.akamai.net.*; | |
import org.openvideoplayer.events.*; | |
var video:Video = new Video(); | |
video.width = 400; | |
video.height = 300; | |
addChild(video); | |
var host:String = "rtmp://cp74777.edgefcs.net/ondemand"; | |
var stream:String = "/hola/cine/video/2009/11/13/471/6WAxRkgO6i"; | |
var nc:NetConnection = new NetConnection(); | |
nc.client = this; | |
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
nc.connect(host); | |
var ns:NetStream; | |
function netStatusHandler(e:NetStatusEvent):void { | |
trace(e.info.code); | |
switch(e.info.code) { | |
case "NetConnection.Connect.Success": | |
ns = new NetStream(nc); | |
video.attachNetStream(ns); | |
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
ns.client = this; | |
ns.play(stream); | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OUTPUT: | |
* NetConnection.Connect.Success | |
* NetStream.Play.Reset | |
* NetStream.Play.Start | |
*/ | |
import com.akamai.net.*; | |
import org.openvideoplayer.events.*; | |
var video:Video = new Video(); | |
video.width = 400; | |
video.height = 300; | |
addChild(video); | |
var host:String = "cp74777.edgefcs.net/ondemand"; | |
//var stream:String = "/hola/cine/video/2009/11/13/471/6WAxRkgO6i"; | |
var stream:String = "stream-que-no-existe"; | |
var nc:AkamaiConnection = new AkamaiConnection(); | |
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
nc.connect(host); | |
var ns:AkamaiDynamicNetStream; | |
function netStatusHandler(e:NetStatusEvent):void { | |
trace(e.info.code); | |
switch(e.info.code) { | |
case "NetConnection.Connect.Success": | |
ns = new AkamaiDynamicNetStream(nc); | |
video.attachNetStream(ns); | |
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); | |
ns.play(stream); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment