Reputation: 1
I could play an rtmp video stream using video.js before, but today suddenly I can't play. The console throws an error:
VIDEOJS: ERROR: (CODE: 0 MEDIA_ERR_CUSTOM) MediaError {code: 0, message: ""}.
What caused MEDIA_ERR_CUSTOM
? How to fix it?
The play source is no problem, and VLC media player can play normally with it.
src: "rtmp://192.168.135.217:10064/live/res=37.10000000001311000004.IV.0.0"
type: "rtmp/flv"
<video
id="my-video"
ref={this.video}
width="800px"
height="500px"
>
<track kind="captions" />
<source src={url} type={type} />
</video>
Upvotes: 0
Views: 1490
Reputation: 169
If you're using Flash as a fallback or just using Flash and having this specific error:
VIDEOJS: ERROR: (CODE:0 MEDIA_ERR_CUSTOM) MediaError {type: "FLASHLS_ERR_CROSS_DOMAIN", origin: "flash", message: ""}
Then you need to add or configure your crossdomain.xml file into this:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*.mycompany.com" />
<allow-access-from domain="*.speedtest.net" />
</cross-domain-policy>
If it's the first time adding it on your app, this file goes in the root of the document folder on the server you want to allow access. Ex: http://speedtest.mycompany.com/crossdomain.xml
and it should be added on your routing:
@web('/crossdomain.xml', 'template/crossdomain.xml')
def index(request): pass
More info about crossdomain.xml here: https://support.ookla.com/hc/en-us/articles/234575708-What-is-crossdomain-xml-and-why-do-I-need-it-
Upvotes: 0
Reputation: 1061
Check your dev tools network tab to see if the media is being requested and returned? A few things to troubleshoot:
Upvotes: 0