// This method is called from the onYouTubePlayerReady method inside htmlAssets/js/youTubeLoader.js
function secondaryOnYouTubePlayerReady(playerId) {
	ytplayer = document.getElementById(SWFID);
	setInterval(updateytplayerInfo, 250);
	updateytplayerInfo();
	ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}

// This method is called from the onytplayerStateChange method inside htmlAssets/js/youTubeLoader.js
function secondaryOnytplayerStateChange(newState) {
	setytplayerState(newState);
}

function updateytplayerInfo() {
	getFlexApp().updateVideoProgress(getCurrentTime(), getDuration());
}

function unloadVideo () {
	stop();
	clearVideo();
}