Mattermost, Inc.

HTML5 video stream instead of download

Hi. I’m using Mattermost v5.20.0 with Nginx. When starting video playback of a video file (that was uploaded as an attachment in a channel) through the in-browser HTML5 player, my browser first downloads the whole video and then starts the playback.

accept-ranges: bytes
cache-control: private, no-cache
content-disposition: attachment;filename="z1.webm"; filename*=UTF-8''z1.webm
content-length: 20488755
content-security-policy: Frame-ancestors 'none'
content-type: video/webm
date: Thu, 26 Mar 2020 11:20:28 GMT
expires: 0
last-modified: Thu, 26 Mar 2020 10:27:38 GMT
server: nginx/1.16.1
status: 200
strict-transport-security: max-age=15552000
vary: Accept-Encoding
x-content-type-options: nosniff
x-frame-options: DENY
x-request-id: ccmkx4qnt3b9dg69ofcmpyy9ny
x-uncompressed-content-length: 20488755
x-version-id: 5.20.0.5.20.2.1aaf5455b9503a276a82e78c93a8677d.false

Is there a way to make the player stream the video while it is still downloading?

Also, when downloading video files (i.e. not using the builtin player), is there a way to disable gzip compression so that browser receives the Content-Length header? I don’t want to disable gzip completely, I’d like to continue serving JS etc. gzipped.

Hey @luka-mikec ,
I think you already asked this in the “bugs” channel on our community server.

Someone replied there as well, so I’m going to copy the reply here for visibilty:

Have you installed the mailcap package? The server uses that (specifically, /etc/mime.types) to give hints to the browser about the content type.

Oh and by the way for issues like this, apart from the forums, the channel peer-to-peer help works best because Bugs has a lot of chatter from the Jira bot posting bug reports so questions can go under from time to time :slight_smile:

Hi @sven.huester,

I didn’t ask this before. I’ll try that solution and go to the channel you mention if I need further help. Thanks!

Hey @luka-mikec,

Oh sorry then I have confused you with someone else because they’ve asked literally the same question just a few hours ago.

You can also just post here. We’re monitoring the forums 24/7 and I’ll get a notification anyways when you respond. :slight_smile:

Of course you’re also welcome to join our community server :wink:

Also reading over your post again, I see that your problems are differing in a tiny detail indeed.
You say you’re seeing the web-player pop up but the video doesn’t start playback before it’s completely finished. Correct?

Have you tried different length videos yet? It can happen with shorter length videos sometime.

Either way I’m going to look into this further and get back to you once I find something.

Yes, the playback doesn’t start before the video is completely downloaded (there are two issues in my post actually, in the last paragraph I mention another less significant issue).

I’m not sure if I should configure mailcap somehow? The content-type header is set correctly (btw, the same issue happens with mp4 too).

edit: I tried uploading a video to community.mattermost.com, and it works fine there. So it’s probably not my browser (but I see both Nginx and Mattermost are slightly newer than mine).

Just saw your edit.
The Mattermost version shouldn’t matter. As far as I know we don’t wrap the video in any way. So it’s probably something else.

Would you mind posting your nginx config here? You can also send it to me via DM on the community-server. And of course edit out any sensible info from it :slight_smile: