@@ -620,6 +620,9 @@ class MediaItemMessage {
620620 /// The rating of the MediaItemMessage.
621621 final RatingMessage ? rating;
622622
623+ // Whether this is a livestream
624+ final bool ? isLive;
625+
623626 /// A map of additional metadata for the media item.
624627 ///
625628 /// The values must be integers or strings.
@@ -642,6 +645,7 @@ class MediaItemMessage {
642645 this .displaySubtitle,
643646 this .displayDescription,
644647 this .rating,
648+ this .isLive,
645649 this .extras,
646650 });
647651
@@ -667,6 +671,7 @@ class MediaItemMessage {
667671 ? RatingMessage .fromMap (
668672 _castMap (raw['rating' ] as Map <dynamic , dynamic >)! )
669673 : null ,
674+ isLive: raw['isLive' ] as bool ? ,
670675 extras: _castMap (raw['extras' ] as Map <dynamic , dynamic >? ),
671676 );
672677
@@ -685,6 +690,7 @@ class MediaItemMessage {
685690 'displaySubtitle' : displaySubtitle,
686691 'displayDescription' : displayDescription,
687692 'rating' : rating? .toMap (),
693+ 'isLive' : isLive,
688694 'extras' : extras,
689695 };
690696}
@@ -1415,7 +1421,7 @@ class AudioServiceConfigMessage {
14151421 'androidNotificationChannelName' : androidNotificationChannelName,
14161422 'androidNotificationChannelDescription' :
14171423 androidNotificationChannelDescription,
1418- 'notificationColor' : notificationColor? .value ,
1424+ 'notificationColor' : notificationColor? ._colorValue ,
14191425 'androidNotificationIcon' : androidNotificationIcon,
14201426 'androidShowNotificationBadge' : androidShowNotificationBadge,
14211427 'androidNotificationClickStartsActivity' :
@@ -1438,3 +1444,14 @@ class AudioServiceConfigMessage {
14381444@pragma ('vm:prefer-inline' )
14391445Map <String , dynamic >? _castMap (Map <dynamic , dynamic >? map) =>
14401446 map? .cast <String , dynamic >();
1447+
1448+ /// Reimplements deprecated Color.value.
1449+ extension _ColorExtension on Color {
1450+ int get _colorValue =>
1451+ _floatToInt8 (a) << 24 |
1452+ _floatToInt8 (r) << 16 |
1453+ _floatToInt8 (g) << 8 |
1454+ _floatToInt8 (b) << 0 ;
1455+
1456+ int _floatToInt8 (double x) => (x * 255.0 ).round () & 0xff ;
1457+ }
0 commit comments