如题,html5的视频,下有 track 标签放字幕,字幕文件在七牛。提示crossorigin,被block了。
Text track from origin 'http://userlib.771dian.com' has been blocked from loading: Not at same origin as the document, and parent of track element does not have a 'crossorigin' attribute. Origin 'https://771dian.com' is therefore not allowed access.
看了下七牛下载是支持cors的,header中已经设置好了。但使用track标签读取七牛上的字幕文件,依然给出以上提示。
更新: 已解决,都是https惹的祸...网站启用了https,如果字幕不跨域,视频可以像图片一样走Http即可。但如果字幕要跨域,连视频一起,必须全走Https。
七牛对下载跨域,默认是不支持,可以通过配置支持。在你自己的空间中上传 crossdomain.xml 就可以了,参考这里:
https://up.qbox.me/crossdomain.xml