如何在ipad上控制苹果视频播放器(嵌入iframe和html5 vimeo解决方案的视频) [英] how to control apple video player on ipad (video embeded with iframe and html5 vimeo solution)

查看:176
本文介绍了如何在ipad上控制苹果视频播放器(嵌入iframe和html5 vimeo解决方案的视频)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用vimeo html5嵌入式解决方案嵌入了一个视频。我可以在ipad上播放视频。我想

I embeded a video with vimeo html5 embeding solution. I can play the video on ipad. I would like to

隐藏播放器并在点击链接时暂停视频

在点击链接时卸载视频;然后在点击其他链接时重新加载视频

hide the player and pause the video when clicking on a link or unload the video when clicking on a link; then reload the video when clicking on another link


  1. 我尝试使用苹果javascript解决方案暂停:

http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/ControllingMediaWithJavaScript/ControllingMediaWithJavaScript.html

function playPause() {
   var myVideo = document.getElementsByTagName('video')[0];
   if (myVideo.paused)
       myVideo.play();
   else
       myVideo.pause();
   }

但似乎我必须在同一个域上调用视频操作和/或没有iframe

but it seems i have to call video actions on the same domain and/or without iframe

2.我尝试了第一个按钮

2.I tried for the first button

$('#video').fadeOut(400);

和第二个

$('#video1').fadeIn(400);

它隐藏+卸载然后显示+在firefox,chrome等上重新加载视频...但是在ipad它隐藏了没有卸载然后没有在fadeIn动作中显示玩家...

it's hidding+unloading then showing+reloading the video on firefox, chrome, etc... but on ipad it's hidding without unloading and then not showing back the player on fadeIn action...

任何建议!?有没有办法在ipad上控制苹果快速播放器

Any suggestions!? is there any way to control apple quicktime player on ipad

推荐答案

我成功完成了这个

<a id="button" href="#">go</a>

<a id="button2" href="#">goback</a>

<div id="video">
<iframe id="video1" src="" width="555" height="312" frameborder="0"></iframe>
</div>

$( "#button" ).click(function(){
$('#video').fadeIn(400);
$("#video1").attr("src", "http://player.vimeo.com/video/myvideoid");
$("#video1").load();
});

$( "#button2" ).click(function(){
$('#video').fadeOut(400);
$("#video1").attr("src", "");
});

要符合ipad,iframe标签中的第一个src必须为空

to be compliant with ipad, first src in iframe tags MUST be empty

这篇关于如何在ipad上控制苹果视频播放器(嵌入iframe和html5 vimeo解决方案的视频)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆