jQuery / JWPlayer:在IE中从S3播放MP4视频时无法正常工作

时间:2013-11-22 18:04:15

标签: jquery internet-explorer jwplayer

以下是标记中视频的标记:

  <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中不起作用。其他人有这个问题吗?

1 个答案:

答案 0 :(得分:2)

您可以自行转到此页面并“排查”您的情况:

http://www.longtailvideo.com/support/jw-player/28840/troubleshooting-your-setup

另外,how about your <doctype>

  

请注意两个非常常见的问题会妨碍视频的流畅播放   Internet Explorer 9/10。首先,您需要设置为   防止触发IE的怪癖模式。其次,您的视频必须是   配合视频/ mp4 mimetype或IE将拒绝播放它们。看到   我们针对更常见问题的故障排除指南。