我有一個帶有<video>元素的簡單頁面,我正在使用我使用 python ( python -m http.server)運行的簡單服務器對其進行測驗。我也嘗試過使用 JavaScript http-server,但得到了相同的結果。
我現在主要在 Firefox 中進行測驗,但它曾經在 Chrome 和 Opera 中作業。但是,今天我嘗試打開該頁面,但它只能在 Firefox 中運行。該視頻不會出現在 Chrome、Opera 和 Edge 中。當我轉到控制臺時,出現以下問題:
鉻合金:
DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/iframe_handler.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load source map: Could not load content for chrome-extension://fheoggkfdfchfphceeifdbepaooicaho/sourceMap/chrome/content.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
歌劇:
Unchecked runtime.lastError: Invalid color name.
Error handling response: TypeError: Cannot destructure property 'h' of 'undefined' as it is undefined.
at chrome-extension://hhckidpbkbmoeejbddojbdgidalionif/components/video_toolbar.js:310:46
Failed to load resource: the server responded with a status of 404 (File not found)
邊緣:
甚至不顯示問題。
如果我直接打開html檔案,不用服務器,視頻在所有瀏覽器中都會出現,但我也顯示.vtt字幕,所以我需要用服務器測驗。
我擁有的是一個非常簡單的<video>元素:
<div class="video">
<video id="vid" controls>
<source src="some_video.mp4" type="video/mp4">
<track kind="subtitles" src="some_captions.vtt" srclang="en" default>
</video>
</div>
我讀過我應該禁用擴展程式,但我真的沒有在這些瀏覽器中安裝任何擴展程式。我還讀到我應該禁用 JavaScript 和 CSS 源映射,但這并沒有真正起作用。
uj5u.com熱心網友回復:
在這里嘗試過,視頻與我的 test.html 位于同一檔案夾中。mp4 視頻正在處理 firefox、chrome 和 edge。也許你的網路服務器有問題?
Failed to load resource: the server responded with a status of 404 (File not found)
激怒我 - 按 F12,切換到網路并查看它試圖打開視頻的位置(也許您需要先單擊播放)。右鍵單擊它 - 在新選項卡中打開以檢查 url 以及視頻是否正常作業
uj5u.com熱心網友回復:
我使用 Visual Studio 在 localhost 中測驗代碼,一開始出現錯誤Failed to load resource: the server responded with a status of 404 (File not found)。視頻顯示,但字幕不顯示,.vtt找不到檔案。
然后我找到了問題的原因:.vtt沒有添加檔案MIME型別。然后我在Web.config 中添加 MIME 型別,如下所示,視頻和字幕在所有瀏覽器中都能正常作業:
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".vtt" />
<mimeMap fileExtension=".vtt" mimeType="text/vtt" />
</staticContent>
</system.webServer>
</configuration>
您的情況的問題也是Failed to load一些檔案并與字幕<track>元素有關,所以我懷疑它是否也是由未添加檔案 MIME 型別引起的。您可以檢查站點中加載失敗的檔案并添加相應的 MIME 型別以查看是否可以解決問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/313030.html
標籤:javascript html 谷歌浏览器 microsoft-edge 歌剧
