video-js自定义字体在Firefox中不起作用 [英] video-js custom font not working in Firefox
问题描述
$ b
你会看到video-js的自定义字体isn'工作。在Chrome中工作正常。
任何想法都将不胜感激!
Watto:)
Firefox具有非常严格的跨域策略。这包括您的网站的子域(甚至是www)。
在css中,你可以用 http://jamhouse.com.au/templates/gk_fest/js/html5/font/vjs.XYZ (注意不是www。)而在你发布的链接上是< a href =http://www.jamhouse.com.au =nofollow> http://www.jamhouse.com.au 如果你转到 http://jamhouse.com.au 你的字体工作。
您有以下几种选择: 对于真正的跨域
在你的.htaccess或httpd.con中设置Access-Control-
对于Apache: http://davidwalsh.name/cdn-fonts
对于IIS: http://deserialized.com/iis/serving-web-fonts-cross-domain-with-iis/
- 或 -
$ b 为您的情况推荐
$ b
你可以通过url(font / vjs.XYZ)相对引用字体,因为这将使用你所在的任何域名/子域名(www或者non-www)。
- 或 - 您可以执行 http://www.jamhouse.com.au 或 http://jamhouse.com.au ,并以您选择的方式引用字体。
对于Apache: http://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml
对于IIS: http://forums.iis.net/t/1154053.aspx/1
$ p
$ b $您可以直接在css中嵌入字体(我已经选择我的video.js安装)
在css中嵌入字体 - http://blog.patdavid.net/2012/08/embedding-fonts-with-css-and-base64.html
在专家模式下,您可以选择base64编码。 http://www.fontsquirrel.com/tools/webfont-generator (我限制了成功与他们的编码,戏剧三角(\e001)没有显示出来。)
在base64中编码文件 http://www.motobit.com/util/base64-decoder-encoder.asp (确保输出全部打开一行与
Have a look here with Firefox (I've got 22.0):
You'll see that the video-js custom font isn't working. Works fine in Chrome.
Any ideas would be greatly appreciated!
Watto :)
Firefox has an extremely tight Cross-Domain policy. This includes sub-domains of your site (even www).
In your css you reference the fonts with http://jamhouse.com.au/templates/gk_fest/js/html5/font/vjs.XYZ (notice no www.) while on the link you posted it is http://www.jamhouse.com.au If you goto just http://jamhouse.com.au your fonts work.
You have a few options:
Recommended for true cross domain
Either set up an Access-Control-Allow-Origin in your .htaccess or httpd.con
For Apache: http://davidwalsh.name/cdn-fonts
For IIS: http://deserialized.com/iis/serving-web-fonts-cross-domain-with-iis/
-- OR --
Recommended for your case
you can reference the fonts relatively with url(font/vjs.XYZ)... as this will use whichever domain/sub-domain you are on (www or non-www)
-- OR --
You can enforce either http://www.jamhouse.com.au or http://jamhouse.com.au and reference the fonts with whichever way you choose.
For Apache: http://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml
For IIS: http://forums.iis.net/t/1154053.aspx/1
-- OR --
You can embed the fonts directly in the css (which I've opted for my video.js installations)
Embedding fonts in css - http://blog.patdavid.net/2012/08/embedding-fonts-with-css-and-base64.html
Under expert mode you can choose base64 Encoded. http://www.fontsquirrel.com/tools/webfont-generator (I had limited success with their encoding, the play triangle (\e001) was not showing up.)
Encoding files in base64 http://www.motobit.com/util/base64-decoder-encoder.asp (make sure the output is all on one line with
这篇关于video-js自定义字体在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!