작동하지? 그 다음 난 그냥 검은 화면을 얻을, 재생 시작할 것처럼 Fancybox YouTube는 어떤 아이디어 왜, 내가 공식 Fancybox 유튜브 구현 JSfiddle는 iOS에서 작동하지 않는 것을 알 아이 패드 또는 아이폰
http://jsfiddle.net/M78zz/show/
// Fires whenever a player has finished loading
function onPlayerReady(event) {
event.target.playVideo();
}
// Fires when the player's state changes.
function onPlayerStateChange(event) {
// Go to the next video after the current one is finished playing
if (event.data === 0) {
$.fancybox.next();
}
}
// The API will call this function when the page has finished downloading the JavaScript for the player API
function onYouTubePlayerAPIReady() {
// Initialise the fancyBox after the DOM is loaded
$(document).ready(function() {
$(".fancybox")
.attr('rel', 'gallery')
.fancybox({
openEffect : 'none',
closeEffect : 'none',
nextEffect : 'none',
prevEffect : 'none',
padding : 0,
margin : 50,
beforeShow : function() {
// Find the iframe ID
var id = $.fancybox.inner.find('iframe').attr('id');
// Create video player object and add event listeners
var player = new YT.Player(id, {
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
});
});
}
fancybox가 열립니다
, 다음, 유튜브 비디오 부하 및 보인다. 이것은 iPhone과 iPad 모두에서 발생합니다.아무도 도와 줄 수 있습니까?
[Fancybox - 비디오 자동 닫기 기능]의 중복 가능성 (http://stackoverflow.com/questions/20855414/fancybox-video-auto-close-function) – JFK
귀하의 의견을 바탕으로, 내가 그랬어 특히, iOS에서 유튜브가'event.target.playVideo()을 좋아하지 않는 것 http://stackoverflow.com/a/20863405/1055987 이유를 설명 내 대답에 편집,'비디오가로 변환되기 전에 실행되는 HTML5 형식 – JFK