Flash Player Cache problem

我的未来我决定 提交于 2020-01-06 15:15:26

问题


I made a flash video jukebox, so it reads a dynamic playlist of F4V files for hours. Everything works well but after about 45 min the sound stops and after 2 hours the flash player plug in crashes. It seems like the cache is not accepting more F4V videos and then crashes. If I auto-refresh the browser every 2 hours it works but I would like to avoid having to refresh the browser and just clear the flash player cache if that's where the F4V go? I can't find any info about where the F4V files go when you play them!

Edit

Frame 1 gives the variable vidReference the value of the video file name:

VidReference = trackToPlay;

Frame 2 does the playing:
var nc:NetConnection = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
const buffer_time:Number = 2;
ns.bufferTime = buffer_time;
ns.client = this;
ns.play(VidReference);
var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);
vid_frame.addChild(vid);

This is the function that detects when video is done playing, still on frame 2:

function netStatusHandler(event:NetStatusEvent):void
{
switch (event.info.code)
{
case "NetStream.Play.StreamNotFound": newTrack();
break;
case "NetStream.Play.Stop": newTrack();
break;
}
}

And the function newTrack() is just giving the variable trackToPlay a value (the file name of the next video). And then says to gotoAndPlay frame 1, so it kind of reinitializing the player. The objects are re declared in frame 2, is that the problem here?

David


回答1:


sounds like it's running out of memory. are you clearing out the old f4v's so that you're never just continuously requesting memory?

try profiling it, or use something like http://jpauclair.net/flashpreloadprofiler/

for help tracking memory problems, check out http://divillysausages.com/blog/tracking_memory_leaks_in_as3 (shameless self promotion)




回答2:


Its not a cache issue. Cache is allocated space on your hard drive so if that is not full you will not have an issue.
It sounds move like you are not garbage collecting and not reusing the video object properly. Post some code so we can fix it



来源:https://stackoverflow.com/questions/5652427/flash-player-cache-problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!