在iPad上使用CakePHP的MediaView和MP4视频 [英] Using CakePHP's MediaView with MP4 videos on an iPad

查看:191
本文介绍了在iPad上使用CakePHP的MediaView和MP4视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过Cake的MediaView类显示MP4视频。我在Chrome& Firefox,问题在于试图在iPad上观看视频。我得到的只是播放图标,中间有一条线。如果您直接访问视频的网址,则可以查看该视频,但我需要此图层,因为视频受限于谁能够查看它们。

I am trying to display MP4 videos through Cake's MediaView class. I have it working fine in Chrome & Firefox, the problem is when trying to view the video on an iPad. All I get is the play icon with a line through the middle of it. The video is able to be viewed if you access the URL of the video directly, however I need this layer in between as videos are restricted on who is able to view them.

我谷歌解决了这个问题,发现iPad在显示视频内容时使用了RangeRequests(不完全确定是如何工作的),并找到了我的方式这篇文章。然后我实现了我自己的View类,其中包含了附录A中的代码(显然有一些更改适合Cake)。我还看了一下MediaView类的Cakes源代码,对我而言,它似乎已经有了支持范围请求的代码。但是我没有运气让视频发挥作用。

I Google'd the problem and found that the iPad uses RangeRequests (Not fully sure on how all that works) when displaying video content, and found my way to this article. I then implemented my own View class that incorporated the code in Appendix A (Obviously with a few changes made to suit Cake). I also took a look at Cakes source code for the MediaView class and to me it seemed that it already had code to support range requests. However I have had no luck in getting the videos to work.

我只是想知道是否有其他可能导致问题的因为我意识到文章链接现在已超过4岁。

I am just wondering if there was anything else that might be causing the problem as I realise that the article linked to is over 4 years old now.

谢谢,

推荐答案

您实际向用户提供的内容类型是什么? iPad,iPhone和iPod 不支持Flash 。如果这是您的问题,您可以执行智能请求处理并向iOS设备提供HTML5内容。 RequestHandlerComponent类可以检测用户代理。对于移动浏览器,您可以使用 RequestHandler-> isMobile() 方法。
例如,要检查您将使用的iPad:

What content type are you actually delivering to the users? The iPad, IPhone and iPods do not support flash. If this is your problem you can do smart request handling and provide HTML5 content to iOS devices. The RequestHandlerComponent class can detect user agents. For mobile browsers you can use the RequestHandler->isMobile() method. For example to check for a iPad you would use:

$this->RequestHandler->isMobile('iPad')

应返回 true 如果是这样的话。

which should return true if that is the case.

这篇关于在iPad上使用CakePHP的MediaView和MP4视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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