How to Access-Control-Allow-Origin to playlist.m3u8 file?

I would like to read the playlist file from a domain different to the one that Wowza is running on. I’m currently doing this via a jquery get request to path/to/playlist.m3u8. This works fine when running from a file but when running from localhost I get this:

XMLHttpRequest cannot load http://slalom.local:1935/timedmetatest/mp4:sample.mp4/playlist.m3u8. 
Origin http://localhost is not allowed by Access-Control-Allow-Origin.

Hi

There is a file called crossdomain.xml and a file called clientaccesspolicy.xml have you made changes in ether of these files?

crossdomain.xml is set to allow all as the default which is why I ask.

clientaccesspolicy.xml is set to allow all as the default as well.

Please check these files as this may not have been the default (to allow all) in the past.

Jason

See IHTTPStreamerSession.setUserHTTPHeader

Charlie

HTTP origin stream is a possible (maybe) future feature of Wowza 3, but I don’t have any time frame. At present it is not supported, though not impossible. I’m not sure, but I don’t think your approach of extending Wowza will work, though I am not sure what to suggest, an external approach perhaps.

Richard

Hi

No that’s correct,

I think if that’s not the case then you must have a policy on the local server which stops you from getting data from outside the local server.

Unfortunately I don’t know where this policy would be for you locally.

Jason

Hi Jason thanks for your reply.

The crossdomain.xml file currently reads:

<cross-domain-policy>
	<allow-access-from domain="*" />
	<site-control permitted-cross-domain-policies="all"/>
</cross-domain-policy>

Is there anything I should add to this?

Hi

Is there a way I can simply do ‘resp.setHeader(“Access-Control-Allow-Origin”, “*”);’ in the HTTPProvider class responsible for the playlist.m3u8 hosting?

Will do, thanks Charlie

As far I’m aware, IHTTPStreamerSession is passed as an argument to onHTTPSessionCreate. I’m not dealing with sessions; I would just like to be able to access the playlist.m3u8 file. As the error messages are point to Access-Control-Allow-Origin, I have a strong suspicion its a case of setting the header of the HTTPProvider that is responsible for the playlist.m3u8 response output.

Can anyone point me in the right direction as to where or how to obtain the playlist.m3u8 file before it is streamed?

We’re using Wowza with Node.js. Node is taking care of the majority of the HTTP requests. The timed metadata is what we’re most interested in and after discovering that getting timed meta of HLS streams is restricted to native iOS apps we’re trying everything possible to work out a way of synchronising live material with html content.

I found this article very helpful: https://www.wowza.com/docs/how-to-debug-timed-data-events-id3-tags-from-apple-hls-streams-in-ios-devices

This is question not the answer

@Jason Hilton

I am having the same issue, where I am not able to play the video on demand in only HLS mode , the RTMP and DASH works fine for me , when I change the protocol to HLS ,it gives me the "Error that is coming is -> Cannot load M3U8: Crossdomain access denied

version of wowza is - > Wowza Streaming Engine 4 Perpetual Pro Edition 4.1.1

Hi,
This is an old thread and a few things have changed since the original question was posted. We now how this article that you can follow, however this requires Wowza Streaming Engine 4.4.0 and above and so I recommend updating to the latest version.

Regards,
Jason Hilton
Wowza Media Systems Support Team