资源解释为 TextTrack 但使用 MIME 类型传输 text/plain
Resource interpreted as TextTrack but transferred with MIME type text/plain
你好朋友,当我在视频标签中添加字幕跟踪标签然后在 chrome 浏览器的控制台中出现此警告
Resource interpreted as TextTrack but transferred with MIME type text/plain: "http://localhost/video/media/View_From_A_Blue_Moon_Trailer-HD.en.vtt".
但我的 html 页面和字幕工作正常
我正在使用 xampp 和本地主机的 apache 网络服务器。
经过我的研究我提供了这个解决方案,因为我使用的是 apache 网络服务器,所以首先我在存储 .vtt
类型文件的根目录中创建了 .htaccess
文件。
例如:H:\xampp\htdocs\video\media\.htaccess
然后我在 .htaccess
文件中插入 AddType text/vtt .vtt
这个内容。
我从 Chrome 浏览器和刷新选项卡中清除了缓存,然后 .vtt
MimeType 警告消失了。
If you want for other web server you can follow this Answer
你好朋友,当我在视频标签中添加字幕跟踪标签然后在 chrome 浏览器的控制台中出现此警告
Resource interpreted as TextTrack but transferred with MIME type text/plain: "http://localhost/video/media/View_From_A_Blue_Moon_Trailer-HD.en.vtt".
但我的 html 页面和字幕工作正常
经过我的研究我提供了这个解决方案,因为我使用的是 apache 网络服务器,所以首先我在存储 .vtt
类型文件的根目录中创建了 .htaccess
文件。
例如:H:\xampp\htdocs\video\media\.htaccess
然后我在 .htaccess
文件中插入 AddType text/vtt .vtt
这个内容。
我从 Chrome 浏览器和刷新选项卡中清除了缓存,然后 .vtt
MimeType 警告消失了。
If you want for other web server you can follow this Answer