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();
      }

  • 相关阅读:
    JVM参数设置-jdk8参数设置
    JVM参数配置详解-包含JDK1.8
    IntelliJ Idea 常用快捷键列表
    架构组织形式的讨论,以及架构师之路的建议
    ElasticSearch-6.3.2 linux 安装
    CAT 安装运行配置教程
    JPMML解析PMML模型并导入数据进行分析生成结果
    第9章 多态和抽象
    第10章 接口
    第8章 类的高级概念
  • 原文地址:https://www.cnblogs.com/mimengjiangnan/p/2953696.html
Copyright © 2011-2022 走看看