1
votes

We experience an issue with playing a mp4 file on ipad on webpage with a video HTML 5 player.

Issue: It does not work on ipad/iphone. On all other platforms (Windows,Android, iOS desktop) it works fine.

This is the code:

<video id="my-video"  width="400" height="240" preload="true"  controls >
<source src="/media/video/6d9ab49-9936-4194-acvb-3cd9b60521fg/myvideo.mp4" />
</video>

Connected the ipad to the Mac to debug: A message 'requested resource cannot be found'. Does sound very clear but does not make sense because the mp4 file is accessible when you paste the url into the browser address bar.

Already tested and checked:

  • set src of mp4 to fullpath (including https:// or http://) instead of using the virtual path ;
  • checked hostingprovider for 'Accept-Ranges: bytes' (with partial content (206) responses) ; settings are ok
  • play the same mp4 file from a remote url (accessed with or without https); strange but imporant : that works !

So I guess the issue really is that the mp4 can not be found or loaded on ipad. But why? Hope someone can help.

2
where you put your video? in app bundle ? from where you want to play video?Ketan Parmar
what happens if you explicitly put the full path inside the src ?Offbeatmammal
The video is put in a accessible folder. ( /media/etc. ) What do you mean with full path ? including http:// or d:\inetpub ?Midiman7472

2 Answers

0
votes

Have you tried it like this, include src directly inside <video> tag?

<video id="my-video" src="/media/video/6d9ab49-9936-4194-acvb-3cd9b60521fg/myvideo.mp4" width="400" height="240" preload="true" controls></video>

If it still doesn't work try to use only video element with src, remove preload and controls. Just to see if you can get it to work. And if still no results, try to go for absolute src path.

0
votes

I had this very same problem serving videos on my Liferay Portal, which works perfectly on PC and Android, but not on iOS devices. After numerous tests, I think I've finally managed to nail down the cause.

For some reason, if the video file (eg MP4) is accessible by a guest user (ie accessible without having to log on to the server), then it will work fine on iOS. However, if the file is only accessible to logged on users, it won't work.

My theory on why this happens is that iOS is probably using a different session to do the range request check than the one used to play the video file. Thus, the range request check fails because the file is inaccessible.