我有一个播放多个视频文件的Flash Builder 4.6程序。每个视频播放后,我想发布它。如果我使用Process Explorer,我仍然可以看到视频在播放完毕后没有发布。此应用程序用于培训,一个会话可能有超过40个视频和大约1,800人观看一天。
我有以下内容来创建和销毁播放器。
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();
为什么文件没有发布?
答案 0 :(得分:0)
好的,这是我在PlayStateChange中所做的,停止,释放文件。
hostVideo.removeMediaElement(hmpe);
hostVideo = new MediaContainer();
hmpe = null;
hmp.media = null;
hmp = new MediaPlayer();