Change relative URL of segments for HLS-VOD
Simple Version:
Can I change the URL of the TS segments delivered by the hlshttp_module in any way, or is it always relative to the requested m3u8 URL?
Long Version:
To try and protect my content from being accessed by third parties I want to use mod-auth-token, with a client inserted token in the request for the variant m3u8, and a server generated token in the HLS m3u8.
My clients generate a token using a shared secret, and request the variant m3u8 from:
https://myserver/hls-manifest/<clienttoken>/<hextime>/path/to/folder/manifest.m3u8
This page is served dynamically (using php), and does not really have anything to do with FMS even though it is running in the same Apache instance. The m3u8 is generated with server tokens in the m3u8 URLs somethign like this:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=10240000,CODECS="mp4a.40.2, avc1.42001f"
I have installed mod-auth-token, and configured it on a LocationMatch for "^/hld-vod/(.*)\.m3u8$". Everything up to this works perfectly, and I can request both m3u8 playlists successfully. The problem is that the content of the m3u8 (the ts fragment URLs) are relative to the URL of the m3u8.
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:NO
#EXT-X-VERSION:2
#EXT-X-KEY:METHOD=AES-128,URI="https://myserver/hls-key/vodkey.bin",IV=0X560417e9155f2f2cb1fb9410397db72e
#EXT-X-TARGETDURATION:10
#EXTINF:10,
filename_1024k.mp4Frag1Num0.ts
The player is attempting to request files from:
I want this to look more like this:
https://myserver/hls-vod/path/to/folder/filename_1024k.mp4Frag1Num0.ts
or even this:
http://mycacheserver/hls-vod/path/to/folder/filename_1024k.mp4Frag1Num0.ts
So the m3u8 needs to look more like this:
#EXT-X-TARGETDURATION:10
#EXTINF:10,
http://mycacheserver/hls-vod/path/to/folder/filename_1024k.mp4Frag1Num0.ts
I can think of lost of placeswhere this would have useful applications. There does not appear to be anything in the Developer documents which would help here. Does anybody have a suggestion for something I can try?
