1

I have an Html5 video player:

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

When internet connection is bad (playing the video on iOS device, on a uiWebView), the video stops playing. I tried getting an event for that here and here, but none is fired.

I have two problems here:

  1. I would expect the video to auto-resume playing/buffering when internet connection is bad/lost.
  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

Community
  • 1
  • 1
Yaniv Efraim
  • 6,633
  • 7
  • 53
  • 96

1 Answers1

1

Just found the solution... It appears that I used "paused" event instead of "pause". Now I can show the "wait" on "pause" event and resume the video on "canplay" event.

Yaniv Efraim
  • 6,633
  • 7
  • 53
  • 96
  • does autopaly work for you in iPad, it is not working for me @yaniv – Hitesh Dec 03 '13 at 07:23
  • By default - mobile browser does not allow autoplay. A user action must be triggered in order to cause a play. Please look at this post - http://stackoverflow.com/questions/12496144/can-you-autoplay-html5-videos-on-the-ipad – Yaniv Efraim Dec 12 '13 at 12:36
  • Thanks for informative link, Is there no hack around it @Yaniv – Hitesh Dec 13 '13 at 14:24
  • Are you using a webview? I found that on webview if you are calling your javascript code (for $('video').play () ) from objective-c, the autoplay will work – Yaniv Efraim Dec 29 '13 at 19:45