302重新導向最佳化可將302個重新導向回應的數目減到最少,讓您的應用程式更有效率地平衡負載。
如果重新導向主資訊清單請求,而您的播放器中已啟用302最佳化,則後續從該資訊清單請求資產時,會使用最終網域位置,以避免額外302個回應。 此功能預設為啟用,您可以變更此設定。
使用useRedirectedUrl
屬性開啟302重新導向(true
)或關閉(false
)。
例如:
// Set useRedirectedUrl property to false
NetworkConfiguration networkConfiguration = new NetworkConfiguration();
networkConfiguration.setUseRedirectedUrl(false);
//Set NetworkConfiguration on MediaPlayerItemConfig
MediaPlayerItemConfig config = new MediaPlayerItemConfig ();
config.setNetworkConfiguration(networkConfiguration);
//Use this config when loading the MediaPlayerItem or calling replaceCurrentResource