Hi I am trying to figure out a way to add a simple header Access-Control-Allow-Origin: “*” to the playlist.m3u8 and other playlist files or the whole server for that matter, whatever works as long as I can set the header. I am using WowzaStreamingEngine-4.0.3 and I simply need to add a cors header to the playlist file, the connections on port 1935, or any request to the wowza client. I found a few other threads that look like they would work, just not quite. I tried to add a new .jar file to the server /lib/ module and enable it in the back end of the server. Kind of like what this guy is doing here.
I created a file called headers.class which contains this code.
package com.vermontinternetdesign.module;
import com.wowza.wms.module.*;
import com.wowza.wms.client.*;
import com.wowza.wms.amf.*;
import com.wowza.wms.request.*;
public class httpHeader extends ModuleBase
{
public void onAppStart(IApplicationInstance appInstance)
{
}
public void onHTTPSessionCreate(IHTTPStreamerSession httpSession){
getLogger().info("ModuleHTTPTestPlayStart.onHTTPSessionCreate: "+httpSession.getSessionId());
httpSession.setUserHTTPHeader("WowzaTestHeader", "Wowza Rocks");
}
public void doSomething(IClient client, RequestFunction function,
AMFDataList params)
{
}
}
then I created a .jar file using this command from inside the /lib/
jar cf httpHeader.jar headers.class
Than I went to the application in the admin section and added a module
named httpHeader and gave it a qualified class name of
com.vermontinternetdesign.module.httpHeader
This did not produce a header for me unfortunely.
We are working on a very important project with the WowzaStreamingEngine however, I have tried 50 different ways to sunday in order to get a simple header sent so that I can access the playlist through an ajax request. Seems like a pretty remedial feature which should have a simple way to turn a cors header on and off. As the WowzaStreamingEngine is about useless to us if we cannot find a solution to this. I am not a Java programmer, I am a php programmer. However, if someone can show me a step by step way of adding this header to Wowza then the software will be very useful to me and I promise to recommend wowza to my future clients. I really don’t want to have to switch to another Engine at this point in time. As adding a header to a request is usually a very simple procedure. Thank you for reading this and I hope someone can point me in the right direction. I have already looked the internet up and down and looked at the other threads. None of which helped me solve the problem. They pointed me in the right direction. However, I still don’t have a header and this is holding up an entire project and client is getting ancy because I recommended this software. Not thinking it was going to take an act of God to display a cors header.The crossdoman.xml and accesspolicy.xml are all set up to allow these connections. All I need to know is how to send a header any header and that is it. I don’t program in Java but, I do program in other languages so I need a step by step thank you very much and if you can provide a solution for me. I might love you so much that I will give you some paid work to do. As I have several other people who want similar systems set up, and if we can get past this issue. It will generate a lot of work to do.
Thank you In advance,
John Anderson