HTML5音频持续时间问题 [英] HTML5 audio duration issue

查看:118
本文介绍了HTML5音频持续时间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jplayer 在Ipad中播放音频和视频文件,但问题是如果我更改视频或音频网址,有时我会获得持续时间NaN。

I am using jplayer to play audio and video files in Ipad, But the issue is if i change video or audio url, sometimes i get duration NaN.

请帮助我。

Please help me.

推荐答案

检查您的服务器是否启用了Range请求。

Check your server has Range requests enabled.

这个页面上的Jplayer网站:

From this page on the Jplayer site:


您的服务器必须启用范围请求。这很容易通过
查看您的服务器响应是否包含其
标头中的Accept-Ranges。大多数HTML5浏览器允许在下载期间寻找新文件位置
,因此服务器必须允许新范围为
请求。

Your server must enable Range requests. This is easy to check for by seeing if your server's response includes the Accept-Ranges in its header. Most HTML5 browsers enable seeking to new file positions during a download, so the server must allow the new Range to be requested.

未能接受字节范围请求会导致一些
HTML5浏览器出现问题。通常无法从文件中读取持续时间为
某些格式要求将文件的开始和结束读为
,以了解其持续时间。如果服务器上没有启用Range请求,则Chrome往往是具有最多
问题的浏览器,但是所有
浏览器都会有一些问题,即使只是你必须等待
在跳到接近结尾之前加载所有媒体。

Failure to accept byte Range requests will cause problems on some HTML5 browsers. Often the duration cannot be read from the file as some formats require that the start and end of the file is read to know its duration. Chrome tends to be the browser that has most problems if the Range request is not enabled on the server, but all browsers will have some issue even if it is only that you have to wait for all the media to load before jumping close to the end.

这篇关于HTML5音频持续时间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆