annotate xml/ru/docs/http/ngx_http_hls_module.xml @ 1228:0ffd5caf0766

HLS: corrected the "appeared-in" version for hls_forward_args.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 13 May 2014 11:30:59 +0400
parents ff7defe134d8
children c20c2b945f8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
1 <?xml version="1.0"?>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
2
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
3 <!--
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
4 Copyright (C) Nginx, Inc.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
5 -->
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
6
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
8
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
9 <module name="Module ngx_http_hls_module"
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
10 link="/ru/docs/http/ngx_http_hls_module.html"
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
11 lang="ru"
1228
0ffd5caf0766 HLS: corrected the "appeared-in" version for hls_forward_args.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1147
diff changeset
12 rev="4">
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
13
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
14 <section id="summary">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
15
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
16 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
17 Модуль <literal>ngx_http_hls_module</literal> обеспечивает серверную поддержку
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
18 протокола HTTP Live Streaming (HLS) для файлов в формате H.264/AAC.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
19 Такие файлы обычно имеют расширения
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
20 <path>.mp4</path>, <path>.m4v</path> и <path>.m4a</path>.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
21 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
22
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
23 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
24 nginx поддерживает два вида URI для каждого MP4-файла:
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
25 <list type="bullet">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
26
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
27 <listitem>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
28 URI плейлиста, имеющий расширение “<literal>.m3u8</literal>” и принимающий
1130
3c6d351a1eef HLS: corrected translation in the summary section.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1128
diff changeset
29 необязательный аргумент “<literal>len</literal>”,
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
30 который задаёт длину фрагмента в секундах;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
31 </listitem>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
32
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
33 <listitem>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
34 URI фрагмента, имеющий расширение “<literal>.ts</literal>” и принимающий
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
35 аргументы “<literal>start</literal>” и “<literal>end</literal>”, которые
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
36 задают границы фрагмента в секундах.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
37 </listitem>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
38
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
39 </list>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
40 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
41
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
42 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
43 <note>
1128
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
44 Модуль доступен как часть
1594ed379f1f De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents: 1115
diff changeset
45 <commercial_version>коммерческой подписки</commercial_version>.
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
46 </note>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
47 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
48
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
49 </section>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
50
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
51
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
52 <section id="example" name="Пример конфигурации">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
53
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
54 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
55 <example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
56 location /video/ {
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
57 hls;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
58 hls_fragment 5s;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
59 hls_buffers 10 10m;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
60 hls_mp4_buffer_size 1m;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
61 hls_mp4_max_buffer_size 5m;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
62 alias /var/video/;
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
63 }
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
64 </example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
65 В такой конфигурации для файла “<path>/var/video/test.mp4</path>”
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
66 будут поддерживаться следующие URI:
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
67 <example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
68 http://hls.example.com/video/test.mp4.m3u8?len=8.000
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
69 http://hls.example.com/video/test.mp4.ts?start=1.000&amp;end=2.200
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
70 </example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
71 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
72
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
73 </section>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
74
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
75
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
76 <section id="directives" name="Директивы">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
77
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
78 <directive name="hls">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
79 <syntax/>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
80 <default/>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
81 <context>location</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
82
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
83 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
84 Включает HLS-поток во вложенном location.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
85 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
86
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
87 </directive>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
88
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
89
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
90 <directive name="hls_buffers">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
91 <syntax><value>число</value> <value>размер</value></syntax>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
92 <default>8 2m</default>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
93 <context>http</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
94 <context>server</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
95 <context>location</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
96
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
97 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
98 Задаёт максимальное <value>число</value> и <value>размер</value> буферов,
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
99 которые используются для чтения и записи блоков данных.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
100 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
101
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
102 </directive>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
103
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
104
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
105 <directive name="hls_forward_args">
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
106 <syntax><literal>on</literal> | <literal>off</literal></syntax>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
107 <default>off</default>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
108 <context>http</context>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
109 <context>server</context>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
110 <context>location</context>
1228
0ffd5caf0766 HLS: corrected the "appeared-in" version for hls_forward_args.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1147
diff changeset
111 <appeared-in>1.5.12</appeared-in>
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
112
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
113 <para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
114 Добавляет аргументы из запроса плейлиста в URI фрагментов.
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
115 Это может быть необходимо для авторизации клиента
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
116 во время запроса фрагментов, а также для защиты HLS-потока с помощью
1147
ff7defe134d8 HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents: 1142
diff changeset
117 модуля
ff7defe134d8 HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents: 1142
diff changeset
118 <link doc="ngx_http_secure_link_module.xml">ngx_http_secure_link_module</link>.
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
119 </para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
120
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
121 <para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
122 Например, если клиент запрашивает плейлист
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
123 <literal>http://example.com/hls/test.mp4.m3u8?a=1&amp;b=2</literal>,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
124 то аргументы <literal>a=1</literal> и <literal>b=2</literal>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
125 будут добавлены в URI фрагментов после аргументов
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
126 <literal>start</literal> и <literal>end</literal>:
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
127 <example>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
128 #EXTM3U
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
129 #EXT-X-VERSION:3
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
130 #EXT-X-TARGETDURATION:15
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
131 #EXT-X-PLAYLIST-TYPE:VOD
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
132
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
133 #EXTINF:9.333,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
134 test.mp4.ts?start=0.000&amp;end=9.333&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
135 #EXTINF:7.167,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
136 test.mp4.ts?start=9.333&amp;end=16.500&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
137 #EXTINF:5.416,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
138 test.mp4.ts?start=16.500&amp;end=21.916&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
139 #EXTINF:5.500,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
140 test.mp4.ts?start=21.916&amp;end=27.416&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
141 #EXTINF:15.167,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
142 test.mp4.ts?start=27.416&amp;end=42.583&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
143 #EXTINF:9.626,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
144 test.mp4.ts?start=42.583&amp;end=52.209&amp;a=1&amp;b=2
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
145
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
146 #EXT-X-ENDLIST
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
147 </example>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
148 </para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
149
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
150 <para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
151 Если HLS-поток защищён с помощью модуля
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
152 <link doc="ngx_http_secure_link_module.xml">ngx_http_secure_link_module</link>,
1147
ff7defe134d8 HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents: 1142
diff changeset
153 переменную <var>$uri</var> не следует использовать в выражении
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
154 <link doc="ngx_http_secure_link_module.xml" id="secure_link_md5"/>,
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
155 так как это приведёт к ошибкам при запросах к фрагментам.
1147
ff7defe134d8 HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents: 1142
diff changeset
156 Вместо <var>$uri</var> следует использовать
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
157 <link doc="ngx_http_map_module.xml" id="map">базовую часть URI</link>
1147
ff7defe134d8 HLS: fixed fallouts in the previous edition.
Ruslan Ermilov <ru@nginx.com>
parents: 1142
diff changeset
158 (<var>$hls_uri</var> в примере):
1142
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
159 <example>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
160 http {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
161 ...
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
162
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
163 map $uri $hls_uri {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
164 ~^(?&lt;base_uri&gt;.*).m3u8$ $base_uri;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
165 ~^(?&lt;base_uri&gt;.*).ts$ $base_uri;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
166 default $uri;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
167 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
168
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
169 server {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
170 ...
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
171
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
172 location /hls {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
173 hls;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
174 hls_forward_args on;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
175
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
176 alias /var/videos;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
177
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
178 secure_link $arg_md5,$arg_expires;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
179 secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret";
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
180
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
181 if ($secure_link = "") {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
182 return 403;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
183 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
184
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
185 if ($secure_link = "0") {
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
186 return 410;
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
187 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
188 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
189 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
190 }
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
191 </example>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
192 </para>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
193
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
194 </directive>
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
195
8cb0c634ff97 HLS: documented the "hls_forward_args" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1130
diff changeset
196
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
197 <directive name="hls_fragment">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
198 <syntax><value>время</value></syntax>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
199 <default>5s</default>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
200 <context>http</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
201 <context>server</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
202 <context>location</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
203
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
204 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
205 Задаёт длину фрагмента по умолчанию для всех URI в плейлисте,
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
206 запрошенных без аргумента “<literal>len</literal>”.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
207 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
208
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
209 </directive>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
210
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
211
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
212 <directive name="hls_mp4_buffer_size">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
213 <syntax><value>размер</value></syntax>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
214 <default>512k</default>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
215 <context>http</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
216 <context>server</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
217 <context>location</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
218
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
219 <para>
1115
65bc9d1ec234 MP4 and HLS: updated the "buffer size" phrase for _buffer_size directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1111
diff changeset
220 Задаёт начальный <value>размер</value> буфера, используемого для
1111
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
221 обработки MP4-файлов.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
222 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
223
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
224 </directive>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
225
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
226
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
227 <directive name="hls_mp4_max_buffer_size">
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
228 <syntax><value>размер</value></syntax>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
229 <default>10m</default>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
230 <context>http</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
231 <context>server</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
232 <context>location</context>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
233
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
234 <para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
235 В ходе обработки метаданных может понадобиться буфер большего размера.
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
236 Его <value>размер</value> не может превышать указанного,
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
237 иначе nginx вернёт серверную ошибку
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
238 <http-status code="500" text="Internal Server Error"/>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
239 и запишет в лог следующее сообщение:
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
240 <example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
241 "/some/movie/file.mp4" mp4 moov atom is too large:
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
242 12583268, you may want to increase hls_mp4_max_buffer_size
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
243 </example>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
244 </para>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
245
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
246 </directive>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
247
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
248 </section>
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
249
9c766ddc3535 HLS: Translated the "http_ngx_http_hls_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff changeset
250 </module>