Line data Source code
1 : import 'package:flutter_chrome_cast/lib.dart';
2 :
3 : /// Android-specific implementation of queue item.
4 : class GoogleCastAndroidQueueItem extends GoogleCastQueueItem {
5 : /// Creates an Android queue item instance.
6 1 : GoogleCastAndroidQueueItem({
7 : required super.mediaInformation,
8 : super.activeTrackIds,
9 : super.autoPlay,
10 : super.customData,
11 : super.itemId,
12 : super.playbackDuration,
13 : super.preLoadTime,
14 : super.startTime,
15 : });
16 :
17 : /// Creates a queue item instance from a map.
18 1 : factory GoogleCastAndroidQueueItem.fromMap(Map<String, dynamic> map) {
19 1 : return GoogleCastAndroidQueueItem(
20 1 : mediaInformation: GoogleCastMediaInformationAndroid.fromMap(
21 2 : Map<String, dynamic>.from(map['media'])),
22 3 : activeTrackIds: List.from(map['activeTracksIds'] ?? []),
23 1 : autoPlay: map['autoplay'] ?? false,
24 1 : customData: map['customData'],
25 1 : itemId: map['itemId'],
26 1 : playbackDuration: map['playbackDuration'] == null
27 : ? null
28 0 : : Duration(seconds: map['playbackDuration']),
29 2 : preLoadTime: Duration(seconds: map['preLoadTime'] ?? 0),
30 2 : startTime: Duration(seconds: map['startTime'] ?? 0),
31 : );
32 : }
33 : }
|