Foren

DXP: MP4 video playback problem in Safari and iPad

thumbnail
Fernando Fernandez, geändert vor 6 Jahren.

DXP: MP4 video playback problem in Safari and iPad

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Hi all,

I've developed a very simple structure and a template to display a video stored in the document library. It works fine - if you're not on Safari or iPad.

The video tag is very simple:

<video style="width: 50%; height: auto;" id="videoObj" controls> 
	<source type="video/mp4" src="moredan.mp4">
</video>


I read somewhere that iPads/safari are very touchy in relation to mimetype and range requests.

In fact, the video preview doesn't even appear in the documents & media backoffice.

I've put the same html code and the same mp4 file on an apache httpd, tested it again with Safari for windows and it works.

Any ideas on this?

TIA

Fernando
thumbnail
Alfonso Crisci, geändert vor 6 Jahren.

RE: DXP: MP4 video playback problem in Safari and iPad

Regular Member Beiträge: 136 Beitrittsdatum: 02.04.14 Neueste Beiträge
Hi Fernando,

Is the issue happening on https protocol ? Is it working fine if you open that video outside of Liferay but with same browser and protocol ?

Some possibly related topics:

https://stackoverflow.com/questions/6668994/html5-video-on-ipad-safari-using-https
http://fdiv.net/2013/05/17/getting-html5-video-work-ios-mobile-safari
thumbnail
Fernando Fernandez, geändert vor 6 Jahren.

RE: DXP: MP4 video playback problem in Safari and iPad

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Hi Alfonso,

The problem was content-disposition and basic auth, after all.

Anyway thanks taking the time to come up with your excellent suggestions.

Fernando
thumbnail
Fernando Fernandez, geändert vor 6 Jahren.

RE: DXP: MP4 video playback problem in Safari and iPad (Antwort)

Expert Beiträge: 396 Beitrittsdatum: 22.08.07 Neueste Beiträge
Hi guys,

Just in case this helps somebody else with the same issue, I had two problems and none related to mimetype or byte range requests, which are handled fine in DXP.

The first problem was related to content-disposition. DXP default conf sets MP4 files to attachment, and it must be inline. Adding the right property to portal-ext.properties solved it:

mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,wmv,m4v,mp4,mov,ogv


The second problem was related to the way safari uses quicktime to display videos, which has a problem with authenticated websites. After removing the authentication, the video finally played.

HTH

Fernando

References:

Inline vs. attachement: https://web.liferay.com/community/forums/-/message_boards/message/14964594
Auth: https://stackoverflow.com/questions/8350410/mp4-video-wont-load-in-safari-status-pending-type-undefined