JavaScript 无法在 PS3 浏览器上运行
我最近在我的网站上放置了一个覆盖嵌入视频的广告框。用户被迫点击“关闭播放”按钮才能关闭广告叠加并播放视频。
在这里查看它的实际效果:http://www.animefushigi.com/ao-no -exorcist-17/4
问题:我收到 PS3 用户的投诉,称“关闭播放”按钮在 PS3 浏览器上不起作用,因此他们被广告覆盖困住了。
该按钮的 javascript 如下:
$(document).ready(function(){
$(".btn").click(function() {
$(this).closest(".olBlock").toggleClass("display");
});
});
关于如何解决此问题有什么建议吗?
I have recently put an advertising box that overlays the embedded videos on my website. Users are forced to click the "CLOSE TO PLAY" button in order to close the advertisement overlay and play the video.
See it in action here: http://www.animefushigi.com/ao-no-exorcist-17/4
The problem: I have been getting complaints from PS3 users that the Close to Play button is not working on the PS3 browser, thus they are stuck with the ad overlay.
The button's javascript is as follows:
$(document).ready(function(){
$(".btn").click(function() {
$(this).closest(".olBlock").toggleClass("display");
});
});
Any suggestions on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是,在 PS3 浏览器 (NetFront 3.1) 中,Flash 插件(视频播放器)接收 Click 事件,而不是 HTML 覆盖。
因此,唯一的解决方案是在 Flash 对象的边界之外有一个关闭可点击元素,例如将“关闭播放”伪按钮移到视频播放器后面。为了美观,您可能更愿意将关闭按钮保留在原来的位置。在右上角添加典型的“[x]”关闭元素,将其放置在 Flash 播放器的正上方。
如果您需要测试 PS3 浏览器(可能没有必要,如果您为所有浏览器包含“[x]”元素),则用户代理字符串包含“PLAYSTATION 3”,因此您可以在客户端上测试它,如下所示如下:
据我所知, jQuery.browser 对象不能用于检查 PS3 浏览器,特别是该对象可能已被弃用。
The problem is, in the PS3 Browser (NetFront 3.1), the Flash plugin (video player) receives the Click event, instead of the HTML overlay.
Therefore, the only solution is to have a close clickable element outside the bounds of the Flash object, such as moving the "Close to play" psuedo button just after the video player. For aesthetics, you may prefer to leave the close button where it is & add the typical "[x]" close element in the top right corner, positioning this just above the Flash player.
If you need to test for the PS3 browser (may not be necessary, if you include the "[x]" element for all browsers), the user agent string includes "PLAYSTATION 3", so you could test for it on the client as follows:
As far as I can tell, the jQuery.browser object can not be used to check for the PS3 browser, especially as the object may be deprecated.