 							",videoWidth:" + _videoWidth +
 							",videoHeight:" + _videoHeight +							
 							"}";
-			
+
 			_element.sendEvent(eventName, values);			
 		}		
 	}
-}
-		
+}
				}
				_timer.start();
				_isPaused = false;
				_isLoaded = true;	
				sendEvent(HtmlMediaEvent.PLAYING);						
			}

		}			
		
		public function pause():void {
			_stream.pause();
			_isPaused = true;
			_timer.stop();			
			
			_isPaused = true;
			sendEvent(HtmlMediaEvent.PAUSED);
		}		
		
		public function setCurrentTime(pos:Number):void {
			_stream.seek(pos);
			sendEvent(HtmlMediaEvent.SEEKED);
		}
				
		public function setVolume(volume:Number):void {
			_soundTransform = new SoundTransform(volume);
			_stream.soundTransform = _soundTransform;
			_volume = volume;
			
			_isMuted = (_volume == 0);
			
			sendEvent(HtmlMediaEvent.VOLUMECHANGE);
		}

		
		public function setMuted(muted:Boolean):void {			
			
			if (_isMuted == muted)
				return;
	
			if (muted) {
				_oldVolume = _stream.soundTransform.volume;
				setVolume(0);
			} else {
				setVolume(_oldVolume);
			}
			
			_isMuted = muted;
		}

		
		private function sendEvent(eventName:String) {
			
			// calculate this to mimic HTML5
			_bufferedTime = _bytesLoaded / _bytesTotal + _duration;			
			
			// build JSON
			var values:String = 
							"{duration:" + _duration + 

﻿package htmlelements
{
	import flash.display.Sprite;
	import flash.events.*;
