comparison xml/en/docs/http/ngx_http_hls_module.xml @ 1142:8cb0c634ff97

HLS: documented the "hls_forward_args" directive.
author Yaroslav Zhuravlev <yar@nginx.com>
date Wed, 26 Mar 2014 13:51:42 +0400
parents 1594ed379f1f
children ff7defe134d8
comparison
equal deleted inserted replaced
1141:15f78372b132 1142:8cb0c634ff97
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8 8
9 <module name="Module ngx_http_hls_module" 9 <module name="Module ngx_http_hls_module"
10 link="/en/docs/http/ngx_http_hls_module.html" 10 link="/en/docs/http/ngx_http_hls_module.html"
11 lang="en" 11 lang="en"
12 rev="2"> 12 rev="3">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The <literal>ngx_http_hls_module</literal> module provides HTTP Live Streaming 17 The <literal>ngx_http_hls_module</literal> module provides HTTP Live Streaming
100 </para> 100 </para>
101 101
102 </directive> 102 </directive>
103 103
104 104
105 <directive name="hls_forward_args">
106 <syntax><literal>on</literal> | <literal>off</literal></syntax>
107 <default>off</default>
108 <context>http</context>
109 <context>server</context>
110 <context>location</context>
111 <appeared-in>1.5.13</appeared-in>
112
113 <para>
114 Adds arguments from a playlist request to URIs of fragments.
115 This may be useful for performing client authorization at the moment of
116 requesting a fragment, or when protecting an HLS stream with the
117 <link doc="ngx_http_secure_link_module.xml"/> module.
118 </para>
119
120 <para>
121 For example, if a client requests a playlist
122 <literal>http://example.com/hls/test.mp4.m3u8?a=1&amp;b=2</literal>,
123 the arguments <literal>a=1</literal> and <literal>b=2</literal>
124 will be added to URIs of fragments after the arguments
125 <literal>start</literal> and <literal>end</literal>:
126 <example>
127 #EXTM3U
128 #EXT-X-VERSION:3
129 #EXT-X-TARGETDURATION:15
130 #EXT-X-PLAYLIST-TYPE:VOD
131
132 #EXTINF:9.333,
133 test.mp4.ts?start=0.000&amp;end=9.333&amp;a=1&amp;b=2
134 #EXTINF:7.167,
135 test.mp4.ts?start=9.333&amp;end=16.500&amp;a=1&amp;b=2
136 #EXTINF:5.416,
137 test.mp4.ts?start=16.500&amp;end=21.916&amp;a=1&amp;b=2
138 #EXTINF:5.500,
139 test.mp4.ts?start=21.916&amp;end=27.416&amp;a=1&amp;b=2
140 #EXTINF:15.167,
141 test.mp4.ts?start=27.416&amp;end=42.583&amp;a=1&amp;b=2
142 #EXTINF:9.626,
143 test.mp4.ts?start=42.583&amp;end=52.209&amp;a=1&amp;b=2
144
145 #EXT-X-ENDLIST
146 </example>
147 </para>
148
149 <para>
150 If an HLS stream is protected with the
151 <link doc="ngx_http_secure_link_module.xml">ngx_http_secure_link_module</link>
152 module, <literal>$uri</literal> should not be used in the
153 <link doc="ngx_http_secure_link_module.xml" id="secure_link_md5"/>
154 expression because this will cause errors when requesting the fragments.
155 <link doc="ngx_http_map_module.xml" id="map">Base URI</link> should be used
156 instead of <literal>$uri</literal>
157 (<literal>$hls_uri</literal> in the example):
158 <example>
159 http {
160 ...
161
162 map $uri $hls_uri {
163 ~^(?&lt;base_uri&gt;.*).m3u8$ $base_uri;
164 ~^(?&lt;base_uri&gt;.*).ts$ $base_uri;
165 default $uri;
166 }
167
168 server {
169 ...
170
171 location /hls {
172 hls;
173 hls_forward_args on;
174
175 alias /var/videos;
176
177 secure_link $arg_md5,$arg_expires;
178 secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret";
179
180 if ($secure_link = "") {
181 return 403;
182 }
183
184 if ($secure_link = "0") {
185 return 410;
186 }
187 }
188 }
189 }
190 </example>
191 </para>
192
193 </directive>
194
195
105 <directive name="hls_fragment"> 196 <directive name="hls_fragment">
106 <syntax><value>time</value></syntax> 197 <syntax><value>time</value></syntax>
107 <default>5s</default> 198 <default>5s</default>
108 <context>http</context> 199 <context>http</context>
109 <context>server</context> 200 <context>server</context>