'The media could not be loaded (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)

PROBLEM

I'm trying to download a whole html page which contains video from some URL. Then I just printing what I've downloaded. On my localhost machine everything working fine. BUT when I try to run my code on Hosting server I'm getting this error:

VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) 
The media could not be loaded, either because the server or network 
failed or because the format is not supported. 
    code: 4

QUESTION

According to logic, if it is working on localhost, but NOT on Hosting server - is it a problem of apache configuration or something?

Any help will be really appreciated.



Solution 1:[1]

According to logic, if it is working on localhost, but NOT on Hosting server I've had the same problem. Solution:

IIS->MIME Type->Add the desired video type

Hope this can help you.

Solution 2:[2]

Dears try this , its work for me on google chrome right click on the google chrome shortcut , copy this shortcut then right click the new google chrome shortcut and click properties -> shortcut and then add this at the end of the target text box

--disable-web-security --user-data-dir="c:/someFolderName"

for detail understanding fallow this link https://www.thegeekstuff.com/2016/09/disable-same-origin-policy/

its work for me

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Quasimodo's clone
Solution 2 Danial Hussain