

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# MediaTailor DASH 隱含工作階段初始化
<a name="manifest-query-parameters-dash-implicit-session-initialization"></a>

AWS Elemental MediaTailor 會為用戶端建立工作階段，並在用戶端在沒有工作階段的情況下提出資訊清單請求時，使用查詢參數將其重新導向。下列範例顯示此請求格式：

```
GET /v1/dash/{{111122223333}}/{{originId}}/index.mpd?manifest.test=123&other=456
```

MediaTailor 會為用戶端建立工作階段，並使用查詢參數將其重新導向：

```
/v1/dash/{{111122223333}}/{{originId}}/index.mpd?sessionId={{session}}&test=123
```

**DASH 中的參數應用程式**  
DASH 資訊清單回應包含各種位置的查詢參數，包括內容區段、廣告區段和初始化 URLs。MediaTailor 會將參數套用至下列項目：
+ DASH 資訊清單位置元素
+ SegmentTemplate 初始化屬性
+ SegmentTemplate 媒體屬性
+ 內容區段 URLs
+ 廣告客群 URLs

當用戶端發出請求時，MediaTailor 會以類似下列範例的 DASH 資訊清單回應。第一個期間是內容期間，因此 MediaTailor 不會在那裡插入資訊清單查詢參數。在第二個期間，即廣告期間，MediaTailor 會將資訊清單查詢參數插入 `SegmentTemplate`元素的 `initialization` 屬性。 `media``Location` 元素也具有資訊清單查詢參數。

```
<?xml version="1.0" encoding="UTF-8"?>
<MPD availabilityStartTime="2018-07-27T09:48:23.634000+00:00" id="201" minBufferTime="PT30S" minimumUpdatePeriod="PT15S" profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2023-02-14T23:37:43" suggestedPresentationDelay="PT25.000S" timeShiftBufferDepth="PT56.997S" type="dynamic" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:scte35="urn:scte:scte35:2013:xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd">
    <BaseURL>https://origin.com/contentSegments/</BaseURL>
    <Location>https://mediatailor.com/v1/dash/{{111122223333}}/{{originId}}/index.mpd?test=123&aws.sessionId={{session}}</Location>
    <Period duration="PT29.963S" id="28737823" start="PT143732873.178S">
        <AdaptationSet bitstreamSwitching="true" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
            <Representation bandwidth="2200000" codecs="avc1.640029" frameRate="30000/1001" height="540" id="1" width="960">
                <SegmentTemplate initialization="index_video_7_0_init.mp4?m=1611174111" media="index_video_7_0_$Number$.mp4?m=1611174111" presentationTimeOffset="4311986195351" startNumber="28737828" timescale="30000">
                    <SegmentTimeline>
                        <S d="180180" t="4311986911066"/>
                        <S d="3003" t="4311987091246"/>
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
    <Period id="28737829_1" start="PT39925H48M23.141S">
        <BaseURL>https://mediatailor.com/v1/dashsegment/{{{{111122223333}}}}/{{originId}}/{{session}}/28737829/28737829_1/</BaseURL>
        <AdaptationSet bitstreamSwitching="false" frameRate="30000/1001" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
            <SegmentTemplate startNumber="1" timescale="90000"/>
            <Representation bandwidth="2200000" codecs="avc1.64001f" height="540" id="1" width="960">
                <SegmentTemplate initialization="asset_540_2_0init.mp4?test=123" media="asset_540_2_0_$Number%09d$.mp4?test=123" startNumber="1" timescale="90000">
                    <SegmentTimeline>
                        <S d="180180" r="6" t="0"/>
                        <S d="87087" t="1261260"/>
                    </SegmentTimeline>
                </SegmentTemplate>
            </Representation>
        </AdaptationSet>
    </Period>
</MPD>
```