0
기본적으로 모바일 브라우저에서 사용하기 위해 비디오를로드하는 아주 작은 페이지가 있습니다. 최신 iOS (5.1.1)에서는 동영상 플레이어가로드되지만 회전 만합니다. 동영상을 클릭하면 동영상을 재생할 수 있지만 동영상이 계속로드되는 것처럼 보일 수 있으므로 사람들은 그렇게하지 않을 수 있습니다. 다른 모든 곳에서 작동합니다.iOS Safari에 내장 된 YouTube 만 스핀합니다
내가 유튜브 API 코드
이 사용하고 페이지의 테스트 버전입니다. http://bit.ly/S2KuN1
이 여기에 코드입니다 :
<!DOCTYPE HTML>
<html>
<head>
<title>Celebrity's Caribbean Shore Excursions</title>
<link href="http://www.celebritycruises.com/css/min/global.min.css" rel="stylesheet">
<link href="http://media.celebritycruises.com/celebrity/content/en_US/css/m_video.css" rel="stylesheet">
<script language="JavaScript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.youtube.com/player_api"></script>
<script type="text/javascript">
// create youtube player
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
videoId: 'PH-m591p4xg',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
</script>
<script type="text/javascript" src="m_video.js"></script>
</head>
<body id="video_page">
<div class="logo"><a href="http://m.celebritycruises.com/m/home.do"><img src="http://media.celebritycruises.com/celebrity/content/en_US/images/cel_misc/logo.jpg" alt="Celebrity Mobile" width="259" height="55" border="0"></a></div>
<div id="player"></div>
<div class="visit">
<p>Now visit Celebrity Cruises' official mobile website.</p>
<p><a class="ccButton large" target="_self" href="http://m.celebritycruises.com/m/home.do"> <span class="text">Explore</span> <span class="pointer"> </span> </a></p>
</div>
</body>
</html>
그리고 여기
// 자바 스크립트 문서
// autoplay video
function onPlayerReady(event) {
event.target.pauseVideo();
}
// when video ends
function onPlayerStateChange(event) {
if(event.data === 0) {
window.location = "http://m.celebritycruises.com/m/home.do";
}
}
//style Blackberry
window.onload = function() {
var ua = navigator.userAgent;
if (ua.indexOf("BlackBerry") != -1) {
document.getElementById("video_page").className = "bb";
}
};