简体   繁体   English

jQuery .load()函数在iPad上不起作用

[英]jQuery .load() function doesn't work on iPad

I have a problem with the .load(); 我对.load()有问题; function on my ipad. 在我的iPad上运行。

$(this).bind('ended',function() {
   $('video').load();
});

It's a simply function for loading the same content after the Video ends. 这是在视频结束后加载相同内容的简单功能。 Any idea why this function does not work on an iPad? 知道为什么该功能在iPad上不起作用吗?

The .load() method loads the video into the tag. .load()方法将视频加载到代码中。 The .play() method starts the currently loaded video. .play()方法启动当前加载的视频。 One more thing to keep in mind is this, is the video the right format? 需要记住的另一件事是,视频格式正确吗? The tag can load quite a few formats but not every browser can handle every format. 标记可以加载多种格式,但并非每种浏览器都可以处理每种格式。 iOS browser like iPad/iPhone and even Safari on OSX/Windows can play m3u8 playlists encoded with h264/AAC and mp4 encoded with h264/AAC files but will not play webm, vp8 or avi. iOS浏览器(如iPad / iPhone,甚至OSX / Windows上的Safari)可以播放以h264 / AAC编码的m3u8播放列表和以h264 / AAC文件编码的mp4,但无法播放webm,vp8或avi。 So you need to keep all of this in mind when building this type of tag. 因此,在构建此类标签时,您需要牢记所有这些。 You might want to look into just building the the player with straight Javascript and supplying multiple tags and then let the browser determine the video it can play. 您可能需要研究仅使用纯Javascript构建播放器并提供多个标签,然后让浏览器确定其可以播放的视频。 (I did this at a past job and it is a lot easier than you might think) And I believe that with certain browsers you need to reset the 'play pointer' and tell it to start at position 0 (我是在过去的工作中完成此操作的,它比您想象的要容易得多),而且我认为,对于某些浏览器,您需要重置“播放指针”并告诉其从位置0开始

jsfiddle [dot] net/nexxuz/XuLCC/15/ (will not let be post link without code) jsfiddle [dot] net / nexxuz / XuLCC / 15 /(如果没有代码,将不会发布链接)

And I was able to get this working playing multiple videos too (once one ended played another) (Ad video plus content video) also I was able to get a mid roll video working too. 而且,我也可以同时播放多个视频(一次播放完另一个视频)(广告视频和内容视频),也可以播放中段视频。 (at x seconds into video play another video and then once that video is done resume the first video) (在视频播放x秒后播放另一个视频,然后在完成该视频后继续播放第一个视频)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM