gpt4 book ai didi

php - 通过 SSL 流式传输 MP3(使用 SWF)在 Firefox 和 Chrome 中有效,但在 IE 7 或 8 中无效

转载 作者:太空宇宙 更新时间:2023-11-03 15:06:39 25 4
gpt4 key购买 nike

我正在使用 WP Audio player Steam mp3 文件。

这是我嵌入播放器的方式:

            AudioPlayer.embed("player_new_7b4c6a94c8f3cc3f79ce7b8cc4946103", {  
soundFile: "file/read/Mdjk7EGOzSzNUmNa8NYhgn6oCQwxoKhzw27EL27cgwCUUd9BLYpRIkt",
noinfo: "yes",
autostart: "no" ,
animation: "no",
buffer: 1,
remaining: "yes"
});

PHP获取文件然后输出内容:

$file = new File();
if($data = $file->readFromInbox($request->get('file'))
{
header("Content-Type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Content-Length: ' . $data->getSize());
header('X-Pad: avoid browser bug');
header("Cache-Control: no-store");
header("Cache-Control: no-store, must-revalidate");
header("Cache-Control: no-store,max-age=0,must-revalidate");
header("Cache-Control: max-age=0,must-revalidate");
header("Cache-Control: must-revalidate");
echo $data->getData();
exit();
}
else
{
$this->redirect404();
}

整个应用程序都在使用 SSL。没有标准的 HTTP 端口 80 访问。

这在 Chrome、Firefox、Opera 等上运行良好,但不适用于 IE。

我读了这篇文章:http://faindu.wordpress.com/2008/04/18/ie7-ssl-xml-flex-error-2032-stream-error/

显然,当使用 IE 时,Flash 在通过 SSL 打开文件时会出现问题。

如有任何帮助,我们将不胜感激。谢谢。

编辑:这适用于 IE9。只是不是 IE7 或 IE8

最佳答案

我找到了解决方案。

这些 header 解决了问题:

header ("Cache-Control: no-store");
header ("Expires: -1");
header ("Pragma: public");

当然,还有标准标题:

header("Content-Type: audio/mpeg");
header("Content-Transfer-Encoding: binary");
header('Content-Length: ' . $data->getSize());
header('X-Pad: avoid browser bug');

关于php - 通过 SSL 流式传输 MP3(使用 SWF)在 Firefox 和 Chrome 中有效,但在 IE 7 或 8 中无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6939288/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com