flex播发本地视频文件

    技术2025-11-13  10

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"                xmlns:s="library://ns.adobe.com/flex/spark"                xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" applicationComplete="init()">     <fx:Declarations>         <!-- 将非可视元素(例如服务、值对象)放在此处 -->     </fx:Declarations>     <fx:Script>         <![CDATA[             public function init():void             {                 var nc:NetConnection=new NetConnection();                 nc.connect(null);                 var ns:NetStream=new NetStream(nc);                 var client:Object=new Object();                 client.onMetaData=function(metadata:Object):void                 {                     trace(metadata.duration);                 }                 ns.client=client;                 var video:Video=new Video();                 video.attachNetStream(ns);                 stage.addChild(video);                 ns.play("file:///c:/DarkKnight.flv");                             }         ]]>     </fx:Script>     </s:Application>

    最新回复(0)