1

我有一个 Html5 视频播放器:

<video
    video id="videoObj" class="video-js vjs-default-skin center" webkit-playsinline autobuffer preload="auto" poster="http://SomePoster.png">
        {VideoFiles}
</video>

当互联网连接不好时(在 iOS 设备上播放视频,在 uiWebView 上),视频停止播放。我尝试在此处此处获取一个事件,但没有一个被触发。

我这里有两个问题:

  1. 我希望视频在互联网连接不良/丢失时自动恢复播放/缓冲。
  2. I would expect an event telling me that the video is paused because of internet connection problems.

Am I missing some attributes for html5 video that could help me? (by the way, as a (bad) workaround I am checking the video's currentTime every second. If I see that it is equal to the last state, I know that the video is stuck and I fires the "play" event, in order to resume playing the video.)

Edit: I do not show the video toolbar on the video, so the user cannot resume the video by himself

4

1 回答 1

1

刚刚找到解决方案...看来我使用了“暂停”事件而不是“暂停”。现在我可以在“暂停”事件上显示“等待”并在“canplay”事件上恢复视频。

于 2013-05-06T13:13:07.003 回答