javascript - jPlayer 视频无法在 iOs - iPad 和 iPhone 中播放

标签 javascript ios jplayer

我的视频可以在 PC 和 Mac 的所有浏览器中播放 - Chrome、Firefox、IE 和 Safari 以及 Android 平板电脑和手机。但是,它无法在 iPad 或 iPhone 上播放。我正在运行 iOS 9.2 的 iPad mini2 上进行测试。

但是当我将 iPad 与电脑同步并在 iPad 视频应用程序中播放视频时,它就会播放。所以这似乎是JPlayer的问题。

这是我正在使用的代码:

   <script type="text/javascript">
      $(document).ready(function () {
          $("#jquery_jplayer_1").jPlayer({
              ready: function () {
                  $(this).jPlayer("setMedia", {
                      title: "POPPI-Introduction",
                      m4v: "/Video/POPPI-Introduction.m4v",
                      ogv: "/Video/POPPI-Introduction.ogv",
                      webmv: "/Video/POPPI-Introduction.webm"
                  });
              },
              cssSelectorAncestor: "#jp_container_1",
              size: {
                  width: "640px",
                  height: "360px",
                  cssClass: "jp-video-360p"
              },
              swfPath: "/Content/scripts",
              supplied: "m4v, ogv, webmv",
              useStateClassSkin: true,
              autoBlur: false,
              smoothPlayBar: true,
              keyEnabled: true,
              remainingDuration: true,
              toggleDuration: true
          });
      });
  </script>

<div id="jp_container_1" class="jp-video " role="application" aria-label="media player">
  <div class="jp-type-single">
    <div id="jquery_jplayer_1" class="jp-jplayer"></div>
    <div class="jp-gui">
      <div class="jp-video-play">
        <button class="jp-video-play-icon" role="button" tabindex="0">play</button>
      </div>
      <div class="jp-interface">
        <div class="jp-progress">
          <div class="jp-seek-bar">
            <div class="jp-play-bar"></div>
          </div>
        </div>
        <div class="jp-current-time" role="timer" aria-label="time">&nbsp;</div>
        <div class="jp-duration" role="timer" aria-label="duration">&nbsp;</div>
        <div class="jp-details">
          <div class="jp-title" aria-label="title">&nbsp;</div>
        </div>
        <div class="jp-controls-holder">
          <div class="jp-volume-controls">
            <button class="jp-mute" role="button" tabindex="0">mute</button>
            <button class="jp-volume-max" role="button" tabindex="0">max volume</button>
            <div class="jp-volume-bar">
              <div class="jp-volume-bar-value"></div>
            </div>
          </div>
          <div class="jp-controls">
            <button class="jp-play" role="button" tabindex="0">play</button>
            <button class="jp-stop" role="button" tabindex="0">stop</button>
          </div>
          <div class="jp-toggles">
            <button class="jp-repeat" role="button" tabindex="0">repeat</button>
            <button class="jp-full-screen" role="button" tabindex="0">full screen</button>
          </div>
        </div>
      </div>
    </div>
    <div class="jp-no-solution">
      <span>Update Required</span>
      To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
    </div>
  </div>
</div>

最佳答案

声誉不足,无法发表评论。

媒体确实加载了吗?或者它加载但只是不播放?如果是后者,那么这可能是你的问题。 JQuery jPlayer autoplay not working on ipad how to show controls

其他帖子的回答:

You're not going to be able to play video from $(document).ready() or from jPlayer's ready event. IOS specifically prevents it

我无法对此进行测试,因为我没有 Ipad,但这可能是您的问题。

关于javascript - jPlayer 视频无法在 iOs - iPad 和 iPhone 中播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35454088/

相关文章:

javascript - 如何使用 JavaScript 删除小数点后的数字?

ios - 使用 Google OAuth 2.0 时如何防止额外 View 显示访问代码

javascript - 混淆网页中的文件名

jplayer - 如何使用 jPlayerPlaylist 插件处理 jPlayer 中的歌曲删除事件

javascript - jPlayer 不会在 iOS 上播放第二次(有时)

javascript - 删除数字键盘上的显示和消失功能

javascript - Node 服务器上的多个 setInterval 计时器

javascript - 使用 javascript 和 dom 从单选按钮创建输入

ios - 从 UITableViewCell 中删除 UILabels 并再次添加它们

iOS - 在禁用模块错误时使用@import