Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function playVideo():void {
- var nc:NetConnection = new NetConnection();
- nc.connect(null);
- var ns:NetStream = new NetStream(nc);
- # onMetaData listener is required otherwise you get a ReferenceError
- var client:Object = new Object();
- client.onMetaData = function(metadata:Object):void {
- trace(metadata.duration);
- }
- ns.client = client;
- var v:Video = new Video();
- v.attachNetStream(ns);
- stage.addChild(v);
- var f:File = new File("/tmp/test.flv");
- ns.play(f.url);
- }
- <?xml version="1.0" encoding="utf-8"?>
- <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
- <mx:VideoDisplay source="D:DataProjectsFlex 3AirLocalVideobin-debugNightSky.flv" />
- </mx:WindowedApplication>
- <?xml version="1.0" encoding="utf-8"?>
- <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
- <mx:VideoDisplay source="file://D:/Data/Projects/Flex 3/AirLocalVideo/bin-debug/NightSky.flv" />
- </mx:WindowedApplication>
Add Comment
Please, Sign In to add comment