Wowza Community

Alias or Media uri rewrite for .stream files

Hi,

I use .stream files with json content.

How to alias/rewrite request uri?

Use this interface instead of the StreamNameAlias AddOn or .stream files when you need programmatic control of aliasing.

IMediaStreamNameAliasProvider2 is incompatible with .stream files.

Any ideas appreciated.

Hi,

When you implement the IMediaStreamNameAliasProvider2 interface, your class replaces the .stream files as both use the interface and there can be only one alias provider assigned. You have a couple of options, depending on your workflow.

  • Call the .stream file handler from your own resolveStreamAlias methods. This will pull the JSON output into the methods and then you can return that directly or perform extra processing on it before returning.

    public String resolveStreamAlias(IApplicationInstance appInstance, String name)
    {
    	name = MediaCasterUtils.handleStreamAliasFile(appInstance, name);
      
    	// do further processing here.
    	return name;
    }
    public String resolveStreamAlias(IApplicationInstance appInstance, String name, IMediaCaster mediaCaster)
    {
    	name = MediaCasterUtils.handleStreamAliasFile(appInstance, name);
    	// do further processing here.
    	return name;
    }
    
    
  • Create & return JSON from your resolveStreamAlias methods.

    Roger.

Thanks, great!