在iPad上播放youtube使用自定义按钮

时间:2013-05-14 06:51:03

标签: javascript iframe youtube

如果我这样做

<div id="player"> </div>  <--DIV will replaced by Youtube iframe-->
<video id="movie" src="http://www.w3schools.com/tags/movie.mp4"/>
<script>  player = new YT.Player('player',
         .......youtube Iframe APi code </script>
 function play() {
                    player.playVideo();
                }
 function play2() {
                   var movie= document.getElementById("movie");
                   movie.play();
                }

    <script>         
                 document.addEventListener('touchstart', play, false);
                document.addEventListener('click', play, false);
                 document.addEventListener('touchstart', play2, false);
                document.addEventListener('click', play2, false);
    </script>

两个视频在PC浏览器中运行良好,但只能在iPad上播放视频标签。我该如何解决这个问题?

0 个答案:

没有答案