Video format or MIME type is not supported

前端 未结 4 1338
耶瑟儿~
耶瑟儿~ 2021-02-05 18:07

This is the relevant code to run video:

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 18:13

    In my case, this error:

    Video format or MIME type is not supported.

    Was due to the CSP in my .htaccess that did not allow the content to be loaded. You can check this by opening the browser's console and refreshing the page.

    Once I added the domain that was hosting the video in the media-src part of that CSP, the console was clean and the video was loaded properly. Example:

    Content-Security-Policy: default-src 'none'; media-src https://myvideohost.domain; script-src 'self'; style-src 'unsafe-inline' 'self'
    

提交回复
热议问题