@@ -620,6 +620,9 @@ class MediaItemMessage {
620
620
/// The rating of the MediaItemMessage.
621
621
final RatingMessage ? rating;
622
622
623
+ // Whether this is a livestream
624
+ final bool ? isLive;
625
+
623
626
/// A map of additional metadata for the media item.
624
627
///
625
628
/// The values must be integers or strings.
@@ -642,6 +645,7 @@ class MediaItemMessage {
642
645
this .displaySubtitle,
643
646
this .displayDescription,
644
647
this .rating,
648
+ this .isLive,
645
649
this .extras,
646
650
});
647
651
@@ -667,6 +671,7 @@ class MediaItemMessage {
667
671
? RatingMessage .fromMap (
668
672
_castMap (raw['rating' ] as Map <dynamic , dynamic >)! )
669
673
: null ,
674
+ isLive: raw['isLive' ] as bool ? ,
670
675
extras: _castMap (raw['extras' ] as Map <dynamic , dynamic >? ),
671
676
);
672
677
@@ -685,6 +690,7 @@ class MediaItemMessage {
685
690
'displaySubtitle' : displaySubtitle,
686
691
'displayDescription' : displayDescription,
687
692
'rating' : rating? .toMap (),
693
+ 'isLive' : isLive,
688
694
'extras' : extras,
689
695
};
690
696
}
@@ -1415,7 +1421,7 @@ class AudioServiceConfigMessage {
1415
1421
'androidNotificationChannelName' : androidNotificationChannelName,
1416
1422
'androidNotificationChannelDescription' :
1417
1423
androidNotificationChannelDescription,
1418
- 'notificationColor' : notificationColor? .value ,
1424
+ 'notificationColor' : notificationColor? ._colorValue ,
1419
1425
'androidNotificationIcon' : androidNotificationIcon,
1420
1426
'androidShowNotificationBadge' : androidShowNotificationBadge,
1421
1427
'androidNotificationClickStartsActivity' :
@@ -1438,3 +1444,14 @@ class AudioServiceConfigMessage {
1438
1444
@pragma ('vm:prefer-inline' )
1439
1445
Map <String , dynamic >? _castMap (Map <dynamic , dynamic >? map) =>
1440
1446
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