Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Flex应用程序在播放后不释放视频_Actionscript 3_Apache Flex_Actionscript_Red5 - Fatal编程技术网

Actionscript 3 Flex应用程序在播放后不释放视频

Actionscript 3 Flex应用程序在播放后不释放视频,actionscript-3,apache-flex,actionscript,red5,Actionscript 3,Apache Flex,Actionscript,Red5,我有一个Flash Builder 4.6程序,可以播放多个视频文件。每次视频播放后,我都想发布它。如果我使用Process Explorer,我仍然可以看到视频在播放完毕后没有发布。此应用程序用于培训,一节课可能有40多个视频,每天约有1800人观看 我有以下创建和销毁玩家 hmpe = new VideoElement(new URLResource(src)); hostVideo.addMediaElement(hmpe); hmp = new MediaPlayer(); hmp.pl

我有一个Flash Builder 4.6程序,可以播放多个视频文件。每次视频播放后,我都想发布它。如果我使用Process Explorer,我仍然可以看到视频在播放完毕后没有发布。此应用程序用于培训,一节课可能有40多个视频,每天约有1800人观看

我有以下创建和销毁玩家

hmpe = new VideoElement(new URLResource(src));
hostVideo.addMediaElement(hmpe);
hmp = new MediaPlayer();
hmp.play();
hmp.addEventListener(MediaPlayerStateChangeEvent.MEDIA_PLAYER_STATE_CHANGE,MediaPlayerStateChange);
hmp.addEventListener(PlayEvent.PLAY_STATE_CHANGE, PlayStateChange);
hmp.addEventListener(TimeEvent.CURRENT_TIME_CHANGE, onTimeChange);
hmp.addEventListener(TimeEvent.COMPLETE,onTimeChange);
hmp.media = hmpe;

...
// To remove when stop is reached in PlayStateChange

hostVideo.removeMediaElement(hmpe);
hmpe = null;
hmp = new MediaPlayer();

为什么文件没有发布?

好的,下面是我在PlayStateChange中所做的更改,停止,以发布文件

                        hostVideo.removeMediaElement(hmpe);
                        hostVideo = new MediaContainer();
                        hmpe = null;
                        hmp.media = null;
                        hmp = new MediaPlayer();

我假设这会导致NetStream关闭,从而清除服务器端的视频对象。