flex通过JS播放wma语音的问题

flex通过ExternalInterface.call("playOfEventWav", wavUrl);调用JS方法进行播放语音,但是内存一直在增长,经过搜索,调试发现,在JS播放之前,必须先把之间的音频停止掉,然后再重新给播放URL,手调用play方法:代码如下:

<javascript>

JS相关代码
<script>
       function playOfEventWav (wavUrl)
	{
		if(Player.URL)
		{
			//alert(wavUrl);
			Player.controls.stop();
		}
	    Player.URL = wavUrl;
	    Player.controls.play();
	}
	
	function playCurrentPosition() {
		
		return Player.controls.currentPosition;
	}
	
	function getPlayerState()
	{
		return Player.playState;
	}
	
	function stopPlayer()
	{
		Player.controls.stop();
		Player.URL = null;
	}
</script>

 </javascript>

 

<OBJECT ID="Player" height="0" width="0"

  CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">

  <param name=”AutoStart” value=”-1″>

</OBJECT>

 

你可能感兴趣的:(JavaScript,Flex)