我有一个<audio>
具有如下控件的元素:
<audio controls="controls" id="audio-sample" preload="auto">
<source src="../../music-sample.php?type=ogg&id=<?php echo $item->custom_5; ?>" type="audio/ogg" />
<source src="../../music-sample.php?type=mp3&id=<?php echo $item->custom_5; ?>" type="audio/mp3" />
</audio>
播放器出现,声音播放得很好,但轨迹栏不会移动以反映经过的时间,并且无法拖动它来寻找。为什么不?我需要发送某种额外的标头吗?这是所有相关的 PHP,没什么特别的:
header('Content-Type: ' . $mimetype[$type]);
$file = fopen($filename, 'rb');
fpassthru($file);
fclose($file);
exit();
您可以在这里看到问题。 http://www.musiklus.com/anthology/item/1516/a-companion-on-the-road-words-by-sheelah-megill
尝试设置Content-Length
标头...
header("Content-Length: " . filesize($filename));
由于某种原因,如果没有预先提供该信息,它无法进行必要的数学运算来放置轨迹栏。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)