Показать сообщение отдельно
  #12 (permalink)  
Старый 03.05.2012, 18:40
sinistral
Посмотреть профиль Найти все сообщения от melky
 
Регистрация: 28.03.2011
Сообщений: 5,418

Сообщение от swa Посмотреть сообщение
if (player.getPlayerState()==5 || player.getPlayerState()==1) {
//		alert('player.getPlayerState()='+player.getPlayerState());
		alert('$("#duration").val('+player.getDuration()+')');
		var time = player.getDuration();
		$("#duration").val(time);
	};
https://developers.google.com/youtube/js_api_reference
Цитата:
player.getDuration():Number
Returns the duration in seconds of the currently playing video. Note that getDuration() will return 0 until the video's metadata is loaded, which normally happens just after the video starts playing.

If the currently playing video is a live event, the getDuration() function will return the elapsed time since the live video stream began. Specifically, this is the amount of time that the video has streamed without being reset or interrupted. In addition, this duration is commonly longer than the actual event time since streaming may begin before the event's start time.
вы мануалы то читали, прежде чем браться?
Ответить с цитированием