2016-12-15 65 views

回答

2

Adob​​e Media Server使用Apache HTTP Server。要啓用CORS你需要下面的行添加到Apache HTTP Server配置文件:

Header set Access-Control-Allow-Origin "your_page_origin" 

您需要的頁面,這將使請求,或與origin取代「your_page_origin」,「*」,以允許從任何請求域。有關更多信息,請查詢Enable CORS web siteConfiguring Apache HTTP Server documentation page

此外,您可以使用HTML video標記來嵌入HLS。當用戶代理向video源發出請求時,默認情況下它不會發送Origin標頭,並且它不會在服務器響應中搜索與CORS相關的標頭。在這種情況下,您不需要更改服務器配置。蘋果公司建議使用video標籤在其introduction to HTTP Live Streaming Overview

重要:如果可能的話,使用<視頻>標籤嵌入HTTP實時流媒體,並使用<對象>或<嵌入>標籤只指定後備內容。

檢查How can I play Apple HLS live stream using html5 video tag thread瞭解更多信息。

+0

還需要取消註釋/添加以下行, LoadModule headers_module modules/mod_headers.so –