<!--
    var _eosTest = false;
	var _viewModeTest = false;

	// NOTE: While the name and arugment lists of the player event handling functions are
	//       hardcoded within the player, the code presented here within the function bodies
	//       is purely for sample and illustrative purposes. Also note that while the end of stream
	//       event notification handler (onVividasEOS()) strictly speaking belongs in this source
	//       module, it's in player_sript.js because it is a key part of the play list implementation

	function onVividasMovieLoadPercentChanged(percent)
	{
		try {
			getRefToDiv("loadPercentDiv").innerHTML = percent + "%";
		}
		catch(exception) {
		}
	}

	function onVividasEvent(eventName, eventData)
	{
		try {
			getRefToDiv("eventDiv").innerHTML = eventName + ", " + eventData
		}
		catch(exception) {
		}
	}

	function onVividasViewModeChanged()
	{
		if(_viewModeTest && getPlayerObject().getFullscreenViewMode() == 0) {
			_viewModeTest = false;
			alert("Notified of return to window mode playback");
		}
	}

	function customEOSHandler()
	{
		if(_eosTest) {
        	_eosTest = false;
            alert("End of Stream Detected");
        }
	}

	var _lastStatus = "idle";
	var _lastRate = 0;
	var _lastFrame = 0;
	var _lastFrameCount = 0;
	var _lastMS = 0;
	var _lastURL = "";
	var _lastBufferLevel = 0;

	function onCheckPlaybackStatus()
	{
		if(getPlayerObject() != null) {
		try {
			var status = "n/a";

			switch(getPlayerObject().getPlaybackStatus()) {
				case -1:
					status = "initialising";
					break;
				case 0:
					status = "idle";
					break;
				case 1:
					status = "playing";
					break;
				case 2:
					status = "paused";
					break;
				case 3:
					status = "buffering";
					break;
				case 4:
					status = "movie loading";
					break;
				case 5:
					status = "unknown";
					break;
				default:
					status = "invalid status value";
					break;
			}

			var rate = getPlayerObject().getFrameRate();
			var frame = getPlayerObject().getCurrentFrame();
			var frameCount = getPlayerObject().getTotalFrames();
			var ms = getPlayerObject().getMSPlayed();
			var url = getPlayerObject().getMediaURL();
			var bufferLevel = getPlayerObject().getBufferLevel();

			// only set the page HTML of a value has actually changed...to minimise CPU overhead
			// that the browser may introduce by redrawing part of the DOM

			if(_lastStatus != status)
				getRefToDiv("statusDiv").innerHTML = status;
			if(_lastRate != rate)
				getRefToDiv("frameRateDiv").innerHTML = rate;
			if(_lastFrame != frame)
				getRefToDiv("currFrameDiv").innerHTML = frame;
			if(_lastFrameCount != frameCount)
				getRefToDiv("totalFramesDiv").innerHTML = frameCount;
			if(_lastMS != ms)
				getRefToDiv("playTimeDiv").innerHTML = ms;
			if(_lastURL != url)
				getRefToDiv("currTrackDiv").innerHTML = url;
			if(_lastBufferLevel != bufferLevel)
				getRefToDiv("bufferPercentDiv").innerHTML = bufferLevel;

			_lastStatus = status;
			_lastRate = rate;
			_lastFrame = frame;
			_lastFrameCount = frameCount;
			_lastMS = ms;
			_lastURL = url;
			_lastBufferLevel = bufferLevel;
		}
		catch(e) {
		}
	}
	}
-->
