4

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.

lomboboo
  • 1,221
  • 1
  • 12
  • 27
  • 1
    Check your mime type, according to this answer: http://stackoverflow.com/questions/34800990/video-js-contrib-hls-not-playing-hls-in-most-browsers-code4-media-err-src-no Also, please post your code. – MannfromReno Jan 26 '17 at 21:16
  • @MannfromReno, thank you for response. I'm just using function from this link to get data [http://stackoverflow.com/questions/11363022/get-url-content-php](http://stackoverflow.com/questions/11363022/get-url-content-php) . How should I define mime type ? – lomboboo Jan 26 '17 at 22:17

2 Answers2

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.

Pinke Helga
  • 6,378
  • 2
  • 22
  • 42
Q.Tong
  • 11
  • 1
0

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