热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何将MOV文件加载到Flash9中-HowdoIloadaMOVfileintoFlash9

IamhavingissuesloadinganMOVfileintoFlash9.WhenIgooglethequestion,Igetalotofpeopl

I am having issues loading an MOV file into Flash 9. When I google the question, I get alot of people say sure you can do it, but nobody provides working sample code.

我在将MOV文件加载到Flash 9时遇到问题。当我回答问题时,我会得到很多人说你确定可以做到,但是没有人提供工作示例代码。

2 个解决方案

#1


The following is from http://en.wikipedia.org/wiki/Adobe_Flash#Flash_Video

以下内容来自http://en.wikipedia.org/wiki/Adobe_Flash#Flash_Video

Flash Video

Flash Video (.flv files) is a container format, meaning that it is not a video format in itself, but can contain other formats. The video in Flash is encoded in H.263, and starting with Flash player 8, it may alternatively be encoded in VP6. The audio is in MP3. The use of VP6 is common in many companies, because of the large adoption rates of Flash Player 8 and Flash Player 9.[16]

Flash视频(.flv文件)是一种容器格式,这意味着它本身不是视频格式,但可以包含其他格式。 Flash中的视频以H.263编码,从Flash播放器8开始,它也可以用VP6编码。音频采用MP3格式。由于Flash Player 8和Flash Player 9的采用率很高,因此在许多公司中使用VP6很常见。[16]

On August 20, 2007, Adobe announced on its blog that with Update 3 of Flash Player 9, Flash Video will also support the MPEG-4 international standard.[31] Specifically, Flash Player will have support for video compressed in H.264 (MPEG-4 Part 10), audio compressed using AAC (MPEG-4 Part 3), the MP4, M4V, M4A, 3GP and MOV multimedia container formats (MPEG-4 Part 14), 3GPP Timed Text specification (MPEG-4 Part 17) which is a standardized subtitle format and partial parsing support for the 'ilst' atom which is the ID3 equivalent iTunes uses to store metadata. Adobe also announced that they will be gradually moving away from the proprietary FLV format to the standard MP4 format owing to functional limits with the FLV structure when streaming H.264. The final release of the Flash Player supporting MPEG-4 had become available in Fall 2007.[32]

2007年8月20日,Adobe在其博客上宣布,通过Flash Player 9的Update 3,Flash Video也将支持MPEG-4国际标准。[31]具体来说,Flash Player将支持以H.264(MPEG-4 Part 10)压缩的视频,使用AAC(MPEG-4 Part 3)压缩的音频,MP4,M4V,M4A,3GP和MOV多媒体容器格式(MPEG- 4部分14),3GPP定时文本规范(MPEG-4 Part 17),它是标准化的字幕格式和对'ilst'原子的部分解析支持,它是用于存储元数据的ID3等效物。 Adobe还宣布,由于流式H.264时FLV结构的功能限制,他们将逐渐从专有FLV格式转向标准MP4格式。支持MPEG-4的Flash Player的最终版本已于2007年秋季推出。[32]

package com.yourdomain.packageName
{
    import flash.display.Sprite;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;

    public class DocumentClass extends Sprite
    {
        private var _video:Video;
        private var _nc:NetConnection;
        private var _ns:NetStream;

        public function DocumentClass():void
        {
            _video = new Video(800, 600);
            addChild(_video);

            _nc = new NetConnection();
            _nc.connect(null);

            _ns = new NetStream(nc);
            _video.attachNetStream(_ns);
           _ns.play("path/to/file.extension");
        }
    }
}

-This is a very basic implementation and does not include handling of meta-data.

- 这是一个非常基本的实现,不包括元数据的处理。

First, we instantiate a Video object that is 800 wide and 600 tall and add it to the display list.

首先,我们实例化一个800宽600高的视频对象,并将其添加到显示列表中。

Second, we instantiate a NetConnection object and call it's connect method passing null as a parameter. (This is required)

其次,我们实例化一个NetConnection对象并调用它的connect方法,将null作为参数传递。 (这是必需的)

Third, we create a NetStream object, passing the previously made NetConnection object to it's constructor.

第三,我们创建一个NetStream对象,将先前创建的NetConnection对象传递给它的构造函数。

Fourth, we set attachNetStream of the Video object to _ns, the NetStream we instantiated.

第四,我们将Video对象的attachNetStream设置为_ns,即我们实例化的NetStream。

Finally, we call the play method of the NetStream object, _ns, and pass it a string to where our media is located. (The FLV/F4V/MOV/etc.)

最后,我们调用NetStream对象的play方法_ns,并将字符串传递给我们的媒体所在的位置。 (FLV / F4V / MOV /等)

Hope this helps.

希望这可以帮助。

#2


Same as with any FLV, using NetStream (I don't recommend it, it's very hard to handle) or any AS3 video playback component you can find, like FLVPlayback, etc... as long as you target FP 9.0.115.0, and the file is encoded in h264 and in a MPEG-4 container like mov, mp4, f4v, etc...

与任何FLV相同,使用NetStream(我不推荐它,它很难处理)或任何你可以找到的AS3视频播放组件,如FLVPlayback等...只要你的目标FP 9.0.115.0,和该文件在h264和MPEG-4容器中编码,如mov,mp4,f4v等...


推荐阅读
  • 基于Socket的多个客户端之间的聊天功能实现方法
    本文介绍了基于Socket的多个客户端之间实现聊天功能的方法,包括服务器端的实现和客户端的实现。服务器端通过每个用户的输出流向特定用户发送消息,而客户端通过输入流接收消息。同时,还介绍了相关的实体类和Socket的基本概念。 ... [详细]
  • IhaveconfiguredanactionforaremotenotificationwhenitarrivestomyiOsapp.Iwanttwodiff ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • Android系统源码分析Zygote和SystemServer启动过程详解
    本文详细解析了Android系统源码中Zygote和SystemServer的启动过程。首先介绍了系统framework层启动的内容,帮助理解四大组件的启动和管理过程。接着介绍了AMS、PMS等系统服务的作用和调用方式。然后详细分析了Zygote的启动过程,解释了Zygote在Android启动过程中的决定作用。最后通过时序图展示了整个过程。 ... [详细]
  • 本文整理了Java中java.lang.NoSuchMethodError.getMessage()方法的一些代码示例,展示了NoSuchMethodErr ... [详细]
  • 本文介绍了关于Java异常的八大常见问题,包括异常管理的最佳做法、在try块中定义的变量不能用于catch或finally的原因以及为什么Double.parseDouble(null)和Integer.parseInt(null)会抛出不同的异常。同时指出这些问题是由于不同的开发人员开发所导致的,不值得过多思考。 ... [详细]
  • 本文介绍了Python高级网络编程及TCP/IP协议簇的OSI七层模型。首先简单介绍了七层模型的各层及其封装解封装过程。然后讨论了程序开发中涉及到的网络通信内容,主要包括TCP协议、UDP协议和IPV4协议。最后还介绍了socket编程、聊天socket实现、远程执行命令、上传文件、socketserver及其源码分析等相关内容。 ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • 解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法
    本文介绍了解决nginx启动报错epoll_wait() reported that client prematurely closed connection的方法,包括检查location配置是否正确、pass_proxy是否需要加“/”等。同时,还介绍了修改nginx的error.log日志级别为debug,以便查看详细日志信息。 ... [详细]
  • 本文介绍了Swing组件的用法,重点讲解了图标接口的定义和创建方法。图标接口用来将图标与各种组件相关联,可以是简单的绘画或使用磁盘上的GIF格式图像。文章详细介绍了图标接口的属性和绘制方法,并给出了一个菱形图标的实现示例。该示例可以配置图标的尺寸、颜色和填充状态。 ... [详细]
  • 纠正网上的错误:自定义一个类叫java.lang.System/String的方法
    本文纠正了网上关于自定义一个类叫java.lang.System/String的错误答案,并详细解释了为什么这种方法是错误的。作者指出,虽然双亲委托机制确实可以阻止自定义的System类被加载,但通过自定义一个特殊的类加载器,可以绕过双亲委托机制,达到自定义System类的目的。作者呼吁读者对网上的内容持怀疑态度,并带着问题来阅读文章。 ... [详细]
  • ***byte(字节)根据长度转成kb(千字节)和mb(兆字节)**parambytes*return*publicstaticStringbytes2kb(longbytes){ ... [详细]
  • 设计模式——模板方法模式的应用和优缺点
    本文介绍了设计模式中的模板方法模式,包括其定义、应用、优点、缺点和使用场景。模板方法模式是一种基于继承的代码复用技术,通过将复杂流程的实现步骤封装在基本方法中,并在抽象父类中定义模板方法的执行次序,子类可以覆盖某些步骤,实现相同的算法框架的不同功能。该模式在软件开发中具有广泛的应用价值。 ... [详细]
  • 本文介绍了在Cpp中将字符串形式的数值转换为int或float等数值类型的方法,主要使用了strtol、strtod和strtoul函数。这些函数可以将以null结尾的字符串转换为long int、double或unsigned long类型的数值,且支持任意进制的字符串转换。相比之下,atoi函数只能转换十进制数值且没有错误返回。 ... [详细]
  • ejava,刘聪dejava
    本文目录一览:1、什么是Java?2、java ... [详细]
author-avatar
八卦男1002_426
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有