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

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

问题描述

我用vimeo html5嵌入解决方案嵌入了一个视频.我可以在iPad上播放视频.我想

I embedded a video with vimeo html5 embedding 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. 我尝试了Apple javascript解决方案来暂停:

https://developer.apple .com/library/archive/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 hiding+unloading then showing+reloading the video on firefox, chrome, etc... but on ipad it's hiding without unloading and then not showing back the player on fadeIn action...

有什么建议吗?有什么方法可以在ipad上控制Apple QuickTime Player?

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上控制Apple视频播放器(嵌入了iframe和html5 vimeo解决方案的视频)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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