I'm in need of some help with the inert hapi.js module. I'm trying to render a HTML5 inline video with hapi.js. I'm using a handler to pass the video with reply.file('filename.mp4').type('video/mp4')
. This works perfectly in Google Chrome on OSX, however it doesn't work on an iPad or iPhone on iOS.
If instead, I serve the same file using a HAPI directory directive. i.e. I request the file more directly.
server.register(Inert, function () {});
server.route({
path: "/static/{path*}",
method: "GET",
handler: {
directory: {
path: "./static",
listing: false,
index: false
}
}
});
the video then embeds fine on both Chrome and iOS.
There seems to be a difference between using reply.file()
vs serving the file directly, but only on iOS. I've compared HTTP headers in both cases and things look identical, so I am stumped.