zoukankan      html  css  js  c++  java
  • AS3无缝循环播放FLV

     import flash.events.NetStatusEvent;
     import flash.media.Video;
     import flash.net.NetConnection;
     import flash.net.NetStream;


      private var myNc:NetConnection;
      private var client:Object;
      private var videoStream:NetStream;
      private var video:Video;
      private var videoURL:String;

        myNc = new NetConnection();
        myNc.connect(null);
        client = new Object();
        videoStream =new NetStream(myNc);
       
        video = new Video();
        video.width = 350;
        video.height = 200;
        video.x = 665;
        video.y = 190;
        sprite.addChild(video);
        video.attachNetStream(videoStream);
        videoStream.play(videoURL);
        videoStream.client=client;
       
        videoStream.addEventListener(NetStatusEvent.NET_STATUS,netStatusHandler);

     private function netStatusHandler(event:NetStatusEvent):void
      { 
       switch (event.info.code) 
       {  
        case "NetConnection.Connect.Success" :   
         connectStream();   
         break;  
        case "NetStream.Play.StreamNotFound" :   
         trace("Unable to locate video: " + videoURL);   
         break;  
        case "NetStream.Buffer.Full" :   
         break;  
        case  "NetStream.Play.Stop" :
         connectStream();
         break; 
       }
      }
      
      private function connectStream():void
      {
       videoStream.pause();
       videoStream.seek(0);
       videoStream.resume();
      }

  • 相关阅读:
    bzoj 3155: Preprefix sum
    bzoj 1854: [Scoi2010]游戏
    UVA1608 不无聊的序列 Non-boring sequences
    UVA1747 【Swap Space】
    Luogu P5550 Chino的数列
    bzoj 1799: [Ahoi2009]self 同类分布
    bzoj 1054: [HAOI2008]移动玩具
    MATLAB工具箱,应用程序,软件和资源的精选清单
    论文格式排版Issue及解决办法
    《将博客搬至CSDN》
  • 原文地址:https://www.cnblogs.com/mimengjiangnan/p/2953696.html
Copyright © 2011-2022 走看看