如何在 OSX 上使用 Quicktime 在浏览器中播放 GSM 文件? [英] How can I play a GSM file in the browser using Quicktime on OSX?

查看:35
本文介绍了如何在 OSX 上使用 Quicktime 在浏览器中播放 GSM 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实验表明,为了让 GSM 文件在 Windows 机器上的 Quicktime 中播放,最终的重定向 url 必须以 .gsm 结尾.不幸的是,这对于测试人员拥有的 OSX 系统来说是不够的,并且尝试 MIME 类型 audio/gsmaudio/x-gsmapplication/gsmapplication/x-gsmapplication/x-GSM(绝望)不起作用.

Experimentation reveals that in order to get GSM files to play in Quicktime on a windows box, the final redirect url has to end with .gsm. Unfortunately this is insufficient for the OSX system that the testers have, and attempting MIME types audio/gsm, audio/x-gsm, application/gsm, application/x-gsm, and application/x-GSM (desperate) does not work.

建议的替代方案:使用 http://www.westhawk.co.uk/software/playGSM/PlayGSM.html - 但需要能够寻找/显示进度指示器.在服务器上将 GSM 文件转码为 MP3 文件,无论是在浏览器请求它们之前还是在它们请求它们时,并使用 HTML5 音频播放器 (+shim) 播放它们 - 但服务器管理员对加载/存储使用感到不舒服.

Proposed alternatives: Use http://www.westhawk.co.uk/software/playGSM/PlayGSM.html - but needs to be able to seek / display progress indicator. Transcode GSM files to MP3 files on the server, either before or when browser requests them, and use HTML5 audio player (+shim) to play them - but server admins uncomfortable with the load / storage use.

如何说服 OSX 上的 Quicktime 浏览器插件播放文件?搜索 Quicktime 浏览器插件的文档对我来说没有成功.

How can I convince the Quicktime browser plugin on OSX to play the file? Searching for documentation for the Quicktime browser plugin was not successful for me.

在相关说明中,页面位于 http://jquery.malsup.com/media/audio.html 确实加载了提供的 GSM 文件,并且该文件在直接下载到 Mac 时在 Quicktime 中可以正确播放.测试 Mac 运行的是 OSX 10.5.8.

In a related note, the page at http://jquery.malsup.com/media/audio.html does load the GSM file provided, and the file when downloaded directly to the Mac does play correctly in Quicktime. The test Mac is running OSX 10.5.8.

请在下面找到嵌入代码:

Please find the embed code below:

$('#gsm_player').html('<object type="video/quicktime" data="'+
    event.target.href+'" width="300" height="20">'+
    '<param name="src" value="'+ event.target.href+'">'+
    '<param name="autoplay" value"true">'+
    '<p>QuickTime is required to listen to this file.'+
    '<a href="http://www.apple.com/quicktime/download/" '+
    'target="_blank">Download Here</a></p>'+
    '</object>'
);

推荐答案

我与 Apple 的技术支持代表进行了交谈,他将我引导至 QuickTime 的 HTML 脚本指南JavaScript 脚本指南QuickTime 用于文档.

I spoke with a tech support representative at Apple, who directed me to HTML Scripting Guide for QuickTime and JavaScript Scripting Guide for QuickTime for documentation.

通过在 PHP 中关闭 zlib.output_compression 并提供 HTTP Content-Length 标头,我能够解决我的问题.我没有提供带有假扩展名的文件,而是使用 audio/x-gsm 作为 Content-Type 标头.无论是否带有 Content-disposition: attachment;... 标头,Quicktime 似乎都很好.我的文件现在可以在 OSX 和 Windows 中正常播放.

I was able to solve my problem by turning off zlib.output_compression in PHP, and supplying the HTTP Content-Length header. I am not serving the file with a fake extension, but am using audio/x-gsm as the Content-Type header. Quicktime appears to be fine with or without the Content-disposition: attachment;... header. My files now play fine in OSX and Windows.

值得一提的是 https://groups 上的讨论.google.com/forum/?fromgroups=#!topic/iphonewebdev/-5x2QNVCgII,特别是在 http://code.google.com/p/asterisk-voicemail-for-iphone/source/browse/trunk/iphone/i_functions.php#29.它包含我见过的最好的 206 处理程序之一,让我走上了正确的道路,可能比做对我有用的事情更有帮助(我不需要 206 处理,但你可能需要).

Worth note is the discussion at https://groups.google.com/forum/?fromgroups=#!topic/iphonewebdev/-5x2QNVCgII, particularly the mention of the source code at http://code.google.com/p/asterisk-voicemail-for-iphone/source/browse/trunk/iphone/i_functions.php#29. It contains one of the best 206 handlers I've seen, and put me on the right path and might be more helpful than doing exactly what worked for me (I didn't need the 206 handling, but you might).

请在下面找到提供文件的文件下载器脚本部分:

Please find below the portion of the file downloader script which serves the file:

header('Content-Type: audio/x-gsm');
header("Content-disposition: attachment; filename=file.gsm");

ini_set("zlib.output_compression", "Off");
header("Content-Length: ".strlen($file));

echo $file;
exit;

这篇关于如何在 OSX 上使用 Quicktime 在浏览器中播放 GSM 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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