diff --git a/README.md b/README.md index 2a6f4ed..576e8ff 100644 --- a/README.md +++ b/README.md @@ -149,8 +149,8 @@ I used this project to test the capabilities of the following technologies: ## Roadmap * CC in Expanded Controls (iOS) -* Handle Ad Break (ad title) -* Handle queue +* Expanded Controls cosmetics (ad in progress bar, full screen, progress bar handle) * Handle mini-player +* Handle queue * Handle progress seek * Understand if it is better to refactor using streams instead of listeners \ No newline at end of file diff --git a/lib/src/cast/widgets/expanded_controls/ExpandedControlsAdInfoControls.dart b/lib/src/cast/widgets/expanded_controls/ExpandedControlsAdInfoControls.dart index ec6050a..6094ff0 100644 --- a/lib/src/cast/widgets/expanded_controls/ExpandedControlsAdInfoControls.dart +++ b/lib/src/cast/widgets/expanded_controls/ExpandedControlsAdInfoControls.dart @@ -39,12 +39,16 @@ class ExpandedControlsAdInfoControls extends StatelessWidget { return Spacer(); } + final adBreakClipInfo = mediaStatus?.mediaInfo?.adBreakClips + ?.firstWhere((a) => a?.id == adBreakClipId, orElse: () => null); + final adTitle = adBreakClipInfo?.title ?? ""; + return Expanded( child: Column( children: [ const Spacer(flex: 2), - const ExpandedControlsHighlightedText( - text: "Ad Title", // TODO: retrieve ad title from API + ExpandedControlsHighlightedText( + text: adTitle, ), const SizedBox(height: 8), Expanded(