开发者

I am trying to play .m4a file using stream method. but its not working [closed]

开发者 https://www.devze.com 2023-03-23 09:59 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.
开发者_如何学运维var video:Video = new Video();
addChild(video);
var netCon:NetConnection = new NetConnection();
netCon.connect(null);
var streamNS:NetStream = new NetStream(netCon);
//streamNS.client = this;
//video.attachNetStream(streamNS);
streamNS.play("AfricanElengwen.m4a");
streamNS.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

function netStatusHandler(e:NetStatusEvent):void
{
    if (e.info.code == "NetStream.Play.FileStructureInvalid")
    {
        trace("The MP4's file structure is invalid.");
    } else if (e.info.code == "NetStream.Play.NoSupportedTrackFound")
    {
        trace("The MP4 doesn't contain any supported tracks");
    }
}

I get this code from the below link, http://www.adobe.com/devnet/flashplayer/articles/hd_video_flash_player.html#articlecontentAdobe_numberedheader_0

I didn't get any error. Can anyone say what is the bug?


May be your .m4a file bit rate or something unsupportable to the flash player. Better way is u can convert it into a mp3 file and then use it.


I just went through similar issues with the NetStream.Play.FileStructureInvalid error, and after a couple hours of digging around it turns out that this seems to happen in Firefox (PC/Mac) if the server is gzipping the content prior to delivery. In Safari (Mac) and few other browsers, it worked fine.

Using the Live HTTP Headers add-on in Firefox showed that the content-length wasn't being sent along with the response, and I was reminded that it was also being gzipped -- something I didn't consider to be a possible issue.

A quick hack to a local .htaccess file proved gzip to be the culprit. After disabling it, it all worked fine:

SetEnv no-gzip dont-vary

We went back to the Apache config and removed the compression from .mp4 files to do it the right way (removing my earlier hack to the .htaccess), and all works well!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号