我怎么能起到OSX上使用QuickTime浏览器中的GSM文件? [英] How can I play a GSM file in the browser using Quicktime on OSX?

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

问题描述

实验表明,为了获得GSM文件在QuickTime播放在Windows中,最终的重定向URL与 .gsm 结束。不幸的是,这是不够的OSX系统的测试人员,并试图MIME类型音频/ GSM 音频/ X-GSM 应用程序/ GSM 应用程序/ x-GSM 应用程序/ X- GSM (绝望)不工作。

建议的替代:使用 http://www.westhawk.co.uk/软件/ playGSM / PlayGSM.html - 但需要能够谋求/显示进度指示器。跨code GSM文件到MP3文件在服务器上,无论是之前还是当浏览器请求他们,并使用HTML5的音频播放器(+垫片),以发挥他们 - 但服务器管理员难受的是加载/存储使用

我如何说服在OSX QuickTime的浏览器插件,播放的文件?搜索了QuickTime的浏览器插件文件不成功我。

在一个相关的说明,请在页面 http://jquery.malsup.com/media/ audio.html 并加载提供的GSM文件,当直接下载到Mac并在QuickTime正确播放文件。该测试的Mac运行OSX 10.5.8。

请在下面找到嵌入code:

  $('#gsm_player)HTML('<对象类型=视频/ QuickTime的数据=+
    event.target.href +'宽度=300HEIGHT =20>'+
    '< PARAM NAME =SRCVALUE =+ event.target.href +'>'+
    '< PARAM NAME =自动播放值true>'+
    '< P>需要QuickTime来听这个文件。+
    '&所述; A HREF =htt​​p://www.apple.com/quicktime/download/'+
    目标=_空白>下载此处< / A>< / P>'+
    '< /对象>'
);


解决方案

我与苹果的技术支持重新presentative说话,谁指示我<一个href=\"http://developer.apple.com/library/mac/documentation/QuickTime/Conceptual/QTScripting_HTML/QTScripting_HTML_AIntroduction/Introduction.html#//apple_ref/doc/uid/TP40001525\"相对=nofollow> HTML脚本指南的QuickTime 和<一个href=\"https://developer.apple.com/library/mac/#documentation/quicktime/Conceptual/QTScripting_JavaScript/aQTScripting_Javascro_AIntro/Introduction%20to%20JavaScript%20QT.html#//apple_ref/doc/uid/TP40001526\"相对=nofollow> JavaScript脚本指南的QuickTime 的相关文档。

我是能够解决由 zlib.output_com pression 在PHP中关闭,并提供了HTTP 的Content-Length我的问题头。我不提供一个假扩展名的文件,但现在用音频/ X-GSM 内容类型头。 QuickTime的似乎是细带或不带内容处置:附件; ... 头。现在我的文件OSX和Windows播放罚款。

值得注意是 HTTPS讨论://组。 google.com/forum/?fromgroups=#!topic/iphonewebdev/-5x2QNVCgII ,特别是在<一的源$ C ​​$ C提href=\"http://$c$c.google.com/p/asterisk-voicemail-for-iphone/source/browse/trunk/iphone/i_functions.php#29\" rel=\"nofollow\">http://$c$c.google.com/p/asterisk-voicemail-for-iphone/source/browse/trunk/iphone/i_functions.php#29.它包含了最好的206处理器我见过之一,并把我在正确的道路上,并可能会比为我做什么工作更有帮助(我并不需要206处理,但你可能)。

请找供应该文件的文件下载脚本的一部分如下:

 头('内容类型:音频/ X-GSM');
标题(内容处置:附件;文件名= file.gsm);的ini_set(zlib.output_com pression,关);
标题(内容长度:.strlen($文件));回声$文件;
出口;

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.

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.

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.

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>'
);

解决方案

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.

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.

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天全站免登陆