From 70eabd6b00c273a04bd02ea705ad6e92eda4687e Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Mon, 13 Nov 2023 18:25:10 +1100 Subject: [PATCH] Polish README. --- just_audio/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/just_audio/README.md b/just_audio/README.md index 1f3339cb9..00093c4d5 100644 --- a/just_audio/README.md +++ b/just_audio/README.md @@ -98,6 +98,7 @@ await playlist.removeAt(3); // Setting the HTTP user agent final player = AudioPlayer( userAgent: 'myradioapp/1.0 (Linux;Android 11) https://myradioapp.com', + useProxyForRequestHeaders: true, // default ); // Setting request headers @@ -105,7 +106,9 @@ final duration = await player.setUrl('https://foo.com/bar.mp3', headers: {'header1': 'value1', 'header2': 'value2'}); ``` -Note: By default, headers are implemented via a local HTTP proxy which on Android, iOS and macOS requires non-HTTPS support to be enabled. See [Platform Specific Configuration](#platform-specific-configuration). To use the platform's native implementation of headers instead of the proxy, pass `useProxyForRequestHeaders: false` into the `AudioPlayer` constructor. On iOS/macOS, this will use the undocumented `AVURLAssetHTTPHeaderFieldsKey` API which may present issues for App Store submission. +Note: By default, headers are implemented via a local HTTP proxy which on Android, iOS and macOS requires non-HTTPS support to be enabled. See [Platform Specific Configuration](#platform-specific-configuration). + +Alternatively, settings `useProxyForRequestHeaders: false` will use the platform's native headers implementation without a proxy. Although note that iOS doesn't offer an official native API for setting headers, and so this will use the undocumented `AVURLAssetHTTPHeaderFieldsKey` API (or in the case of the user-agent header on iOS 16 and above, the official `AVURLAssetHTTPUserAgentKey` API). ### Working with caches