0

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.

Stedy
  • 7,359
  • 14
  • 57
  • 77
Mooshwa
  • 11
  • 1

1 Answers1

0

Ok. I did some more debugging and have realized this has nothing to do with HAPI. In fact, this is an IOS bug, which is referenced here:

HTML5 video/audio player on mobile Safari (iOS 7 & iOS 10) excludes cookies

The reason my static handler was working, is because it wasn't checking for a cookie, which wasn't being sent as a result of this IOS bug in the media player.

Community
  • 1
  • 1
Mooshwa
  • 11
  • 1