4

I'm currently building an xpage application which is used as a video library. All is working pretty good except for the Ipad / Iphone devices. The application uses notes documents to store a description, a summary and ofcourse the mp4 file to be displayed.

To display the information we used a flash control. Since this does not work on ipad ofcourse I'm using the html 5 video tag. Now we have a issue with the videofiles not playing correctly on the ipad.

When I use the $file url such as

http://www.mytesterver.com/database.nsf/.SysAllByUniversalId/5931A35AD3249395C1257AC900587627/$File/test.mp4

The url is not accepted by the ipad and therefore the video won't play. Now when I check in other browsers this url works perfectly. When I upload the videofile as a file resource and access the file that way on the ipad

http://www.mytesterver.com/database.nsf/test.mp4

The video is playing fluently on all systems. Now I could ofcourse change the code so it will generate a file resource. But I want to keep all files , texts etc together on a document. Is there someone who can explain to me why and how to solve this issue? I think it has something to do with headers not send correctly but I dont realy know for sure.

jjtbsomhorst
  • 1,667
  • 11
  • 28
  • 2
    Is the mime type properly specified? Afaik for iPad to play it should be video/mp4. You can change the headers using custom rules in website configuration http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=%2Fcom.ibm.help.domino.admin85.doc%2FH_WEB_SITE_RULES.html or you can add file identification entry for mp4 in Web/File Identifications view of your Domino Directory – Egor Margineanu Feb 05 '13 at 12:22
  • Thanks for the sugestion. I don't thing, I have to check, that the domino server is serving the correct mime type. – jjtbsomhorst Feb 05 '13 at 12:31

5 Answers5

3

The difference between the two requests is that if you are open the Attachment, the Accept-Ranges: bytes HTTP header is not set. Safari requires this header.

HTTP servers hosting media files for iOS must support byte-range requests

[Source: Safari Developer library]

If you open the video as a file resource, the header is added correctly from the domino server.

Link: Does iPhone/iPad Safari require 'Accept-Ranges' header for video?

EDIT:

As a possible workaround you could use a servlet like this one: http://balusc.blogspot.de/2009/02/fileservlet-supporting-resume-and.html

Community
  • 1
  • 1
Sven Hasselbach
  • 10,455
  • 1
  • 18
  • 26
  • Hi Sven, I checked with curl what happened and indeed it downloaded the whole file instead of only the range specified. Is it possible to configure the server so it enables the header with file attachments or is it a limitation we have to live with? – jjtbsomhorst Feb 07 '13 at 12:34
  • 1
    I don't think that just adding the header will solve the issue: Safari checks some bytes (by downloading a range from the file) to identify the file type. After this check, it begins to fetching the video. I am not sure if there is a workaround when using the direct filedownload from a document (using a XPage instead of a Notes attachment link will not help). – Sven Hasselbach Feb 07 '13 at 12:57
  • I thought about this aswell because only sending a header and dont react to it would be silly. I'm just curious if it would be possible to create an xpage or agent which does exactly that what the servlet does. This way we dont need to add a servlet and can just use the single database design. – jjtbsomhorst Feb 07 '13 at 13:58
  • 1
    Isn't this also the case if compression is used. At least according to http://blog.nashcom.de/nashcomblog.nsf/dx/compressed-documents-still-not-byte-served-in-8.5.htm?opendocument&comments there are some differences in how Domino is serving compressed vs non-compressed files. – Egor Margineanu Feb 07 '13 at 14:03
  • Thanks Sven. I've used the code example you provided to write a little class which does the magic for me. I still have to investigate the impact of this functionality when many users access the data but for now it works. You will be awarded the bounty! – jjtbsomhorst Feb 07 '13 at 15:26
1

A few things to try in addition to mime type:

  1. Remove the "." after .nsf/ from your URL. iPad might think it's a relative URL.
  2. Add ?OpenElement at the end of the URL
  3. Save the file to domino/html folder (then it's accessible by everyone)
Panu Haaramo
  • 2,932
  • 19
  • 41
  • Thanks panu for you answer. When I save the file to the domino/html directory the file is indeed playable by all devices. I could do 2 things.. 1) rewrite the code so it will save the file to the domino/html directory 2) figure out why it is not working as it should. I hope you could help me with 2 :) – jjtbsomhorst Feb 07 '13 at 09:19
0

Just a quick shot. If the $-character in the url is the problem (and I do not know is this is a problem??) you could easily get around it by creating a web substitution rule for the internet site in question in the Domino directory, e.i. allowing the "external" url to be, say, http://www.mytesterver.com/database.nsf/.SysAllByUniversalId/5931A35AD3249395C1257AC900587627/files/test.mp4

... and I just stumbled over this new openNTF project that may be of interest to you as well: http://www.openntf.org/blogs/openntf.nsf/d6plinks/NHEF-94NGJX

It is about accessing file attachments through WebDAV ;-)

/John

John Dalsgaard
  • 2,797
  • 1
  • 14
  • 26
  • checked if the $ would be the issue but this is not the case unfortunatly. I have added the correct substitutions and all other devices do play the file except for ios devices (iOS the new Ie6?). – jjtbsomhorst Feb 07 '13 at 09:12
0

I'm late to the party here, but I've had some good success using the Projekktor Project with XPages. http://www.projekktor.com/

That might be a good option. There's a ton of features in projeckktor. It's really good stuff.

I had an old rough example of it's use on OpenNTF in the XPages Media Library template. There were some issues I need to improve on but it does work. It's also been the player behind XPages.TV for a long time.

Worth checking out.

David Leedy
  • 3,583
  • 18
  • 38
0

I'm a bit late on this discussion, but I had the same issue and noticed that if the video attachment is compressed with any compression method it won't work on Ipad even if it works on other plateforms.

To verify this, add a video file into a richtext using the notes client and when attaching the file, uncheck "Compress" option at the bottom of the dialogbox when you select the file you want to attach and try to see the video with the ipad and it should work !

It would be nice that the domino server handle the byte-range http request with compressed attachment the same way it does without compressed ones.

The bad side is that if you want to attach a video file using an background agent in lotus script or java, you cannot say "don't compress the attachment" using a parameter... :-(

In my case I had to have the file linked to a richtext so, the only solution I have found is to attach it using the "standard" API in lotusscript to attach a file in a richtext and then search through the $file field to find the video file (using the name of the file), remove it, and reinsert the "$File" field using C APIs in the document without using compression.

I don't have this code with me right now but can post it later if you're interested.

If you don't need to have the file inside a specific field, you can only use the C APIs to attach the file into the document without compressing it.

Hope this helps a bit...