Wowza Community

Intermittent CORS Errors

I have an application that I have created in React using Video.js as the media player. We are using Wowza Streaming engine to be able to stream RTSP feeds, but are getting intermittent cors errors.

I have three video.js player instances on a single page. Sometimes all three of them load correctly. Sometimes only one or two of them load correctly. Sometimes none of them load correctly.

index.js:222 GET http://ip_address:1935/live/stream_name.stream/playlist.m3u8 403 (Forbidden)
Access to XMLHttpRequest at 'http://ip_address:1935/live/stream_name.stream/playlist.m3u8' from origin 'http://localhost:3503' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
video.es.js:149 VIDEOJS: ERROR: (CODE:2 MEDIA_ERR_NETWORK) HLS playlist request error at URL: http://ip_address:1935/live/stream_name.stream/playlist.m3u8 MediaError {code: 2, status: 0, message: "HLS playlist request error at URL: http://ip_address/stream_name.stream/playlist.m3u8", responseText: ""}

Any idea what may be causing this? I think we left all the settings at default, just added the streams and began to use them. We are using the trial version of Wowza streaming engine to see if it meets our needs, so far this would be a problem.

CORS error messages may sometimes be deceptive. I’ve noticed that some players throw CORS error messages when the requested resource (in your case the HLS playlist) isn’t available - so the player should maybe show a 404 Not Found but since the player checks the response headers before the response code, it throws a CORS error.

With that in mind, I’d check the Wowza logs on the server to see if maybe indeed there have been requests for a non-existing playlist. If this is for a stream that is supposed to be running, then it may be that the stream itself is unstable. That’s not uncommon with RTP/RTSP, e.g. when you pull a signal from an IP camera or from a mobile device over 4G/LTE (one of the reasons SRT was invented)

So according to the logs I have spent a few days troubleshooting a license limit problem. Thanks

You can reach out to sales@wowza.com @Wowza Player to find out how to get a trial license with fewer restrictions if required for your testing purposes.