У меня есть веб-приложение в coldfusion, которое записывает видео и предоставляет видео пользователю.
Видео работает нормально в браузерах Android и настольных ПК, но выдает ошибку «Ошибка загрузки носителя: файл не может быть воспроизведен» в IOS.
Вот мой код JWPlayer, который в настоящее время работает.
jwplayer("element").setup({
file: "/video.cfm?token=4514_129_9B2F727D-5056-A85D-6EBE3E48FC2AB9C6",
image: "path/to/image",
width: 450,
height: 360,
type: "mp4",
logo: {
file: 'path/to/logo',
link: 'example.com',
hide : true
}
});
Вот мой video.cfm на сервер mp4 после проверки.
<cfset videoFile = 'path\to\file'>
<cfset fileInfo = GetFileInfo(videoFile)>
<cfset length = fileInfo.size>
<cfset start = 0>
<cfset end = fileInfo.size - 1>
<cfheader name="Content-type" value="video/mp4">
<cfheader name="Accept-Ranges" value="0-#length#">
<cfheader name="Content-Range" value="bytes #start#-#end#/#fileInfo.size#">
<cfheader name="Content-Length" value="#length#">
<cfcontent file="#videoFile#" type="video/mp4">
Я попробовал какое-то решение, добавив заголовок. Но это не работает. Может ли кто-нибудь помочь мне разобраться в проблеме.
.mp4
. Я думаю, это то, что мешает iOS принимать его. - person VC.One   schedule 30.03.2017