这是我在标记中对视频的标记:
<div class="jw-wrapper" data-url="//amazon.url.here" data-thumbnail="<%= asset_path("marketing-video-placeholder.jpg") %>" data-width="770" data-height="443" style="">
<div id="jwplayer-video">Loading the player...</div>
</div>
这是我的jQuery:
if $(".jw-wrapper").length > 0
initializeJWPlayer($(".jw-wrapper[data-url]"))
initializeJWPlayer = (elements) ->
$.each elements, (i, element) ->
element = $(element)
_file = element.attr("data-url")
_image = element.attr("data-thumbnail")
_width = element.attr("data-width")
_height = element.attr("data-height")
child_index = 0
child_index++ while element[0].childNodes[child_index].childNodes.length is 0
name = $(element[0].childNodes[child_index]).attr("id")
jwplayer(name).setup
file: "https:#{_file}"
height: parseInt(_height)
image: _image
width: parseInt(_width)
startparam: "starttime"
type: "mp4"
abouttext: "RecruitTalk"
aboutlink: "https://www.recruittalk.com"
html5player: "<%= asset_path('jwplayer.html5.js') %>"
logo:
file: "<%= asset_path('rt-logo-icon.png') %>"
link: "https://www.recruittalk.com"
所有东西在FF、Chrome和Safari中都能完美工作,但在IE中无法工作。还有人有这个问题吗?
您可以转到此页面并自行"排除"您的情况:
http://www.longtailvideo.com/support/jw-player/28840/troubleshooting-your-setup
另外,你的<doctype>
怎么样?
请注意,在Internet Explorer 9/10。首先,您需要设置防止触发IE的怪癖模式。第二,你的视频必须提供视频/mp4模拟类型或IE将拒绝播放它们。看见我们的常见问题疑难解答指南。