From f63991f5e3507aebd11d08f5454e3c0169aec471 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Thu, 9 Feb 2023 12:31:14 +1100 Subject: [PATCH 1/2] Fix nested URIs in HLS from EXT-X-MEDIA when using headers. --- just_audio/CHANGELOG.md | 1 + just_audio/lib/just_audio.dart | 2 ++ 2 files changed, 3 insertions(+) diff --git a/just_audio/CHANGELOG.md b/just_audio/CHANGELOG.md index 7c057247b..04efa8bba 100644 --- a/just_audio/CHANGELOG.md +++ b/just_audio/CHANGELOG.md @@ -2,6 +2,7 @@ * Fix ignored tag parameter in AudioSource.asset(). * Fix ignored tag parameter in AudioSource.file(). +* Fix nested URIs in HLS from EXT-X-MEDIA when using headers. ## 0.9.31 diff --git a/just_audio/lib/just_audio.dart b/just_audio/lib/just_audio.dart index 1944dc99f..8454c89a2 100644 --- a/just_audio/lib/just_audio.dart +++ b/just_audio/lib/just_audio.dart @@ -3197,6 +3197,8 @@ _ProxyHandler _proxyHandlerForUri( // TODO: Handle other playlist formats similarly? final m3u8 = await originResponse.transform(utf8.decoder).join(); for (var line in const LineSplitter().convert(m3u8)) { + line = line.replaceAllMapped( + RegExp(r'#EXT-X-MEDIA:.*?URI="(.*?)".*'), (m) => m[1]!); line = line.replaceAll(RegExp(r'#.*$'), '').trim(); if (line.isEmpty) continue; try { From 932fdccfd330a3ea6c7b10ce4941aeee0141a3e9 Mon Sep 17 00:00:00 2001 From: Ryan Heise Date: Thu, 9 Feb 2023 11:51:24 +1100 Subject: [PATCH 2/2] Fix deprecation warnings. --- just_audio/example/lib/common.dart | 2 +- just_audio/example/lib/example_playlist.dart | 4 ++-- just_audio/example/lib/example_radio.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/just_audio/example/lib/common.dart b/just_audio/example/lib/common.dart index 1e681addf..ce5407fe0 100644 --- a/just_audio/example/lib/common.dart +++ b/just_audio/example/lib/common.dart @@ -101,7 +101,7 @@ class SeekBarState extends State { .firstMatch("$_remaining") ?.group(1) ?? '$_remaining', - style: Theme.of(context).textTheme.caption), + style: Theme.of(context).textTheme.bodySmall), ), ], ); diff --git a/just_audio/example/lib/example_playlist.dart b/just_audio/example/lib/example_playlist.dart index 898fad637..d752e534a 100644 --- a/just_audio/example/lib/example_playlist.dart +++ b/just_audio/example/lib/example_playlist.dart @@ -181,7 +181,7 @@ class MyAppState extends State with WidgetsBindingObserver { ), ), Text(metadata.album, - style: Theme.of(context).textTheme.headline6), + style: Theme.of(context).textTheme.titleLarge), Text(metadata.title), ], ); @@ -235,7 +235,7 @@ class MyAppState extends State with WidgetsBindingObserver { Expanded( child: Text( "Playlist", - style: Theme.of(context).textTheme.headline6, + style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center, ), ), diff --git a/just_audio/example/lib/example_radio.dart b/just_audio/example/lib/example_radio.dart index e725727ad..da45fbc90 100644 --- a/just_audio/example/lib/example_radio.dart +++ b/just_audio/example/lib/example_radio.dart @@ -94,7 +94,7 @@ class MyAppState extends State with WidgetsBindingObserver { Padding( padding: const EdgeInsets.only(top: 8.0), child: Text(title, - style: Theme.of(context).textTheme.headline6), + style: Theme.of(context).textTheme.titleLarge), ), ], );